-
-
Notifications
You must be signed in to change notification settings - Fork 164
Cachix #459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cachix #459
Conversation
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 know this is just a draft, but I have a few comments and suggestions. We'll also need to add cachix
to the environment (maybe shell.nix
) at some point.
Thanks for the suggestions @cole-h. I've marked this ready for review now ;) |
cc @grahamc |
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.
A few more nits.
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.
A few more nits I missed the last time and LGTM.
Co-Authored-By: Cole Helbling <cole.e.helbling@outlook.com>
Co-Authored-By: Cole Helbling <cole.e.helbling@outlook.com>
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.
LGTM! Thanks for dealing with my nitpicks :)
info!("Done!"); | ||
} | ||
} | ||
|
||
fn cache_push(cfg: &CachixConfig, log: Vec<String>) -> bool { | ||
if !log.is_empty() { | ||
let store_path = log.last().unwrap(); |
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.
Something I just thought of that should probably be addressed: what about when there were multiple builds, e.g. here: https://logs.nix.ci/?key=nixos/nixpkgs.82982&attempt_id=62265253-63b3-44e2-aa81-3fb8464be6ff
/nix/store/vb15nidh4wbsg9lrf93iv859mvkbn0pl-ripgrep-12.0.1
/nix/store/vywixxgrbrq76nbdra96h3nzrlnagq5m-zcash-2.1.1-1
/nix/store/v9c8cyl9rrspkv18w0f6b56ydb0350gf-lsd-0.17.0
In this case, I believe only the lsd
path will be pushed to the cache.
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.
Good point! We can either call cache_push
for each path or pipe them to Cachix via stdin
. Just need to identify all the paths - maybe something like get all the last few consecutive lines matching /nix/store
prefix?
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.
Or, get the last n
lines, where n = number of built attrs
? We gate this on a successful build anyways, so this should be a safe bet (assuming that any failing build sets status to be not-BuildStatus::Success
-- I'll have to read through the source again to be entirely certain).
Or both, as sanity checks for the other?
I'll do some brainstorming.
I decided I don't care. |
It would be great if binaries were pushed and available to users for testing. I'm happy to sponsor a cache for ofborg if someone manages to get integration working. |
I have no idea what I'm doing.