Test that the result of readFile gets ref-scanned

This commit is contained in:
Théophane Hufschmitt 2022-11-14 15:13:46 +01:00 committed by Naïm Favier
parent 6bf8736517
commit cb39e9a99e
No known key found for this signature in database
GPG key ID: 95AFCE8211908325
2 changed files with 14 additions and 6 deletions

View file

@ -1 +0,0 @@
echo "$input" > $out

View file

@ -6,14 +6,23 @@ let
dependent = mkDerivation {
name = "dependent";
builder = ./readfile-context.builder.sh;
input = "${input}/hello";
buildCommand = ''
mkdir -p $out
echo -n "$input1" > "$out/file1"
echo -n "$input2" > "$out/file2"
'';
input1 = "${input}/hello";
input2 = "hello";
};
readDependent = mkDerivation {
name = "read-dependent";
builder = ./readfile-context.builder.sh;
input = builtins.readFile dependent;
# Will evaluate correctly because file2 doesn't have any references,
# even though the `dependent` derivation does.
name = builtins.readFile (dependent + "/file2");
buildCommand = ''
echo "$input" > "$out"
'';
input = builtins.readFile (dependent + "/file1");
};
in readDependent