File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -2584,6 +2584,7 @@ void DerivationGoal::writeStructuredAttrs()
2584
2584
2585
2585
writeFile (tmpDir + " /.attrs.json" , rewriteStrings (json.dump (), inputRewrites));
2586
2586
chownToBuilder (tmpDir + " /.attrs.json" );
2587
+ env[" NIX_ATTRS_JSON_FILE" ] = tmpDirInSandbox + " /.attrs.json" ;
2587
2588
2588
2589
/* As a convenience to bash scripts, write a shell file that
2589
2590
maps all attributes that are representable in bash -
@@ -2653,6 +2654,7 @@ void DerivationGoal::writeStructuredAttrs()
2653
2654
2654
2655
writeFile (tmpDir + " /.attrs.sh" , rewriteStrings (jsonSh, inputRewrites));
2655
2656
chownToBuilder (tmpDir + " /.attrs.sh" );
2657
+ env[" NIX_ATTRS_SH_FILE" ] = tmpDirInSandbox + " /.attrs.sh" ;
2656
2658
}
2657
2659
2658
2660
Original file line number Diff line number Diff line change @@ -38,6 +38,12 @@ mkDerivation {
38
38
[[ $json =~ '"narSize":288' ]]
39
39
[[ $json =~ '"closureSize":288' ]]
40
40
[[ $json =~ '"references":[]' ]]
41
+
42
+ [[ -e "$NIX_ATTRS_SH_FILE" ]]
43
+ [[ -e "$NIX_ATTRS_JSON_FILE" ]]
44
+
45
+ [[ "$(<"$NIX_ATTRS_SH_FILE")" = "$(<.attrs.sh)" ]]
46
+ [[ "$(<"$NIX_ATTRS_JSON_FILE")" = "$(<.attrs.json)" ]]
41
47
'' ;
42
48
43
49
buildInputs = [ "a" "b" "c" 123 "'" "\" " null ] ;
You can’t perform that action at this time.
0 commit comments