summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-12-01 20:25:41 +0100
committerGitHub <noreply@github.com>2020-12-01 20:25:41 +0100
commite5cf501c774bad1dfcde1aff9af0c5fc8c0d333d (patch)
tree1800ce5b8e1842eac4c119d9e09c31655c1a6bd7 /tests
parent5a6ddb3de14a1684af6c793d663764d093fa7846 (diff)
parent9bd8184f1fb2e91ac4fb7207abe56f2a30a81d97 (diff)
Merge pull request #4284 from tweag/fixed-output-depending-on-ca
Allow fixed-output derivations to depend on (floating) content-addressed ones
Diffstat (limited to 'tests')
-rw-r--r--tests/content-addressed.nix20
-rw-r--r--tests/content-addressed.sh1
2 files changed, 18 insertions, 3 deletions
diff --git a/tests/content-addressed.nix b/tests/content-addressed.nix
index 8ca96d4bf..61079176f 100644
--- a/tests/content-addressed.nix
+++ b/tests/content-addressed.nix
@@ -16,14 +16,16 @@ rec {
};
rootCA = mkDerivation {
name = "rootCA";
- outputs = [ "out" "dev" ];
+ outputs = [ "out" "dev" "foo"];
buildCommand = ''
echo "building a CA derivation"
echo "The seed is ${toString seed}"
mkdir -p $out
echo ${rootLegacy}/hello > $out/dep
- # test symlink at root
+ ln -s $out $out/self
+ # test symlinks at root
ln -s $out $dev
+ ln -s $out $foo
'';
__contentAddressed = true;
outputHashMode = "recursive";
@@ -34,7 +36,8 @@ rec {
buildCommand = ''
echo "building a dependent derivation"
mkdir -p $out
- echo ${rootCA}/hello > $out/dep
+ cat ${rootCA}/self/dep
+ echo ${rootCA}/self/dep > $out/dep
'';
__contentAddressed = true;
outputHashMode = "recursive";
@@ -60,4 +63,15 @@ rec {
echo ${rootCA}/non-ca-hello > $out/dep
'';
};
+ dependentFixedOutput = mkDerivation {
+ name = "dependent-fixed-output";
+ outputHashMode = "recursive";
+ outputHashAlgo = "sha256";
+ outputHash = "sha256-QvtAMbUl/uvi+LCObmqOhvNOapHdA2raiI4xG5zI5pA=";
+ buildCommand = ''
+ cat ${dependentCA}/dep
+ echo foo > $out
+ '';
+
+ };
}
diff --git a/tests/content-addressed.sh b/tests/content-addressed.sh
index bdab09c86..52f7529b5 100644
--- a/tests/content-addressed.sh
+++ b/tests/content-addressed.sh
@@ -40,6 +40,7 @@ testCutoff () {
#testDerivation dependentCA
testCutoffFor transitivelyDependentCA
testCutoffFor dependentNonCA
+ testCutoffFor dependentFixedOutput
}
testGC () {