pkgsMuslhaskell.compiler.{ghc884,ghc8104}: Use GHC 8.10 as bootstrap compiler.

This addresses the fact that `ghc865Binary` segfaults on musl
(see #118731) because of the glibc+musl mix used in there.

With the previous commits, `ghc8102Binary` was changed to use
the musl-based bindist from GHC HQ instead, which works.

With this change, all nix Haskell compilers builds on musl:

    NIX_PATH=nixpkgs=. nix-build --no-link --expr 'with import <nixpkgs> {}; { inherit (pkgsMusl.haskell.compiler) ghc884 ghc8104 ghc901 ghcHEAD; }'
wip/nixpkgs-raku
Niklas Hambüchen 3 years ago
parent f154c3adde
commit 8b15fccf8a
  1. 11
      pkgs/development/compilers/ghc/8.8.4.nix
  2. 6
      pkgs/top-level/haskell-packages.nix

@ -142,11 +142,14 @@ stdenv.mkDerivation (rec {
postPatch = "patchShebangs .";
# GHC is a bit confused on its cross terminology.
preConfigure = lib.optionalString stdenv.isAarch64 ''
preConfigure =
# Aarch64 allow backward bootstrapping since earlier versions are unstable.
find . -name \*\.cabal\* -exec sed -i -e 's/\(base.*\)4.14/\14.16/' {} \; \
-exec sed -i -e 's/\(prim.*\)0.6/\10.8/' {} \;
'' + ''
# Same for musl, as earlier versions do not provide a musl bindist for bootstrapping.
lib.optionalString (stdenv.isAarch64 || stdenv.hostPlatform.isMusl) ''
find . -name \*\.cabal\* -exec sed -i -e 's/\(base.*\)4.14/\14.16/' {} \; \
-exec sed -i -e 's/\(prim.*\)0.6/\10.8/' {} \;
''
+ ''
for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do
export "''${env#TARGET_}=''${!env}"
done

@ -57,7 +57,8 @@ in {
ghc884 = callPackage ../development/compilers/ghc/8.8.4.nix {
# aarch64 ghc865Binary gets SEGVs due to haskell#15449 or similar
bootPkgs = if stdenv.isAarch64 then
# Musl bindists do not exist for ghc 8.6.5, so we use 8.10.* for them
bootPkgs = if stdenv.isAarch64 || stdenv.targetPlatform.isMusl then
packages.ghc8102BinaryMinimal
else
packages.ghc865Binary;
@ -67,7 +68,8 @@ in {
};
ghc8104 = callPackage ../development/compilers/ghc/8.10.4.nix {
# aarch64 ghc865Binary gets SEGVs due to haskell#15449 or similar
bootPkgs = if stdenv.isAarch64 || stdenv.isAarch32 then
# Musl bindists do not exist for ghc 8.6.5, so we use 8.10.* for them
bootPkgs = if stdenv.isAarch64 || stdenv.isAarch32 || stdenv.targetPlatform.isMusl then
packages.ghc8102BinaryMinimal
else
packages.ghc865Binary;

Loading…
Cancel
Save