1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-25 02:10:54 +01:00

libfetchers: avoid re-copying substituted 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 https://github.com/NixOS/nix/issues/11228

Using the same method as https://github.com/NixOS/nix/pull/12911, we can
create a cache entry for the fingerprint of substituted/cached inputs
and avoid this problem entirely
This commit is contained in:
Seth Flynn 2025-09-22 05:59:11 -04:00
parent ab7feb3898
commit 74305d5260
No known key found for this signature in database
GPG key ID: D31BD0D494BBEE86
2 changed files with 20 additions and 0 deletions

View file

@ -0,0 +1,10 @@
---
synopsis: "Substituted flake inputs are no longer re-copied to the store"
prs: [14041]
---
Since 2.25, Nix would fail to store a cache entry for substituted flake inputs,
which in turn would cause them to be re-copied to the store on initial
evaluation. Caching these inputs results in a near doubling of a performance in
some cases — especially on I/O-bound machines and when using commands that
fetch many inputs, like `nix flake archive/prefetch-inputs`