Skip to content
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

Closed
wants to merge 2 commits into from
Closed

Cachix #459

wants to merge 2 commits into from

Conversation

sorki
Copy link
Member

@sorki sorki commented Apr 12, 2020

I have no idea what I'm doing.

Copy link
Member

@cole-h cole-h left a 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.

README.md Show resolved Hide resolved
ofborg/src/tasks/build.rs Outdated Show resolved Hide resolved
ofborg/src/tasks/build.rs Outdated Show resolved Hide resolved
ofborg/src/tasks/build.rs Outdated Show resolved Hide resolved
@sorki sorki marked this pull request as ready for review April 26, 2020 13:12
@sorki
Copy link
Member Author

sorki commented Apr 26, 2020

Thanks for the suggestions @cole-h. I've marked this ready for review now ;)

@domenkozar
Copy link
Member

cc @grahamc

Copy link
Member

@cole-h cole-h left a 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.

README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
ofborg/src/tasks/build.rs Outdated Show resolved Hide resolved
ofborg/src/tasks/build.rs Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
ofborg/src/tasks/githubcommentposter.rs Outdated Show resolved Hide resolved
Copy link
Member

@cole-h cole-h left a 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.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
ofborg/src/tasks/build.rs Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
sorki and others added 2 commits April 26, 2020 17:19
Co-Authored-By: Cole Helbling <cole.e.helbling@outlook.com>
Co-Authored-By: Cole Helbling <cole.e.helbling@outlook.com>
Copy link
Member

@cole-h cole-h left a 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();
Copy link
Member

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.

Copy link
Member Author

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?

Copy link
Member

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.

@sorki
Copy link
Member Author

sorki commented Mar 1, 2021

I decided I don't care.

@sorki sorki closed this Mar 1, 2021
@domenkozar
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants