From cb330ce4f05f5a6e2da3021e9cbf4ea2eb592631 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Sun, 6 Jun 2021 10:43:36 +0000 Subject: [PATCH] ghc: 8.10.4 -> 8.10.6 The only big change is required for darwin since GHC 8.10.5 now runs xattr in the install phase on darwin: * https://gitlab.haskell.org/ghc/ghc/-/commit/11e1dcde0d3137a8ee5cd32697b2925ea4e84b95 * https://gitlab.haskell.org/ghc/ghc/-/commit/ec451cac39de919621c783fec809c26fb9f0d1c8 Unfortunately, it uses the host /usr/bin/xattr by default which is present in the build due to a lack of sandboxing on darwin. That xattr version however still requires Python 2.7 whereas Python 3.8 is in PATH in our build. We solve this by setting the XATTR environment variable. We can't use python3Packages.xattr since GHC expects Apple's fork of xattr which provides some extra flags to utilize. Co-authored-by: Cheng Shao --- .../compilers/ghc/{8.10.4.nix => 8.10.6.nix} | 12 ++++++------ .../haskell/haskell-language-server/withWrapper.nix | 2 +- pkgs/top-level/all-packages.nix | 2 +- pkgs/top-level/haskell-packages.nix | 12 ++++++++---- pkgs/top-level/release-haskell.nix | 6 +++--- 5 files changed, 19 insertions(+), 15 deletions(-) rename pkgs/development/compilers/ghc/{8.10.4.nix => 8.10.6.nix} (97%) diff --git a/pkgs/development/compilers/ghc/8.10.4.nix b/pkgs/development/compilers/ghc/8.10.6.nix similarity index 97% rename from pkgs/development/compilers/ghc/8.10.4.nix rename to pkgs/development/compilers/ghc/8.10.6.nix index 07784c426479..f1223deed85e 100644 --- a/pkgs/development/compilers/ghc/8.10.4.nix +++ b/pkgs/development/compilers/ghc/8.10.6.nix @@ -2,7 +2,7 @@ # build-tools , bootPkgs -, autoconf, automake, coreutils, fetchpatch, fetchurl, perl, python3, m4, sphinx +, autoconf, automake, coreutils, fetchpatch, fetchurl, perl, python3, m4, sphinx, xattr , bash , libiconv ? null, ncurses @@ -135,12 +135,12 @@ let in stdenv.mkDerivation (rec { - version = "8.10.4"; + version = "8.10.6"; name = "${targetPrefix}ghc-${version}"; src = fetchurl { url = "https://downloads.haskell.org/ghc/${version}/ghc-${version}-src.tar.xz"; - sha256 = "03li4k10hxgyxcdyyz2092wx09spr1599hi0sxbh4m889qdqgbsj"; + sha256 = "43afba72a533408b42c1492bd047b5e37e5f7204e41a5cedd3182cc841610ce9"; }; enableParallelBuilding = true; @@ -155,9 +155,6 @@ stdenv.mkDerivation (rec { # upstream patch. Don't forget to check backport status of the upstream patch # when adding new GHC releases in nixpkgs. ./respect-ar-path.patch - # Fix documentation configuration which causes a syntax error with sphinx 4.* - # See https://gitlab.haskell.org/ghc/ghc/-/issues/19962, remove at 8.10.6. - ./sphinx-4-configuration.patch ] ++ lib.optionals stdenv.isDarwin [ # Make Block.h compile with c++ compilers. Remove with the next release (fetchpatch { @@ -192,6 +189,9 @@ stdenv.mkDerivation (rec { export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}" '' + lib.optionalString stdenv.isDarwin '' export NIX_LDFLAGS+=" -no_dtrace_dof" + + # GHC tries the host xattr /usr/bin/xattr by default which fails since it expects python to be 2.7 + export XATTR=${lib.getBin xattr}/bin/xattr '' + lib.optionalString targetPlatform.useAndroidPrebuilt '' sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets '' + lib.optionalString targetPlatform.isMusl '' diff --git a/pkgs/development/tools/haskell/haskell-language-server/withWrapper.nix b/pkgs/development/tools/haskell/haskell-language-server/withWrapper.nix index 23bd3dd3267f..3b57693a28c1 100644 --- a/pkgs/development/tools/haskell/haskell-language-server/withWrapper.nix +++ b/pkgs/development/tools/haskell/haskell-language-server/withWrapper.nix @@ -1,4 +1,4 @@ -{ lib, supportedGhcVersions ? [ "884" "8104" ], stdenv, haskellPackages +{ lib, supportedGhcVersions ? [ "884" "8106" ], stdenv, haskellPackages , haskell }: # # The recommended way to override this package is diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 5adcfd589b8d..8e4ca985ee92 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11411,7 +11411,7 @@ with pkgs; # Please update doc/languages-frameworks/haskell.section.md, “Our # current default compiler is”, if you bump this: - haskellPackages = dontRecurseIntoAttrs haskell.packages.ghc8104; + haskellPackages = dontRecurseIntoAttrs haskell.packages.ghc8106; inherit (haskellPackages) ghc; diff --git a/pkgs/top-level/haskell-packages.nix b/pkgs/top-level/haskell-packages.nix index 86a09b4a1fad..d60c20f38e0d 100644 --- a/pkgs/top-level/haskell-packages.nix +++ b/pkgs/top-level/haskell-packages.nix @@ -68,7 +68,7 @@ in { buildLlvmPackages = buildPackages.llvmPackages_7; llvmPackages = pkgs.llvmPackages_7; }; - ghc8104 = callPackage ../development/compilers/ghc/8.10.4.nix { + ghc8106 = callPackage ../development/compilers/ghc/8.10.6.nix { # aarch64 ghc865Binary gets SEGVs due to haskell#15449 or similar # 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 @@ -76,6 +76,10 @@ in { else packages.ghc865Binary; inherit (buildPackages.python3Packages) sphinx; + # Need to use apple's patched xattr until + # https://github.com/xattr/xattr/issues/44 and + # https://github.com/xattr/xattr/issues/55 are solved. + inherit (buildPackages.darwin) xattr; buildLlvmPackages = buildPackages.llvmPackages_9; llvmPackages = pkgs.llvmPackages_9; }; @@ -147,9 +151,9 @@ in { ghc = bh.compiler.ghc884; compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.8.x.nix { }; }; - ghc8104 = callPackage ../development/haskell-modules { - buildHaskellPackages = bh.packages.ghc8104; - ghc = bh.compiler.ghc8104; + ghc8106 = callPackage ../development/haskell-modules { + buildHaskellPackages = bh.packages.ghc8106; + ghc = bh.compiler.ghc8106; compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.10.x.nix { }; }; ghc901 = callPackage ../development/haskell-modules { diff --git a/pkgs/top-level/release-haskell.nix b/pkgs/top-level/release-haskell.nix index 400635740eae..d68b0605dddb 100644 --- a/pkgs/top-level/release-haskell.nix +++ b/pkgs/top-level/release-haskell.nix @@ -50,7 +50,7 @@ let # list of all compilers to test specific packages on all = with compilerNames; [ ghc884 - ghc8104 + ghc8106 ghc901 ]; @@ -300,12 +300,12 @@ let # package sets (like Cabal, jailbreak-cabal) are # working as expected. cabal-install = all; - Cabal_3_6_0_0 = with compilerNames; [ ghc884 ghc8104 ]; + Cabal_3_6_0_0 = with compilerNames; [ ghc884 ghc8106 ]; cabal2nix-unstable = all; funcmp = all; # Doesn't currently work on ghc-9.0: # https://github.com/haskell/haskell-language-server/issues/297 - haskell-language-server = with compilerNames; [ ghc884 ghc8104 ]; + haskell-language-server = with compilerNames; [ ghc884 ghc8106 ]; hoogle = all; hsdns = all; jailbreak-cabal = all;