summary refs log tree commit diff
path: root/pkgs/development/compilers
diff options
context:
space:
mode:
authorsternenseemann <sternenseemann@systemli.org>2021-11-25 13:12:40 +0100
committersternenseemann <sternenseemann@systemli.org>2021-11-25 16:42:47 +0100
commit035f20bc6bf809c7be9bb5b6d4dd19b0a2df9d17 (patch)
tree27c660c9ab1fb0fc944c991a2d6ec10bf8e58da4 /pkgs/development/compilers
parent5384a35a0c5198e224435b7295b3d273e645243d (diff)
downloadnixpkgs-035f20bc6bf809c7be9bb5b6d4dd19b0a2df9d17.tar
nixpkgs-035f20bc6bf809c7be9bb5b6d4dd19b0a2df9d17.tar.gz
nixpkgs-035f20bc6bf809c7be9bb5b6d4dd19b0a2df9d17.tar.bz2
nixpkgs-035f20bc6bf809c7be9bb5b6d4dd19b0a2df9d17.tar.lz
nixpkgs-035f20bc6bf809c7be9bb5b6d4dd19b0a2df9d17.tar.xz
nixpkgs-035f20bc6bf809c7be9bb5b6d4dd19b0a2df9d17.tar.zst
nixpkgs-035f20bc6bf809c7be9bb5b6d4dd19b0a2df9d17.zip
haskell.compiler.*: prefix PATH with runtimeDeps
This will prevent freak accidents where the wrong tools are used because
they are in PATH by chance.
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r--pkgs/development/compilers/ghc/8.10.7.nix6
-rw-r--r--pkgs/development/compilers/ghc/8.8.4.nix6
-rw-r--r--pkgs/development/compilers/ghc/9.0.1.nix6
-rw-r--r--pkgs/development/compilers/ghc/9.2.1.nix6
-rw-r--r--pkgs/development/compilers/ghc/head.nix6
5 files changed, 15 insertions, 15 deletions
diff --git a/pkgs/development/compilers/ghc/8.10.7.nix b/pkgs/development/compilers/ghc/8.10.7.nix
index f0c57f7fae8..9cf459f4516 100644
--- a/pkgs/development/compilers/ghc/8.10.7.nix
+++ b/pkgs/development/compilers/ghc/8.10.7.nix
@@ -134,7 +134,7 @@ let
 
   runtimeDeps = [
     targetPackages.stdenv.cc.bintools
-    coreutils
+    coreutils # for cat
   ]
   # On darwin, we need unwrapped bintools as well (for otool)
   ++ lib.optionals (stdenv.targetPlatform.linker == "cctools") [
@@ -321,11 +321,11 @@ stdenv.mkDerivation (rec {
     # Install the bash completion file.
     install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc
 
-    # Patch scripts to include "readelf" and "cat" in $PATH.
+    # Patch scripts to include runtime dependencies in $PATH.
     for i in "$out/bin/"*; do
       test ! -h $i || continue
       egrep --quiet '^#!' <(head -n 1 $i) || continue
-      sed -i -e '2i export PATH="$PATH:${lib.makeBinPath runtimeDeps}"' $i
+      sed -i -e '2i export PATH="${lib.makeBinPath runtimeDeps}:$PATH"' $i
     done
   '';
 
diff --git a/pkgs/development/compilers/ghc/8.8.4.nix b/pkgs/development/compilers/ghc/8.8.4.nix
index e0f6c84637b..069657808a3 100644
--- a/pkgs/development/compilers/ghc/8.8.4.nix
+++ b/pkgs/development/compilers/ghc/8.8.4.nix
@@ -142,7 +142,7 @@ let
 
   runtimeDeps = [
     targetPackages.stdenv.cc.bintools
-    coreutils
+    coreutils # for cat
   ]
   # On darwin, we need unwrapped bintools as well (for otool)
   ++ lib.optionals (stdenv.targetPlatform.linker == "cctools") [
@@ -320,11 +320,11 @@ stdenv.mkDerivation (rec {
     # Install the bash completion file.
     install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc
 
-    # Patch scripts to include "readelf" and "cat" in $PATH.
+    # Patch scripts to include runtime dependencies in $PATH.
     for i in "$out/bin/"*; do
       test ! -h $i || continue
       egrep --quiet '^#!' <(head -n 1 $i) || continue
-      sed -i -e '2i export PATH="$PATH:${lib.makeBinPath runtimeDeps}"' $i
+      sed -i -e '2i export PATH="${lib.makeBinPath runtimeDeps}:$PATH"' $i
     done
   '';
 
diff --git a/pkgs/development/compilers/ghc/9.0.1.nix b/pkgs/development/compilers/ghc/9.0.1.nix
index 005333a8d83..3f2ea4dedca 100644
--- a/pkgs/development/compilers/ghc/9.0.1.nix
+++ b/pkgs/development/compilers/ghc/9.0.1.nix
@@ -129,7 +129,7 @@ let
 
   runtimeDeps = [
     targetPackages.stdenv.cc.bintools
-    coreutils
+    coreutils # for cat
   ]
   # On darwin, we need unwrapped bintools as well (for otool)
   ++ lib.optionals (stdenv.targetPlatform.linker == "cctools") [
@@ -286,11 +286,11 @@ stdenv.mkDerivation (rec {
     # Install the bash completion file.
     install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc
 
-    # Patch scripts to include "readelf" and "cat" in $PATH.
+    # Patch scripts to include runtime dependencies in $PATH.
     for i in "$out/bin/"*; do
       test ! -h $i || continue
       egrep --quiet '^#!' <(head -n 1 $i) || continue
-      sed -i -e '2i export PATH="$PATH:${lib.makeBinPath runtimeDeps}"' $i
+      sed -i -e '2i export PATH="${lib.makeBinPath runtimeDeps}:$PATH"' $i
     done
   '';
 
diff --git a/pkgs/development/compilers/ghc/9.2.1.nix b/pkgs/development/compilers/ghc/9.2.1.nix
index 2ebbdc63ac9..d1c69e5c463 100644
--- a/pkgs/development/compilers/ghc/9.2.1.nix
+++ b/pkgs/development/compilers/ghc/9.2.1.nix
@@ -128,7 +128,7 @@ let
 
   runtimeDeps = [
     targetPackages.stdenv.cc.bintools
-    coreutils
+    coreutils # for cat
   ]
   # On darwin, we need unwrapped bintools as well (for otool)
   ++ lib.optionals (stdenv.targetPlatform.linker == "cctools") [
@@ -289,11 +289,11 @@ stdenv.mkDerivation (rec {
     # Install the bash completion file.
     install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc
 
-    # Patch scripts to include "readelf" and "cat" in $PATH.
+    # Patch scripts to include runtime dependencies in $PATH.
     for i in "$out/bin/"*; do
       test ! -h $i || continue
       egrep --quiet '^#!' <(head -n 1 $i) || continue
-      sed -i -e '2i export PATH="$PATH:${lib.makeBinPath runtimeDeps}"' $i
+      sed -i -e '2i export PATH="${lib.makeBinPath runtimeDeps}:$PATH"' $i
     done
   '';
 
diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix
index f50b3b76e15..50bd9527093 100644
--- a/pkgs/development/compilers/ghc/head.nix
+++ b/pkgs/development/compilers/ghc/head.nix
@@ -142,7 +142,7 @@ let
 
   runtimeDeps = [
     targetPackages.stdenv.cc.bintools
-    coreutils
+    coreutils # for cat
   ]
   # On darwin, we need unwrapped bintools as well (for otool)
   ++ lib.optionals (stdenv.targetPlatform.linker == "cctools") [
@@ -309,11 +309,11 @@ stdenv.mkDerivation (rec {
     # Install the bash completion file.
     install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc
 
-    # Patch scripts to include "readelf" and "cat" in $PATH.
+    # Patch scripts to include runtime dependencies in $PATH.
     for i in "$out/bin/"*; do
       test ! -h $i || continue
       egrep --quiet '^#!' <(head -n 1 $i) || continue
-      sed -i -e '2i export PATH="$PATH:${lib.makeBinPath runtimeDeps}"' $i
+      sed -i -e '2i export PATH="${lib.makeBinPath runtimeDeps}:$PATH"' $i
     done
   '';