mirror of
https://github.com/NixOS/nix
synced 2025-06-25 06:31:14 +02:00
Do not rely on $stdenv/setup to set output variables
Instead of relying on setup script to set output variables when
structured attributes are enabled, iterate over the values of an
outputs associative array.
See also
374fa3532e/pkgs/stdenv/generic/setup.sh (L23-L26)
This commit is contained in:
parent
65d711351e
commit
664532c533
4 changed files with 38 additions and 29 deletions
|
@ -21,14 +21,6 @@ let pkgs = rec {
|
|||
export PATH=$PATH:$pkg/bin
|
||||
done
|
||||
|
||||
# mimic behavior of stdenv for `$out` etc. for structured attrs.
|
||||
if [ -n "''${NIX_ATTRS_SH_FILE}" ]; then
|
||||
for o in "''${!outputs[@]}"; do
|
||||
eval "''${o}=''${outputs[$o]}"
|
||||
export "''${o}"
|
||||
done
|
||||
fi
|
||||
|
||||
declare -a arr1=(1 2 "3 4" 5)
|
||||
declare -a arr2=(x $'\n' $'x\ny')
|
||||
fun() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue