RemoteFSAccessor: Make the local NAR cache content-addressed#14948
Merged
Ericson2314 merged 2 commits intomasterfrom Jan 13, 2026
Merged
RemoteFSAccessor: Make the local NAR cache content-addressed#14948Ericson2314 merged 2 commits intomasterfrom
Ericson2314 merged 2 commits intomasterfrom
Conversation
Member
|
Do we need to bump a cache version? |
Member
Author
|
@Ericson2314 There is no version at the moment. There shouldn't be any upgrade issues since the new file names in the cache have a different length. |
Ericson2314
reviewed
Jan 8, 2026
Ericson2314
reviewed
Jan 8, 2026
Ericson2314
reviewed
Jan 8, 2026
Ericson2314
requested changes
Jan 8, 2026
Member
There was a problem hiding this comment.
There is no version at the moment. There shouldn't be any upgrade issues since the new file names in the cache have a different length.
sounds good
OK generally looks good, but I would make it a double map (see final comment) so we don't end up opening multiple NAR accessors for the same NAR.
949d142 to
ab2f409
Compare
Ericson2314
approved these changes
Jan 13, 2026
Use double-indirection for better NAR accessor caching Co-authored-by: John Ericson <John.Ericson@Obsidian.Systems>
It was not pulling its weight. (Only used once, optional paths are confusing, we already have an `if` / branch fit-for-purpose.)
ab2f409 to
2af5792
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.
Motivation
Previously, the local NAR cache was indexed by the store path hash. Making it content-addressed (i.e. indexed by NAR hash) provides some potential deduplication, but more importantly, makes it possible to substitute NARs from the local NAR cache with fewer trust issues (see DeterminateSystems#279).
Context
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.