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)
This commit is contained in:
parent
bc3694b59c
commit
9a84eb7ec8
|
@ -93,6 +93,15 @@ let
|
||||||
# see #84670 and #49071 for more background.
|
# see #84670 and #49071 for more background.
|
||||||
useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false) && !targetPlatform.isMusl;
|
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
|
in
|
||||||
stdenv.mkDerivation (rec {
|
stdenv.mkDerivation (rec {
|
||||||
version = "8.10.4";
|
version = "8.10.4";
|
||||||
|
@ -235,7 +244,7 @@ stdenv.mkDerivation (rec {
|
||||||
for i in "$out/bin/"*; do
|
for i in "$out/bin/"*; do
|
||||||
test ! -h $i || continue
|
test ! -h $i || continue
|
||||||
egrep --quiet '^#!' <(head -n 1 $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
|
done
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
|
@ -102,6 +102,15 @@ let
|
||||||
# see #84670 and #49071 for more background.
|
# see #84670 and #49071 for more background.
|
||||||
useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false) && !targetPlatform.isMusl;
|
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
|
in
|
||||||
stdenv.mkDerivation (rec {
|
stdenv.mkDerivation (rec {
|
||||||
version = "8.8.4";
|
version = "8.8.4";
|
||||||
|
@ -242,7 +251,7 @@ stdenv.mkDerivation (rec {
|
||||||
for i in "$out/bin/"*; do
|
for i in "$out/bin/"*; do
|
||||||
test ! -h $i || continue
|
test ! -h $i || continue
|
||||||
egrep --quiet '^#!' <(head -n 1 $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
|
done
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
|
@ -94,6 +94,15 @@ let
|
||||||
# see #84670 and #49071 for more background.
|
# see #84670 and #49071 for more background.
|
||||||
useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false) && !targetPlatform.isMusl;
|
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
|
in
|
||||||
stdenv.mkDerivation (rec {
|
stdenv.mkDerivation (rec {
|
||||||
version = "9.0.1";
|
version = "9.0.1";
|
||||||
|
@ -225,7 +234,7 @@ stdenv.mkDerivation (rec {
|
||||||
for i in "$out/bin/"*; do
|
for i in "$out/bin/"*; do
|
||||||
test ! -h $i || continue
|
test ! -h $i || continue
|
||||||
egrep --quiet '^#!' <(head -n 1 $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
|
done
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
|
@ -104,6 +104,15 @@ let
|
||||||
# see #84670 and #49071 for more background.
|
# see #84670 and #49071 for more background.
|
||||||
useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false) && !targetPlatform.isMusl;
|
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
|
in
|
||||||
stdenv.mkDerivation (rec {
|
stdenv.mkDerivation (rec {
|
||||||
inherit version;
|
inherit version;
|
||||||
|
@ -242,7 +251,7 @@ stdenv.mkDerivation (rec {
|
||||||
for i in "$out/bin/"*; do
|
for i in "$out/bin/"*; do
|
||||||
test ! -h $i || continue
|
test ! -h $i || continue
|
||||||
egrep --quiet '^#!' <(head -n 1 $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
|
done
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue