about summary refs log tree commit diff
path: root/pkgs/development/compilers/go
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2019-02-26 11:45:54 +0000
committerJörg Thalheim <joerg@thalheim.io>2019-02-26 14:10:49 +0000
commitdadc7eb3297e6c2fb0c0e01149c8fcebd80770c1 (patch)
tree9717b203342cd121abcdfde5ba8b66235c3ad67c /pkgs/development/compilers/go
parent1233c8d9e9bc463899ed6a8cf0232e6bf36475ee (diff)
downloadnixlib-dadc7eb3297e6c2fb0c0e01149c8fcebd80770c1.tar
nixlib-dadc7eb3297e6c2fb0c0e01149c8fcebd80770c1.tar.gz
nixlib-dadc7eb3297e6c2fb0c0e01149c8fcebd80770c1.tar.bz2
nixlib-dadc7eb3297e6c2fb0c0e01149c8fcebd80770c1.tar.lz
nixlib-dadc7eb3297e6c2fb0c0e01149c8fcebd80770c1.tar.xz
nixlib-dadc7eb3297e6c2fb0c0e01149c8fcebd80770c1.tar.zst
nixlib-dadc7eb3297e6c2fb0c0e01149c8fcebd80770c1.zip
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.
Diffstat (limited to 'pkgs/development/compilers/go')
-rw-r--r--pkgs/development/compilers/go/1.11.nix6
1 files changed, 3 insertions, 3 deletions
diff --git a/pkgs/development/compilers/go/1.11.nix b/pkgs/development/compilers/go/1.11.nix
index 1c9bc0a30091..db3731c2fcaa 100644
--- a/pkgs/development/compilers/go/1.11.nix
+++ b/pkgs/development/compilers/go/1.11.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchFromGitHub, tzdata, iana-etc, go_bootstrap, runCommand, writeScriptBin
 , perl, which, pkgconfig, patch, procps, pcre, cacert, llvm, Security, Foundation
-, mailcap
+, mailcap, runtimeShell
 , buildPackages, targetPackages }:
 
 let
@@ -55,7 +55,7 @@ stdenv.mkDerivation rec {
     # This source produces shell script at run time,
     # and thus it is not corrected by patchShebangs.
     substituteInPlace misc/cgo/testcarchive/carchive_test.go \
-      --replace '#!/usr/bin/env bash' '#!${stdenv.shell}'
+      --replace '#!/usr/bin/env bash' '#!${runtimeShell}'
 
     # Patch the mimetype database location which is missing on NixOS.
     substituteInPlace src/mime/type_unix.go \
@@ -100,7 +100,7 @@ stdenv.mkDerivation rec {
   '' + optionalString stdenv.isLinux ''
     sed -i 's,/usr/share/zoneinfo/,${tzdata}/share/zoneinfo/,' src/time/zoneinfo_unix.go
   '' + optionalString stdenv.isAarch32 ''
-    echo '#!${stdenv.shell}' > misc/cgo/testplugin/test.bash
+    echo '#!${runtimeShell}' > misc/cgo/testplugin/test.bash
   '' + optionalString stdenv.isDarwin ''
     substituteInPlace src/race.bash --replace \
       "sysctl machdep.cpu.extfeatures | grep -qv EM64T" true