Files
nixpkgs/pkgs/stdenv/generic/builder.sh
Lin Jian 75281ae80a stdenv: fix propagatedUserEnvPkgs when __structuredAttrs is true
This is a follow-up of #388908.

Previously, $out/nix-support/propagated-user-env-packages was not
created when __structuredAttrs is true, the first element of
propagatedUserEnvPkgs is null and the length of propagatedUserEnvPkgs
is at least 2.

Fixes #388829
2025-03-25 08:37:18 +08:00

24 lines
616 B
Bash

export PATH=
for i in $initialPath; do
if [ "$i" = / ]; then i=; fi
PATH=$PATH${PATH:+:}$i/bin
done
mkdir $out
{
echo "export SHELL=$shell"
echo "initialPath=\"$initialPath\""
echo "defaultNativeBuildInputs=\"$defaultNativeBuildInputs\""
echo "defaultBuildInputs=\"$defaultBuildInputs\""
echo "$preHook"
cat "$setup"
} > "$out/setup"
# Allow the user to install stdenv using nix-env and get the packages
# in stdenv.
mkdir $out/nix-support
if [ "${propagatedUserEnvPkgs[*]}" ]; then
printf '%s ' "${propagatedUserEnvPkgs[@]}" > $out/nix-support/propagated-user-env-packages
fi