binary-cache: accept full store paths in narinfo StorePath field#1793
Open
Mic92 wants to merge 1 commit into
Open
binary-cache: accept full store paths in narinfo StorePath field#1793Mic92 wants to merge 1 commit into
Mic92 wants to merge 1 commit into
Conversation
Ericson2314
reviewed
Jun 11, 2026
| // only accepts the base name. Parsing via the store | ||
| // directory (assumed to be the default one throughout this | ||
| // function) also rejects narinfos for a different store. | ||
| store_path_opt = Some(StoreDir::default().parse(val).map_err( |
Member
There was a problem hiding this comment.
Fine for hydra.nixos.org, but the StoreDir here ought to be a parameter that we pass in.
(Also presumably this parsing logic is in Harmonia?)
Member
There was a problem hiding this comment.
nix-community/harmonia#1080 the logic is in Harmonia now (asked @amaanq to write from scratch)
The StorePath field of a narinfo holds the full path (/nix/store/<hash>-<name>); cache.nixos.org serves it that way and harmonia_store_nar_info, used for our own uploads, writes it that way. parse_narinfo fed the value into StorePath::from_str, which only accepts the base name, so every spec-conforming narinfo failed to parse. The queue runner therefore could not read back narinfos from its own binary cache: has_narinfo failed for every path, uploads were repeated endlessly and copy_paths errors failed the affected builds. Observed on a 120-build nixos-small evaluation against an S3 cache populated by the runner itself: 2067 'invalid value for StorePath' errors and all 120 builds failing with status 2. Parse the field relative to the store directory instead. This also rejects narinfos for a different store; parse_narinfo already assumes the default store directory for the rest of the result.
d59671d to
19fc689
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The StorePath field of a narinfo holds the full path (/nix/store/-); cache.nixos.org serves it that way and harmonia_store_nar_info, used for our own uploads, writes it that way. parse_narinfo fed the value into StorePath::from_str, which only accepts the base name, so every spec-conforming narinfo failed to parse.
The queue runner therefore could not read back narinfos from its own binary cache: has_narinfo failed for every path, uploads were repeated endlessly and copy_paths errors failed the affected builds. Observed on a 120-build nixos-small evaluation against an S3 cache populated by the runner itself: 2067 'invalid value for StorePath' errors and all 120 builds failing with status 2.
Parse the field relative to the store directory instead. This also rejects narinfos for a different store; parse_narinfo already assumes the default store directory for the rest of the result.