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

CA derivations that depend on other CA derivations

Co-authored-by: Théophane Hufschmitt <regnat@users.noreply.github.com>
This commit is contained in:
John Ericson 2020-08-22 20:44:47 +00:00
parent e0b0e18905
commit 8eb73a8724
6 changed files with 189 additions and 28 deletions

View file

@ -2,15 +2,17 @@
source common.sh
clearStore
clearCache
export REMOTE_STORE=file://$cacheDir
drv=$(nix-instantiate --experimental-features ca-derivations ./content-addressed.nix --arg seed 1)
drv=$(nix-instantiate --experimental-features ca-derivations ./content-addressed.nix -A root --arg seed 1)
nix --experimental-features 'nix-command ca-derivations' show-derivation --derivation "$drv" --arg seed 1
out1=$(nix-build --experimental-features ca-derivations ./content-addressed.nix --arg seed 1 --no-out-link)
out2=$(nix-build --experimental-features ca-derivations ./content-addressed.nix --arg seed 2 --no-out-link)
testDerivation () {
local derivationPath=$1
local commonArgs=("--experimental-features" "ca-derivations" "./content-addressed.nix" "-A" "$derivationPath" "--no-out-link")
local out1=$(nix-build "${commonArgs[@]}" --arg seed 1)
local out2=$(nix-build "${commonArgs[@]}" --arg seed 2)
test $out1 == $out2
}
test $out1 == $out2
testDerivation root
testDerivation dependent
testDerivation transitivelyDependent