create cache entry for paths already in the nix store#12911
create cache entry for paths already in the nix store#12911roberth merged 1 commit intoNixOS:masterfrom
Conversation
41f4413 to
5d3dd2d
Compare
64b673d to
220aba2
Compare
roberth
left a comment
There was a problem hiding this comment.
This looks like an ok fix in terms of behavior, but I'm a little worried about the duplication between getAccessor and fetchToStore. Presumably the former could use the latter, or a factored out method?
I am not quite sure how this is supposed to work. But I would also suggest that we would have a simple way to fix this issue because this is something I also want to backport. |
This allows path:/nix/store/* paths to not be copied twice to the nix store.
…2911 create cache entry for paths already in the nix store (backport #12911)
…2911 create cache entry for paths already in the nix store (backport #12911)
…2911 create cache entry for paths already in the nix store (backport #12911)
…2911 create cache entry for paths already in the nix store (backport #12911)
|
Part of releases:
2.28 is a continuation of 2.27. |
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2025-04-09-clan-weekly-changelog/62846/1 |
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/nix-copying-a-store-path-into-the-store/60409/16 |
Previously when creating the accessor for substituted/cached inputs, Nix would neither: - Ensure a cache entry exists for the substituted inputs (which are already in the store) - Use the cache for substituted inputs. Instead, it attempted to find the always missing fingerprint of the original, unsubstituted input Both of these led to severe slowdowns in some scenarios where a large input (like Nixpkgs) had already been unpacked to the store but didn't exist in a users cache, as described in NixOS#11228 The work in NixOS#12911 already fixed this in most cases, but here we can ensure it applies to the substituted store paths used for inputs
Previously when creating the accessor for substituted/cached inputs, Nix would neither: - Ensure a cache entry exists for the substituted inputs (which are already in the store) - Use the cache for substituted inputs. Instead, it attempted to find the always missing fingerprint of the original, unsubstituted input Both of these led to severe slowdowns in some scenarios where a large input (like Nixpkgs) had already been unpacked to the store but didn't exist in a users cache, as described in NixOS#11228 The work in NixOS#12911 already fixed this in most cases, but here we can ensure it applies to the substituted store paths used for inputs
Previously, Nix would not create a cache entry for substituted/cached inputs This led to severe slowdowns in some scenarios where a large input (like Nixpkgs) had already been unpacked to the store but didn't exist in a users cache, as described in NixOS#11228 Using the same method as NixOS#12911, we can create a cache entry for the fingerprint of substituted/cached inputs and avoid this problem entirely
Previously, Nix would not create a cache entry for substituted/cached inputs This led to severe slowdowns in some scenarios where a large input (like Nixpkgs) had already been unpacked to the store but didn't exist in a users cache, as described in NixOS#11228 Using the same method as NixOS#12911, we can create a cache entry for the fingerprint of substituted/cached inputs and avoid this problem entirely
This allows path:/nix/store/* paths to not be copied twice to the nix store.
Motivation
Context
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.