mirror of
https://github.com/NixOS/nix.git
synced 2025-11-15 06:52:43 +01:00
Set environment variables for .attrs.json & .attrs.sh
This way no derivation has to expect that these files are in the `cwd` during the build. This is problematic for `nix-shell` where these files would have to be inserted into the nix-shell's `cwd` which can become problematic with e.g. recursive `nix-shell`. To remain backwards-compatible, the location inside the build sandbox will be kept, however using these files directly should be deprecated from now on.
This commit is contained in:
parent
3b5429aec1
commit
3944a120ec
4 changed files with 11 additions and 10 deletions
|
|
@ -1093,8 +1093,10 @@ void LocalDerivationGoal::writeStructuredAttrs()
|
|||
|
||||
writeFile(tmpDir + "/.attrs.sh", rewriteStrings(jsonSh, inputRewrites));
|
||||
chownToBuilder(tmpDir + "/.attrs.sh");
|
||||
env["ATTRS_SH_FILE"] = tmpDir + "/.attrs.sh";
|
||||
writeFile(tmpDir + "/.attrs.json", rewriteStrings(json.dump(), inputRewrites));
|
||||
chownToBuilder(tmpDir + "/.attrs.json");
|
||||
env["ATTRS_JSON_FILE"] = tmpDir + "/.attrs.json";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue