1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-09 07:53:55 +02:00

Properly normalize the content-addressed paths

Make sure that their timestamp are always normalized.
Otherwise, strange − and non-deterministic − things might happen, like
https://github.com/NixOS/nixpkgs/issues/121813

Fix #4775
This commit is contained in:
regnat 2021-05-05 21:00:08 +02:00
parent fe3a10a9b2
commit bf485dcf46
3 changed files with 19 additions and 4 deletions

View file

@ -10,3 +10,10 @@ nix build -f multiple-outputs.nix --json a.all b.all | jq --exit-status '
(.drvPath | match(".*multiple-outputs-b.drv")) and
(.outputs.out | match(".*multiple-outputs-b")))
'
testNormalization () {
clearStore
outPath=$(nix-build ./simple.nix)
test "$(stat -c %Y $outPath)" -eq 1
}
testNormalization