haskell.compiler.ghc941: bootstrap using (binary) GHC 8.10.7

This shortens the bootstrap chain for 9.4.1 and should be kinder on
rebuilds. It requires some messing around in the configure file, since
it is not officially supported by upstream (but known to work). For now
it saves us the hassle of adding another bindist to nixpkgs. When we
support hadrian, we'll be able to use the already packaged 9.2.2
bindist.
This commit is contained in:
sternenseemann 2022-08-13 18:49:57 +02:00
parent 44c848bc02
commit d0706da55e
2 changed files with 16 additions and 3 deletions

View file

@ -264,6 +264,13 @@ stdenv.mkDerivation (rec {
--replace '*-android*|*-gnueabi*)' \
'*-android*|*-gnueabi*|*-musleabi*)'
done
''
# HACK: allow bootstrapping with GHC 8.10 which works fine, as we don't have
# binary 9.0 packaged. Bootstrapping with 9.2 is broken without hadrian.
+ ''
substituteInPlace configure --replace \
'MinBootGhcVersion="9.0"' \
'MinBootGhcVersion="8.10"'
'';
# TODO(@Ericson2314): Always pass "--target" and always prefix.

View file

@ -157,10 +157,16 @@ in {
};
ghc941 = callPackage ../development/compilers/ghc/9.4.1.nix {
bootPkgs =
# TODO(@sternenseemann): Package 9.0.2 bindist or wait for upstream fix
# Need to use 902 due to
# 9.2 is broken due to
# https://gitlab.haskell.org/ghc/ghc/-/issues/21914
packages.ghc902;
# Use 8.10 as a workaround, TODO: maybe package binary 9.0?
# aarch ghc8107Binary exceeds max output size on hydra
if stdenv.hostPlatform.isAarch then
packages.ghc8107BinaryMinimal
else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
packages.ghc8107
else
packages.ghc8107Binary;
inherit (buildPackages.python3Packages) sphinx;
# Need to use apple's patched xattr until
# https://github.com/xattr/xattr/issues/44 and