3
0
Fork 0
forked from mirrors/nixpkgs

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:

* 11e1dcde0d
* ec451cac39

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 <cheng.shao@tweag.io>
This commit is contained in:
sternenseemann 2021-06-06 10:43:36 +00:00 committed by sternenseemann
parent 283d622397
commit cb330ce4f0
5 changed files with 19 additions and 15 deletions

View file

@ -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 ''

View file

@ -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

View file

@ -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;

View file

@ -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 {

View file

@ -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;