diff --git a/pkgs/development/compilers/ghc/8.8.4.nix b/pkgs/development/compilers/ghc/8.8.4.nix index 544b96f5e4f03..c907928d5ef9c 100644 --- a/pkgs/development/compilers/ghc/8.8.4.nix +++ b/pkgs/development/compilers/ghc/8.8.4.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 diff --git a/pkgs/top-level/haskell-packages.nix b/pkgs/top-level/haskell-packages.nix index 8bea40efe64d4..b872f3286e162 100644 --- a/pkgs/top-level/haskell-packages.nix +++ b/pkgs/top-level/haskell-packages.nix @@ -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;