From e191321866b1d754eed23a577837f183c76581f7 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Tue, 23 Nov 2021 16:12:48 +0100 Subject: [PATCH 1/5] haskell.compiler.ghc865Binary: build with correct LLVM version See https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/compiler/backends/llvm/installing#llvm-support --- pkgs/top-level/haskell-packages.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/top-level/haskell-packages.nix b/pkgs/top-level/haskell-packages.nix index bf340c10cb3b..b5d214c579ce 100644 --- a/pkgs/top-level/haskell-packages.nix +++ b/pkgs/top-level/haskell-packages.nix @@ -50,7 +50,9 @@ in { compiler = { - ghc865Binary = callPackage ../development/compilers/ghc/8.6.5-binary.nix { }; + ghc865Binary = callPackage ../development/compilers/ghc/8.6.5-binary.nix { + llvmPackages = pkgs.llvmPackages_6; + }; ghc8102Binary = callPackage ../development/compilers/ghc/8.10.2-binary.nix { llvmPackages = pkgs.llvmPackages_9; From d7ff8061beed6ce1c141066fd268cdbb5acc0dd1 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Tue, 23 Nov 2021 16:11:37 +0100 Subject: [PATCH 2/5] haskellPackages: always inherit llvmPackages from ghc's passthru This means we only have to update the llvmPackages attribute in one place now and should prevent situations like with 8.6.5 where different versions would be used in the package set compared to the compiler build. Drop comments in the configuration-ghc-X.Y.x.nix files as well, since LLVM version isn't tied to the compiler minor version at all (e. g. 8.10.2 and 8.10.7 have different support ranges). --- pkgs/development/compilers/ghc/8.10.2-binary.nix | 2 ++ pkgs/development/compilers/ghc/8.10.7-binary.nix | 2 ++ pkgs/development/compilers/ghc/8.6.5-binary.nix | 2 ++ pkgs/development/haskell-modules/configuration-ghc-8.10.x.nix | 3 +-- pkgs/development/haskell-modules/configuration-ghc-8.6.x.nix | 3 +-- pkgs/development/haskell-modules/configuration-ghc-8.8.x.nix | 3 +-- pkgs/development/haskell-modules/configuration-ghc-9.0.x.nix | 3 +-- pkgs/development/haskell-modules/configuration-ghc-9.2.x.nix | 3 +-- pkgs/development/haskell-modules/configuration-ghc-head.nix | 2 +- 9 files changed, 12 insertions(+), 11 deletions(-) diff --git a/pkgs/development/compilers/ghc/8.10.2-binary.nix b/pkgs/development/compilers/ghc/8.10.2-binary.nix index bf909016ac22..93ebca2b6c4a 100644 --- a/pkgs/development/compilers/ghc/8.10.2-binary.nix +++ b/pkgs/development/compilers/ghc/8.10.2-binary.nix @@ -378,6 +378,8 @@ stdenv.mkDerivation rec { targetPrefix = ""; enableShared = true; + inherit llvmPackages; + # Our Cabal compiler name haskellCompilerName = "ghc-${version}"; }; diff --git a/pkgs/development/compilers/ghc/8.10.7-binary.nix b/pkgs/development/compilers/ghc/8.10.7-binary.nix index 58be16dc5693..a8ec751d2d24 100644 --- a/pkgs/development/compilers/ghc/8.10.7-binary.nix +++ b/pkgs/development/compilers/ghc/8.10.7-binary.nix @@ -378,6 +378,8 @@ stdenv.mkDerivation rec { targetPrefix = ""; enableShared = true; + inherit llvmPackages; + # Our Cabal compiler name haskellCompilerName = "ghc-${version}"; }; diff --git a/pkgs/development/compilers/ghc/8.6.5-binary.nix b/pkgs/development/compilers/ghc/8.6.5-binary.nix index b1126fda7d26..5b52f0e4cdd9 100644 --- a/pkgs/development/compilers/ghc/8.6.5-binary.nix +++ b/pkgs/development/compilers/ghc/8.6.5-binary.nix @@ -181,6 +181,8 @@ stdenv.mkDerivation rec { targetPrefix = ""; enableShared = true; + inherit llvmPackages; + # Our Cabal compiler name haskellCompilerName = "ghc-${version}"; }; diff --git a/pkgs/development/haskell-modules/configuration-ghc-8.10.x.nix b/pkgs/development/haskell-modules/configuration-ghc-8.10.x.nix index 5e42a7c1131c..ec5515659309 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-8.10.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-8.10.x.nix @@ -4,8 +4,7 @@ with haskellLib; self: super: { - # This compiler version needs llvm 9.x. - llvmPackages = pkgs.lib.dontRecurseIntoAttrs pkgs.llvmPackages_9; + llvmPackages = pkgs.lib.dontRecurseIntoAttrs self.ghc.llvmPackages; # Disable GHC 8.10.x core libraries. array = null; diff --git a/pkgs/development/haskell-modules/configuration-ghc-8.6.x.nix b/pkgs/development/haskell-modules/configuration-ghc-8.6.x.nix index db202735f893..ce7bf88d1da8 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-8.6.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-8.6.x.nix @@ -4,8 +4,7 @@ with haskellLib; self: super: { - # This compiler version needs llvm 6.x. - llvmPackages = pkgs.lib.dontRecurseIntoAttrs pkgs.llvmPackages_6; + llvmPackages = pkgs.lib.dontRecurseIntoAttrs self.ghc.llvmPackages; # Disable GHC 8.6.x core libraries. array = null; diff --git a/pkgs/development/haskell-modules/configuration-ghc-8.8.x.nix b/pkgs/development/haskell-modules/configuration-ghc-8.8.x.nix index a27a7c522098..94e9a32ce05a 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-8.8.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-8.8.x.nix @@ -4,8 +4,7 @@ with haskellLib; self: super: { - # This compiler version needs llvm 7.x. - llvmPackages = pkgs.lib.dontRecurseIntoAttrs pkgs.llvmPackages_7; + llvmPackages = pkgs.lib.dontRecurseIntoAttrs self.ghc.llvmPackages; # Disable GHC 8.8.x core libraries. array = null; diff --git a/pkgs/development/haskell-modules/configuration-ghc-9.0.x.nix b/pkgs/development/haskell-modules/configuration-ghc-9.0.x.nix index 08d1ba3b2107..7999e228c748 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-9.0.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-9.0.x.nix @@ -4,8 +4,7 @@ with haskellLib; self: super: { - # This compiler version needs llvm 10.x. - llvmPackages = pkgs.lib.dontRecurseIntoAttrs pkgs.llvmPackages_10; + llvmPackages = pkgs.lib.dontRecurseIntoAttrs self.ghc.llvmPackages; # Disable GHC 9.0.x core libraries. array = null; diff --git a/pkgs/development/haskell-modules/configuration-ghc-9.2.x.nix b/pkgs/development/haskell-modules/configuration-ghc-9.2.x.nix index 7dc5e70b90c7..c8488453fdcb 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-9.2.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-9.2.x.nix @@ -4,8 +4,7 @@ with haskellLib; self: super: { - # This compiler version needs llvm 10.x. - llvmPackages = pkgs.lib.dontRecurseIntoAttrs pkgs.llvmPackages_10; + llvmPackages = pkgs.lib.dontRecurseIntoAttrs self.ghc.llvmPackages; # Disable GHC 9.2.x core libraries. array = null; diff --git a/pkgs/development/haskell-modules/configuration-ghc-head.nix b/pkgs/development/haskell-modules/configuration-ghc-head.nix index f2fa17d9c46b..e1e3f2c99884 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-head.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-head.nix @@ -11,7 +11,7 @@ with haskellLib; self: super: { - llvmPackages = pkgs.lib.dontRecurseIntoAttrs pkgs.llvmPackages_10; + llvmPackages = pkgs.lib.dontRecurseIntoAttrs self.ghc.llvmPackages; # Disable GHC 8.7.x core libraries. array = null; From 5a568ea36fc596b349ac088418c627d4a1488ce0 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Sun, 21 Nov 2021 23:33:39 +0100 Subject: [PATCH 3/5] haskell.compiler.ghc901: drop LLVM version to 9 GHC 9.0.1 only supports LLVM 9 and spews a lot of warnings about LLVM 10 when using the LLVM backend atm. See also: https://www.haskell.org/ghc/download_ghc_9_0_1.html --- pkgs/top-level/haskell-packages.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/top-level/haskell-packages.nix b/pkgs/top-level/haskell-packages.nix index b5d214c579ce..c96c166d5eaf 100644 --- a/pkgs/top-level/haskell-packages.nix +++ b/pkgs/top-level/haskell-packages.nix @@ -111,8 +111,8 @@ in { packages.ghc8107Binary; inherit (buildPackages.python3Packages) sphinx; inherit (buildPackages.darwin) autoSignDarwinBinariesHook; - buildLlvmPackages = buildPackages.llvmPackages_10; - llvmPackages = pkgs.llvmPackages_10; + buildLlvmPackages = buildPackages.llvmPackages_9; + llvmPackages = pkgs.llvmPackages_9; }; ghc921 = callPackage ../development/compilers/ghc/9.2.1.nix { bootPkgs = From 9e1f438a7656b5ab2247eca914902525207f12cc Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Tue, 23 Nov 2021 16:21:32 +0100 Subject: [PATCH 4/5] haskell.compiler.*: upgrade to latest supported LLVM version Source: * (8.6.5: https://www.haskell.org/ghc/download_ghc_8_6_5.html) * (8.8.4: https://www.haskell.org/ghc/download_ghc_8_8_4.html) * (8.10.2: https://www.haskell.org/ghc/download_ghc_8_10_2.html) * 8.10.7: https://www.haskell.org/ghc/download_ghc_8_10_7.html * (9.0.1: https://www.haskell.org/ghc/download_ghc_9_0_1.html) * 9.2.1: https://www.haskell.org/ghc/download_ghc_9_2_1.html * HEAD: https://gitlab.haskell.org/ghc/ghc/-/blob/3ab3631f41efe9a1ae32a5b1f709152228edb09a/configure.ac#L674 --- pkgs/top-level/haskell-packages.nix | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkgs/top-level/haskell-packages.nix b/pkgs/top-level/haskell-packages.nix index c96c166d5eaf..87a2778fdf85 100644 --- a/pkgs/top-level/haskell-packages.nix +++ b/pkgs/top-level/haskell-packages.nix @@ -64,11 +64,11 @@ in { }; ghc8107Binary = callPackage ../development/compilers/ghc/8.10.7-binary.nix { - llvmPackages = pkgs.llvmPackages_11; + llvmPackages = pkgs.llvmPackages_12; }; ghc8107BinaryMinimal = callPackage ../development/compilers/ghc/8.10.7-binary.nix { - llvmPackages = pkgs.llvmPackages_11; + llvmPackages = pkgs.llvmPackages_12; minimal = true; }; @@ -98,8 +98,8 @@ in { # https://github.com/xattr/xattr/issues/44 and # https://github.com/xattr/xattr/issues/55 are solved. inherit (buildPackages.darwin) xattr autoSignDarwinBinariesHook; - buildLlvmPackages = buildPackages.llvmPackages_9; - llvmPackages = pkgs.llvmPackages_9; + buildLlvmPackages = buildPackages.llvmPackages_12; + llvmPackages = pkgs.llvmPackages_12; }; ghc901 = callPackage ../development/compilers/ghc/9.0.1.nix { bootPkgs = @@ -126,8 +126,8 @@ in { # https://github.com/xattr/xattr/issues/44 and # https://github.com/xattr/xattr/issues/55 are solved. inherit (buildPackages.darwin) xattr autoSignDarwinBinariesHook; - buildLlvmPackages = buildPackages.llvmPackages_10; - llvmPackages = pkgs.llvmPackages_10; + buildLlvmPackages = buildPackages.llvmPackages_12; + llvmPackages = pkgs.llvmPackages_12; }; ghcHEAD = callPackage ../development/compilers/ghc/head.nix { bootPkgs = packages.ghc8107Binary; @@ -136,8 +136,8 @@ in { # https://github.com/xattr/xattr/issues/44 and # https://github.com/xattr/xattr/issues/55 are solved. inherit (buildPackages.darwin) xattr autoSignDarwinBinariesHook; - buildLlvmPackages = buildPackages.llvmPackages_10; - llvmPackages = pkgs.llvmPackages_10; + buildLlvmPackages = buildPackages.llvmPackages_12; + llvmPackages = pkgs.llvmPackages_12; libffi = pkgs.libffi; }; From b9f15821064edcb61d9c5e06285fbbde775edeb9 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Wed, 24 Nov 2021 13:28:28 +0100 Subject: [PATCH 5/5] haskell.compiler.ghc865Binary: remove aarch64-linux from platforms GHC 8.6.5 will always segfault on aarch64-linux and at this point it's not realistic we'll ever fix this. --- pkgs/development/compilers/ghc/8.6.5-binary.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/development/compilers/ghc/8.6.5-binary.nix b/pkgs/development/compilers/ghc/8.6.5-binary.nix index 5b52f0e4cdd9..e8ae6761be8d 100644 --- a/pkgs/development/compilers/ghc/8.6.5-binary.nix +++ b/pkgs/development/compilers/ghc/8.6.5-binary.nix @@ -189,8 +189,7 @@ stdenv.mkDerivation rec { meta = rec { license = lib.licenses.bsd3; - platforms = ["x86_64-linux" "aarch64-linux" "i686-linux" "x86_64-darwin"]; - hydraPlatforms = builtins.filter (p: p != "aarch64-linux") platforms; + platforms = ["x86_64-linux" "i686-linux" "x86_64-darwin"]; # build segfaults, use ghc8102Binary which has proper musl support instead broken = stdenv.hostPlatform.isMusl; maintainers = with lib.maintainers; [