diff options
| author | sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org> | 2021-06-01 23:52:19 +0200 |
|---|---|---|
| committer | sterni <sternenseemann@systemli.org> | 2021-06-14 12:21:22 +0200 |
| commit | 9a84eb7ec89bbb89e39183bf52393429033f9592 (patch) | |
| tree | 8853351561bc9a6045ceded33659395c2b035cdc | |
| parent | imagemagick: 7.0.11-14 -> 7.1.0-0 (diff) | |
| download | nixpkgs-9a84eb7ec89bbb89e39183bf52393429033f9592.tar.gz | |
haskell.compiler.*: pull in unwrapped bintools for darwin
GHC calls otool on darwin which is contained in the
stdenv.cc.bintools.bintools derivation and thus needs adding to the
runtime PATH of GHC. Since this is toolchain specific technically, we
check for cctools instead of darwin (although I don't know if GHC
or nixpkgs work on macOS without cctools).
This fixes usage of GHC in an environment where otool is not available
and more specifically in stdenvNoCC which is used by writers.writeHaskell.
Resolves #123228.
(cherry picked from commit 118b28a127c79dbae8c513742fbb17f300407a4b)
| -rw-r--r-- | pkgs/development/compilers/ghc/8.10.4.nix | 11 | ||||
| -rw-r--r-- | pkgs/development/compilers/ghc/8.8.4.nix | 11 | ||||
| -rw-r--r-- | pkgs/development/compilers/ghc/9.0.1.nix | 11 | ||||
| -rw-r--r-- | pkgs/development/compilers/ghc/head.nix | 11 |
4 files changed, 40 insertions, 4 deletions
diff --git a/pkgs/development/compilers/ghc/8.10.4.nix b/pkgs/development/compilers/ghc/8.10.4.nix index da957f93520b..9c514efc282f 100644 --- a/pkgs/development/compilers/ghc/8.10.4.nix +++ b/pkgs/development/compilers/ghc/8.10.4.nix @@ -93,6 +93,15 @@ let # see #84670 and #49071 for more background. useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false) && !targetPlatform.isMusl; + runtimeDeps = [ + targetPackages.stdenv.cc.bintools + coreutils + ] + # On darwin, we need unwrapped bintools as well (for otool) + ++ lib.optionals (stdenv.targetPlatform.linker == "cctools") [ + targetPackages.stdenv.cc.bintools.bintools + ]; + in stdenv.mkDerivation (rec { version = "8.10.4"; @@ -235,7 +244,7 @@ stdenv.mkDerivation (rec { 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 [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i + sed -i -e '2i export PATH="$PATH:${lib.makeBinPath runtimeDeps}"' $i done ''; diff --git a/pkgs/development/compilers/ghc/8.8.4.nix b/pkgs/development/compilers/ghc/8.8.4.nix index b0336ad3992d..fcb7db617d01 100644 --- a/pkgs/development/compilers/ghc/8.8.4.nix +++ b/pkgs/development/compilers/ghc/8.8.4.nix @@ -102,6 +102,15 @@ let # see #84670 and #49071 for more background. useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false) && !targetPlatform.isMusl; + runtimeDeps = [ + targetPackages.stdenv.cc.bintools + coreutils + ] + # On darwin, we need unwrapped bintools as well (for otool) + ++ lib.optionals (stdenv.targetPlatform.linker == "cctools") [ + targetPackages.stdenv.cc.bintools.bintools + ]; + in stdenv.mkDerivation (rec { version = "8.8.4"; @@ -242,7 +251,7 @@ stdenv.mkDerivation (rec { 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 [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i + sed -i -e '2i export PATH="$PATH:${lib.makeBinPath runtimeDeps}"' $i done ''; diff --git a/pkgs/development/compilers/ghc/9.0.1.nix b/pkgs/development/compilers/ghc/9.0.1.nix index 58beef5d6882..a110d587874a 100644 --- a/pkgs/development/compilers/ghc/9.0.1.nix +++ b/pkgs/development/compilers/ghc/9.0.1.nix @@ -94,6 +94,15 @@ let # see #84670 and #49071 for more background. useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false) && !targetPlatform.isMusl; + runtimeDeps = [ + targetPackages.stdenv.cc.bintools + coreutils + ] + # On darwin, we need unwrapped bintools as well (for otool) + ++ lib.optionals (stdenv.targetPlatform.linker == "cctools") [ + targetPackages.stdenv.cc.bintools.bintools + ]; + in stdenv.mkDerivation (rec { version = "9.0.1"; @@ -225,7 +234,7 @@ stdenv.mkDerivation (rec { 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 [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i + sed -i -e '2i export PATH="$PATH:${lib.makeBinPath runtimeDeps}"' $i done ''; diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix index a0ca13270a24..e1c1cdf8dc59 100644 --- a/pkgs/development/compilers/ghc/head.nix +++ b/pkgs/development/compilers/ghc/head.nix @@ -104,6 +104,15 @@ let # see #84670 and #49071 for more background. useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false) && !targetPlatform.isMusl; + runtimeDeps = [ + targetPackages.stdenv.cc.bintools + coreutils + ] + # On darwin, we need unwrapped bintools as well (for otool) + ++ lib.optionals (stdenv.targetPlatform.linker == "cctools") [ + targetPackages.stdenv.cc.bintools.bintools + ]; + in stdenv.mkDerivation (rec { inherit version; @@ -242,7 +251,7 @@ stdenv.mkDerivation (rec { 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 [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i + sed -i -e '2i export PATH="$PATH:${lib.makeBinPath runtimeDeps}"' $i done ''; |
