mirror of
https://github.com/NixOS/nix
synced 2025-07-12 19:05:08 +02:00
Merge remote-tracking branch 'obsidian/single-ca-drv-build' into ca-floating-upstream
Tests also now fail as they should
This commit is contained in:
commit
b836662f50
2 changed files with 32 additions and 18 deletions
|
@ -2,20 +2,23 @@
|
|||
|
||||
source common.sh
|
||||
|
||||
drv=$(nix-instantiate --experimental-features ca-derivations ./content-addressed.nix -A root --arg seed 1)
|
||||
drv=$(nix-instantiate --experimental-features ca-derivations ./content-addressed.nix -A rootCA --arg seed 1)
|
||||
nix --experimental-features 'nix-command ca-derivations' show-derivation --derivation "$drv" --arg seed 1
|
||||
|
||||
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 "${extraArgs[@]}")
|
||||
test $out1 == $out2
|
||||
local out1 out2
|
||||
out1=$(set -e; nix-build "${commonArgs[@]}" --arg seed 1)
|
||||
out2=$(nix-build "${commonArgs[@]}" --arg seed 2 "${secondSeedArgs[@]}")
|
||||
test "$out1" == "$out2"
|
||||
}
|
||||
|
||||
testDerivation root
|
||||
testDerivation rootCA
|
||||
# The seed only changes the root derivation, and not it's output, so the
|
||||
# dependent derivations should only need to be built once.
|
||||
extaArgs=(-j0)
|
||||
testDerivation dependent
|
||||
testDerivation transitivelyDependent
|
||||
secondSeedArgs=(-j0)
|
||||
# Don't directly build depenentCA, that way we'll make sure we dodn't rely on
|
||||
# dependent derivations always being already built.
|
||||
#testDerivation dependentCA
|
||||
testDerivation transitivelyDependentCA
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue