treewide: use runtimeShell instead of stdenv.shell whenever possible

Whenever we create scripts that are installed to $out, we must use runtimeShell
in order to get the shell that can be executed on the machine we create the
package for. This is relevant for cross-compiling. The only use case for
stdenv.shell are scripts that are executed as part of the build system.
Usages in checkPhase are borderline however to decrease the likelyhood
of people copying the wrong examples, I decided to use runtimeShell as well.
This commit is contained in:
Jörg Thalheim
2019-02-26 14:10:49 +00:00
parent 1233c8d9e9
commit dadc7eb329
131 changed files with 326 additions and 294 deletions
+4 -3
View File
@@ -23,7 +23,8 @@
writeScript,
writeText,
closureInfo,
substituteAll
substituteAll,
runtimeShell
}:
# WARNING: this API is unstable and may be subject to backwards-incompatible changes in the future.
@@ -119,7 +120,7 @@ rec {
export PATH=${shadow}/bin:$PATH
mkdir -p /etc/pam.d
if [[ ! -f /etc/passwd ]]; then
echo "root:x:0:0::/root:${stdenv.shell}" > /etc/passwd
echo "root:x:0:0::/root:${runtimeShell}" > /etc/passwd
echo "root:!x:::::::" > /etc/shadow
fi
if [[ ! -f /etc/group ]]; then
@@ -261,7 +262,7 @@ rec {
# things like `ls` or `echo` will be missing.
shellScript = name: text:
writeScript name ''
#!${stdenv.shell}
#!${runtimeShell}
set -e
export PATH=${coreutils}/bin:/bin
${text}