summary refs log tree commit diff
path: root/pkgs/development/compilers
diff options
context:
space:
mode:
authorNiklas Hambüchen <mail@nh2.me>2021-07-04 21:48:18 +0000
committerNiklas Hambüchen <mail@nh2.me>2021-07-10 02:49:42 +0200
commit8b15fccf8ae1dfb0c9404e46b9b008d15f6a372d (patch)
tree2db09af0ab4b02bd896d004b66d58c61d44c543b /pkgs/development/compilers
parentf154c3addec162c89b8c256da17129c1a7a7d7fe (diff)
downloadnixpkgs-8b15fccf8ae1dfb0c9404e46b9b008d15f6a372d.tar
nixpkgs-8b15fccf8ae1dfb0c9404e46b9b008d15f6a372d.tar.gz
nixpkgs-8b15fccf8ae1dfb0c9404e46b9b008d15f6a372d.tar.bz2
nixpkgs-8b15fccf8ae1dfb0c9404e46b9b008d15f6a372d.tar.lz
nixpkgs-8b15fccf8ae1dfb0c9404e46b9b008d15f6a372d.tar.xz
nixpkgs-8b15fccf8ae1dfb0c9404e46b9b008d15f6a372d.tar.zst
nixpkgs-8b15fccf8ae1dfb0c9404e46b9b008d15f6a372d.zip
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; }'
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r--pkgs/development/compilers/ghc/8.8.4.nix11
1 files changed, 7 insertions, 4 deletions
diff --git a/pkgs/development/compilers/ghc/8.8.4.nix b/pkgs/development/compilers/ghc/8.8.4.nix
index 544b96f5e4f..c907928d5ef 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