-
Notifications
You must be signed in to change notification settings - Fork 69
Conversation
f95f17c
to
42aa124
Compare
Okay, the test should now work. |
42aa124
to
a54f395
Compare
2b3a744
to
d7187cc
Compare
0476708
to
dcc55ab
Compare
Heck! It’s green! |
Btw, I’m not sure whether we really need the dependency on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like there are a lot of TODOs to be done. I think it'd be good to get those done prior to a thorough review?
I want to get this PR merged, it’s been open for too long. Since I documented every TODO in the comments, we can fix them in separate PRs. |
Getting the existing TODOs todone won't be a substantial lift, and when possible, it is always better to get it done before integration. Let's do it in this PR. |
b94bf20
to
31aae02
Compare
69c2e5f
to
a672eba
Compare
Anything we're waiting on here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review done, giving it a go
} | ||
|
||
/// Wrap a socket with a timeout. Inspired by https://docs.rs/crate/timeout-readwrite/0.2.0/. | ||
mod timeout { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't love the code in this module, it feels quite complex and I don't really want to "own" it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It’s sadly the only thing to not break the Darwin socket implementation in non-debuggable ways. Just setting the socket timeout option worked fine on Linux, but not on Darwin. It’s just a small wrapper around the poll(2)
syscall, nothing extremely complex or error-prone.
a1d5415
to
07eac0d
Compare
This way we keep all project-wide constant setup in one place.
Creates a dedicated directory for GC roots, because we need a collision-free space for our socket files in the toplevel directory.
We can watch an arbitrary nix file. The rest of the codebase already uses `nix_file`, so rename for consistency.
The `id` function hashed the full path and the name. The latter was completely determined by the full path, so name is redundant. When we want to allow any nix file, we cannot determine name anyway (without it panicking for some file paths).
lorri cannot have a sensible concept of a project directory. Builders need only a valid nix file to function. We can still expose the convenience that `shell.nix` is automatically discovered and used as the default nix file, even without explicitely tracking the parent directory of that shell file.
Slight refactoring of `main()` is necessary to correctly set up the roots.
Projects are just a trivial wrapper around a nix file path and gc_root directory, so we don’t need to actually clone that info.
After the client opens a connection, the server won’t wait forever for a message to free its resouces.
The daemon gets the files to evaluate over the socket instead of from `shell.nix` on startup.
Co-authored-by: Graham Christensen <[email protected]>
Internal & experimental commands should be differentiable from user-commands.
Co-authored-by: Graham Christensen <[email protected]>
1fdd65d
to
40dc0d3
Compare
Implements a
lorri daemon
command listening on a unix socket and alorri ping
command to send a build job to the daemon.The test is still WIP, blocking on some action.
There’s still a few
TODO
s left, which will be addressed in a successive PR.