mirror of
https://github.com/NixOS/nix
synced 2025-07-07 06:01:48 +02:00
Merge pull request #4284 from tweag/fixed-output-depending-on-ca
Allow fixed-output derivations to depend on (floating) content-addressed ones
This commit is contained in:
commit
e5cf501c77
3 changed files with 34 additions and 5 deletions
|
@ -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
|
||||
'';
|
||||
|
||||
};
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@ testCutoff () {
|
|||
#testDerivation dependentCA
|
||||
testCutoffFor transitivelyDependentCA
|
||||
testCutoffFor dependentNonCA
|
||||
testCutoffFor dependentFixedOutput
|
||||
}
|
||||
|
||||
testGC () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue