Skip to content

Conversation

@edolstra
Copy link
Member

@edolstra edolstra commented Jan 7, 2026

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.

@edolstra edolstra requested a review from Ericson2314 as a code owner January 7, 2026 21:49
@Ericson2314
Copy link
Member

Do we need to bump a cache version?

@edolstra
Copy link
Member Author

edolstra commented Jan 8, 2026

@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.

Copy link
Member

@Ericson2314 Ericson2314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Use double-indirection for better NAR accessor caching

Co-authored-by: John Ericson <[email protected]>
@Ericson2314 Ericson2314 disabled auto-merge January 13, 2026 04:01
It was not pulling its weight. (Only used once, optional paths are
confusing, we already have an `if` / branch fit-for-purpose.)
@Ericson2314 Ericson2314 enabled auto-merge January 13, 2026 04:12
@Ericson2314 Ericson2314 added this pull request to the merge queue Jan 13, 2026
Merged via the queue into master with commit 7ac5a61 Jan 13, 2026
18 checks passed
@Ericson2314 Ericson2314 deleted the ca-nar-cache branch January 13, 2026 05:37
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.

2 participants