stdenv: add shell to HOST_PATH for backwards compatibility
To avoid breaking things, we need to make sure SHELL goes into HOST_PATH. This reflects my changes to patch-shebangs to make it cross compilation ready. When a script is patched from the Nix store it now looks to HOST_PATH to get the targeted machine’s executables. Unfortunately, this only works in native builds.
This commit is contained in:
parent
06c63123cc
commit
a4630c65ca
|
@ -257,6 +257,7 @@ shopt -s nullglob
|
||||||
|
|
||||||
# Set up the initial path.
|
# Set up the initial path.
|
||||||
PATH=
|
PATH=
|
||||||
|
HOST_PATH=
|
||||||
for i in $initialPath; do
|
for i in $initialPath; do
|
||||||
if [ "$i" = / ]; then i=; fi
|
if [ "$i" = / ]; then i=; fi
|
||||||
addToSearchPath PATH "$i/bin"
|
addToSearchPath PATH "$i/bin"
|
||||||
|
@ -272,6 +273,12 @@ if [ -z "${SHELL:-}" ]; then echo "SHELL not set"; exit 1; fi
|
||||||
BASH="$SHELL"
|
BASH="$SHELL"
|
||||||
export CONFIG_SHELL="$SHELL"
|
export CONFIG_SHELL="$SHELL"
|
||||||
|
|
||||||
|
# For backward compatibility, we add SHELL to HOST_PATH so it can be
|
||||||
|
# used in auto patch-shebangs. Unfortunately this will not work with
|
||||||
|
# cross compilation because it will be for the builder’s platform.
|
||||||
|
if [ -z "${strictDeps-}" ]; then
|
||||||
|
addToSearchPath HOST_PATH "$SHELL/bin"
|
||||||
|
fi
|
||||||
|
|
||||||
# Dummy implementation of the paxmark function. On Linux, this is
|
# Dummy implementation of the paxmark function. On Linux, this is
|
||||||
# overwritten by paxctl's setup hook.
|
# overwritten by paxctl's setup hook.
|
||||||
|
|
Loading…
Reference in New Issue