1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-08 19:46:02 +01:00

Revert "Use the hash modulo in the derivation outputs"

Fix #11897

As described in the issue, this makes for a simpler and much more
intuitive notion of a realisation key. This is better for pedagogy, and
interoperability between more tools.

The way the issue was written was that we would switch to only having
shallow realisations first, and then do this. But going to only shallow
realisations is more complex change, and it turns out we weren't even
testing for the benefits that derivation hashes (modulo FODs) provided
in the deep realisation case, so I now just want to do this first.

Doing this gets the binary cache data structures in order, which will
unblock the Hydra fixed-output-derivation tracking work. I don't want to
delay that work while I figure out the changes needed for
shallow-realisations only.

This reverts commit bab1cda0e6.
This commit is contained in:
John Ericson 2025-02-12 23:54:24 -05:00
parent f392663533
commit b41ce0d263
53 changed files with 909 additions and 700 deletions

View file

@ -49,14 +49,14 @@ fi
clearStore
nix build --file ../simple.nix -L --no-link --post-build-hook "$pushToStore"
clearStore
rm -r "$REMOTE_STORE_DIR/realisations"
rm -r "$REMOTE_STORE_DIR/build-trace"
nix build --file ../simple.nix -L --no-link --substitute --substituters "$REMOTE_STORE" --no-require-sigs -j0
# There's no easy way to check whether a realisation is present on the local
# store short of manually querying the db, but the build environment doesn't
# have the sqlite binary so we instead push things again, and check that the
# realisations have correctly been pushed to the remote store
nix copy --to "$REMOTE_STORE" --file ../simple.nix
if [[ -z "$(ls "$REMOTE_STORE_DIR/realisations")" ]]; then
if [[ -z "$(ls "$REMOTE_STORE_DIR/build-trace")" ]]; then
echo "Realisations not rebuilt"
exit 1
fi
@ -71,5 +71,5 @@ buildDrvs --substitute --substituters "$REMOTE_STORE" --no-require-sigs -j0
# Try rebuilding, but remove the realisations from the remote cache to force
# using the cachecache
clearStore
rm "$REMOTE_STORE_DIR"/realisations/*
rm -r "$REMOTE_STORE_DIR"/build-trace/*
buildDrvs --substitute --substituters "$REMOTE_STORE" --no-require-sigs -j0