Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkgs/build-support/testers/expect-failure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ echo "testBuildFailure: Original builder produced exit code: $r"
#
# NOTE: This MUST be done after the original builder has finished!
# Otherwise we could pollute its environment.
if [ -e "${NIX_ATTRS_SH_FILE:-}" ]; then . "$NIX_ATTRS_SH_FILE"; elif [ -f .attrs.sh ]; then . .attrs.sh; fi
if [ -e "${NIX_ATTRS_SH_FILE:-}" ]; then . "$NIX_ATTRS_SH_FILE"; fi

# Variables injected by replaceVars
#
Expand Down
2 changes: 1 addition & 1 deletion pkgs/stdenv/generic/make-derivation.nix
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ let
"-c"
''
out="${placeholder "out"}"
if [ -e "$NIX_ATTRS_SH_FILE" ]; then . "$NIX_ATTRS_SH_FILE"; elif [ -f .attrs.sh ]; then . .attrs.sh; fi
if [ -e "$NIX_ATTRS_SH_FILE" ]; then . "$NIX_ATTRS_SH_FILE"; fi
declare -p > $out
for var in $passAsFile; do
pathVar="''${var}Path"
Expand Down
12 changes: 1 addition & 11 deletions pkgs/stdenv/generic/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,14 @@ if [[ ${NIX_DEBUG:-0} -ge 6 ]]; then
set -x
fi

if [ -f .attrs.sh ] || [[ -n "${NIX_ATTRS_JSON_FILE:-}" ]]; then
if [[ -n "${NIX_ATTRS_JSON_FILE:-}" ]]; then
__structuredAttrs=1
echo "structuredAttrs is enabled"

for outputName in "${!outputs[@]}"; do
# ex: out=/nix/store/...
export "$outputName=${outputs[$outputName]}"
done

# $NIX_ATTRS_JSON_FILE pointed to the wrong location in sandbox
# https://github.com/NixOS/nix/issues/6736; please keep around until the
# fix reaches *every patch version* that's >= lib/minver.nix
if ! [[ -e "${NIX_ATTRS_JSON_FILE:-}" ]]; then
export NIX_ATTRS_JSON_FILE="$NIX_BUILD_TOP/.attrs.json"
fi
if ! [[ -e "${NIX_ATTRS_SH_FILE:-}" ]]; then
export NIX_ATTRS_SH_FILE="$NIX_BUILD_TOP/.attrs.sh"
fi
else
__structuredAttrs=
: "${outputs:=out}"
Expand Down
2 changes: 1 addition & 1 deletion pkgs/stdenv/generic/source-stdenv.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
if [ -e "$NIX_ATTRS_SH_FILE" ]; then . "$NIX_ATTRS_SH_FILE"; elif [ -f .attrs.sh ]; then . .attrs.sh; fi
if [ -e "$NIX_ATTRS_SH_FILE" ]; then . "$NIX_ATTRS_SH_FILE"; fi
source "$stdenv/setup"
source "$1"
Loading