haskell.compiler.ghcHEAD: 9.7.20230527 -> 9.9.20231014

This commit is contained in:
sternenseemann 2023-10-21 12:35:29 +02:00
parent fd8a8c9160
commit 2ec6f63534
9 changed files with 172 additions and 35 deletions

View file

@ -150,7 +150,7 @@
# GHC's build system hadrian built from the GHC-to-build's source tree
# using our bootstrap GHC.
, hadrian ? bootPkgs.callPackage ../../tools/haskell/hadrian {
, hadrian ? import ../../tools/haskell/hadrian/make-hadrian.nix { inherit bootPkgs lib; } {
ghcSrc = ghcSrc;
ghcVersion = version;
userSettings = hadrianUserSettings;

View file

@ -1,5 +1,5 @@
import ./common-hadrian.nix {
version = "9.7.20230527";
rev = "69fdbece5f6ca0a718bb9f1fef7b0ab57cf6b664";
sha256 = "13rf1d27wdich0kmbds55by9vj3wz0v9clba9p8qpwz7x7wpcjz2";
version = "9.9.20231014";
rev = "13d3c613c3c1e4942c698449bdf58a6a13b76695";
sha256 = "13xp4ijnym2qbw2qbxkvfb79l7034vrcm9j2j9kirbhjxzdshvx9";
}

View file

@ -0,0 +1,52 @@
{ pkgs, haskellLib }:
let
inherit (pkgs) lib;
in
self: super: {
llvmPackages = lib.dontRecurseIntoAttrs self.ghc.llvmPackages;
# Disable GHC core libraries
array = null;
base = null;
binary = null;
bytestring = null;
Cabal = null;
Cabal-syntax = null;
containers = null;
deepseq = null;
directory = null;
exceptions = null;
filepath = null;
ghc-bignum = null;
ghc-boot = null;
ghc-boot-th = null;
ghc-compact = null;
ghc-experimental = null;
ghc-heap = null;
ghc-internal = null;
ghc-platform = null;
ghc-prim = null;
ghc-toolchain = null;
ghci = null;
haskeline = null;
hpc = null;
integer-gmp = null;
mtl = null;
parsec = null;
pretty = null;
process = null;
rts = null;
semaphore-compat = null;
stm = null;
system-cxx-std-lib = null;
template-haskell = null;
# GHC only builds terminfo if it is a native compiler
terminfo = if pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform then null else self.terminfo_0_4_1_6;
text = null;
time = null;
transformers = null;
unix = null;
xhtml = null;
}

View file

@ -1,10 +1,3 @@
##
## Caveat: a copy of configuration-ghc-8.6.x.nix with minor changes:
##
## 1. "8.7" strings
## 2. llvm 6
## 3. disabled library update: parallel
##
{ pkgs, haskellLib }:
with haskellLib;

View file

@ -0,0 +1,16 @@
{ mkDerivation, base, lib
# GHC source tree to build ghc-toolchain from
, ghcSrc
, ghcVersion
}:
mkDerivation {
pname = "ghc-platform";
version = ghcVersion;
src = ghcSrc;
postUnpack = ''
sourceRoot="$sourceRoot/libraries/ghc-platform"
'';
libraryHaskellDepends = [ base ];
description = "Platform information used by GHC and friends";
license = lib.licenses.bsd3;
}

View file

@ -0,0 +1,19 @@
{ mkDerivation, base, directory, filepath, ghc-platform, lib
, process, text, transformers
# GHC source tree to build ghc-toolchain from
, ghcVersion
, ghcSrc
}:
mkDerivation {
pname = "ghc-toolchain";
version = ghcVersion;
src = ghcSrc;
postUnpack = ''
sourceRoot="$sourceRoot/utils/ghc-toolchain"
'';
libraryHaskellDepends = [
base directory filepath ghc-platform process text transformers
];
description = "Utility for managing GHC target toolchains";
license = lib.licenses.bsd3;
}

View file

@ -1,20 +1,19 @@
{ # GHC source tree to build hadrian from
ghcSrc ? null, ghcVersion ? null
, mkDerivation, base, bytestring, Cabal, containers, directory
# See also ./make-hadria.nix
{ mkDerivation, base, bytestring, Cabal, containers, directory
, extra, filepath, lib, mtl, parsec, shake, text, transformers
, unordered-containers, cryptohash-sha256, base16-bytestring
, userSettings ? null
# Whether to pass --hyperlinked-source to haddock or not. This is a custom
# workaround as we wait for this to be configurable via userSettings or similar.
# https://gitlab.haskell.org/ghc/ghc/-/issues/23625
, enableHyperlinkedSource ? true
, writeText
# Dependencies that are not on Hackage and only used in certain Hadrian versions
, ghc-platform ? null
, ghc-toolchain ? null
# GHC source tree to build hadrian from
, ghcSrc
, ghcVersion
# Customization
, userSettings ? null
, enableHyperlinkedSource
}:
if ghcSrc == null || ghcVersion == null
then throw "hadrian: need to specify ghcSrc and ghcVersion arguments manually"
else
mkDerivation {
pname = "hadrian";
version = ghcVersion;
@ -44,7 +43,13 @@ mkDerivation {
parsec shake text transformers unordered-containers
] ++ lib.optionals (lib.versionAtLeast ghcVersion "9.7") [
cryptohash-sha256 base16-bytestring
] ++ lib.optionals (lib.versionAtLeast ghcVersion "9.9") [
ghc-platform ghc-toolchain
];
passthru = {
# Expose »private« dependencies if any
inherit ghc-platform ghc-toolchain;
};
description = "GHC build system";
license = lib.licenses.bsd3;
}

View file

@ -0,0 +1,59 @@
# Hadrian is the build system used to (exclusively) build GHC. It can
# (theoretically) be used starting with GHC 9.4 and is required since 9.6. It is
# developed in the GHC source tree and specific to the GHC version it is released
# with, i.e. Hadrian always needs to be built from the same GHC source tree as
# the GHC we want to build.
#
# This fact makes it impossible to integrate Hadrian into our Haskell package
# sets which are also used to bootstrap GHC, since a package set can bootstrap
# multiple GHC versions (usually two major versions). A bootstrap set would need
# knowledge of the GHC it would eventually bootstrap which would make the logic
# unnecessarily complicated.
#
# Luckily Hadrian is, while annoying to bootstrap, relatively simple. Specifically
# all it requires to build is (relative to the GHC we are trying to build) a
# build->build GHC and build->build Haskell packages. We can get all of this
# from bootPkgs which is already passed to the GHC expression.
#
# The solution is the following: The GHC expression passes its source tree and
# version along with some parameters to this function (./make-hadrian.nix)
# which acts as a common expression builder for all Hadrian version as well as
# related packages that are managed in the GHC source tree. Its main job is to
# expose all possible compile time customization in a common interface and
# take care of all differences between Hadrian versions.
{ bootPkgs
, lib
}:
{ # GHC source tree and version to build hadrian & friends from.
# These are passed on to the actual package expressions.
ghcSrc
, ghcVersion
# Contents of a non-default UserSettings.hs to use when building hadrian, if any.
# Should be a string or null.
, userSettings ? null
# Whether to pass --hyperlinked-source to haddock or not. This is a custom
# workaround as we wait for this to be configurable via userSettings or similar.
# https://gitlab.haskell.org/ghc/ghc/-/issues/23625
, enableHyperlinkedSource ? false
}:
let
callPackage' = f: args: bootPkgs.callPackage f ({
inherit ghcSrc ghcVersion;
} // args);
ghc-platform = callPackage' ./ghc-platform.nix { };
ghc-toolchain = callPackage' ./ghc-toolchain.nix {
inherit ghc-platform;
};
in
callPackage' ./hadrian.nix ({
inherit userSettings enableHyperlinkedSource;
} // lib.optionalAttrs (lib.versionAtLeast ghcVersion "9.9") {
# Starting with GHC 9.9 development, additional in tree packages are required
# to build hadrian. (Hackage-released conditional dependencies are handled
# in ./hadrian.nix without requiring intervention here.)
inherit ghc-platform ghc-toolchain;
})

View file

@ -415,22 +415,15 @@ in {
};
ghc98 = compiler.ghc981;
ghcHEAD = callPackage ../development/compilers/ghc/head.nix {
bootPkgs =
# For GHC 9.2 no armv7l bindists are available.
if stdenv.hostPlatform.isAarch32 then
packages.ghc924
else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
packages.ghc924
else
packages.ghc924Binary;
bootPkgs = packages.ghc963;
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 autoSignDarwinBinariesHook;
# 2023-01-15: Support range >= 10 && < 15
buildTargetLlvmPackages = pkgsBuildTarget.llvmPackages_14;
llvmPackages = pkgs.llvmPackages_14;
# 2023-01-15: Support range >= 11 && < 16
buildTargetLlvmPackages = pkgsBuildTarget.llvmPackages_15;
llvmPackages = pkgs.llvmPackages_15;
};
ghcjs = compiler.ghcjs810;
@ -586,7 +579,7 @@ in {
ghcHEAD = callPackage ../development/haskell-modules {
buildHaskellPackages = bh.packages.ghcHEAD;
ghc = bh.compiler.ghcHEAD;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-9.8.x.nix { };
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-9.10.x.nix { };
};
ghcjs = packages.ghcjs810;