stdenv: remove .attrs.sh fallback for structuredAttrs

This was eventually fixed in Nix 2.16+. More discussion in #357053.

Changed files
+4 -14
pkgs
build-support
stdenv
+1 -1
pkgs/build-support/testers/expect-failure.sh
···
#
# 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
#
+1 -1
pkgs/stdenv/generic/make-derivation.nix
···
"-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"
+1 -11
pkgs/stdenv/generic/setup.sh
···
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"
···
# 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}"
+1 -1
pkgs/stdenv/generic/source-stdenv.sh
···
-
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"