* Add a test for unsafeDiscardOutputDependency. Not really related to
multiple outputs, but good to have anyway.
This commit is contained in:
parent
179409b911
commit
4be5a2c096
|
@ -42,6 +42,16 @@ rec {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
d = mkDerivation {
|
||||||
|
name = "multiple-outputs-d";
|
||||||
|
drv = builtins.unsafeDiscardOutputDependency b.drvPath;
|
||||||
|
builder = builtins.toFile "builder.sh"
|
||||||
|
''
|
||||||
|
mkdir $out
|
||||||
|
echo $drv > $out/drv
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
cyclic = (mkDerivation {
|
cyclic = (mkDerivation {
|
||||||
name = "cyclic-outputs";
|
name = "cyclic-outputs";
|
||||||
outputs = [ "a" "b" ];
|
outputs = [ "a" "b" ];
|
||||||
|
|
|
@ -14,6 +14,12 @@ drvPath2=$(nix-instantiate multiple-outputs.nix -A c)
|
||||||
grep -q 'multiple-outputs-a.drv",\["first","second"\]' $drvPath
|
grep -q 'multiple-outputs-a.drv",\["first","second"\]' $drvPath
|
||||||
grep -q 'multiple-outputs-b.drv",\["out"\]' $drvPath
|
grep -q 'multiple-outputs-b.drv",\["out"\]' $drvPath
|
||||||
|
|
||||||
|
# While we're at it, test the ‘unsafeDiscardOutputDependency’ primop.
|
||||||
|
outPath=$(nix-build multiple-outputs.nix -A d)
|
||||||
|
drvPath=$(cat $outPath/drv)
|
||||||
|
outPath=$(nix-store -q $drvPath)
|
||||||
|
! [ -e "$outPath" ]
|
||||||
|
|
||||||
# Do a build of something that depends on a derivation with multiple
|
# Do a build of something that depends on a derivation with multiple
|
||||||
# outputs.
|
# outputs.
|
||||||
echo "building b..."
|
echo "building b..."
|
||||||
|
|
Loading…
Reference in a new issue