Skip to content

Commit 08889bd

Browse files
authored
Add prerelease ghc 9.8.1 from GitLab commit (#1991)
Add prerelease ghc 9.8.1 from GitLab commit * JS: support -this-unit-id for programs in the linker See https://gitlab.haskell.org/ghc/ghc/-/merge_requests/10819 * Haskell Language Server 2.0.0.1 * Fix building hoogle with new index-state
1 parent f857b53 commit 08889bd

File tree

403 files changed

+56069
-449
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

403 files changed

+56069
-449
lines changed

build.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ in rec {
5757
inherit evalPackages;
5858
src = pkgs.haskell-nix.sources."hls-1.10";
5959
};
60-
} // {
60+
} // pkgs.lib.optionalAttrs (__compareVersions haskell.compiler.${compiler-nix-name}.version "9.8" < 0) {
6161
"hls-20" = tool compiler-nix-name "haskell-language-server" {
6262
inherit evalPackages;
6363
src = pkgs.haskell-nix.sources."hls-2.0";

builder/default.nix

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,11 @@ let
6464
then pkgs.path
6565
else pkgs.haskell-nix.sources.nixpkgs-2205;
6666
nixpkgsHoogle = import (nixpkgs + /pkgs/development/haskell-modules/hoogle.nix);
67-
in { packages ? [], hoogle ? pkgs.buildPackages.haskell-nix.tool "ghc8107" "hoogle" {
67+
in { packages ? [], hoogle ? pkgs.buildPackages.haskell-nix.tool "ghc928" "hoogle" {
6868
inherit evalPackages;
6969
version = "5.0.18.3";
70-
index-state = pkgs.haskell-nix.internalHackageIndexState;
70+
# index-state = pkgs.haskell-nix.internalHackageIndexState;
71+
index-state = "2023-06-05T00:00:00Z";
7172
}
7273
}:
7374
let

ci.nix

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,30 +66,31 @@
6666
ghc928 = true;
6767
ghc945 = true;
6868
ghc962 = true;
69+
ghc9820230704 = true;
6970
}));
7071
crossSystems = nixpkgsName: nixpkgs: compiler-nix-name:
7172
# We need to use the actual nixpkgs version we're working with here, since the values
7273
# of 'lib.systems.examples' are not understood between all versions
7374
let lib = nixpkgs.lib;
7475
in lib.optionalAttrs (nixpkgsName == "unstable"
75-
&& ((system == "x86_64-linux" && __elem compiler-nix-name ["ghc8107" "ghc962"])
76-
|| (system == "aarch64-linux" && __elem compiler-nix-name ["ghc8107" "ghc962"])
77-
|| (system == "x86_64-darwin" && __elem compiler-nix-name ["ghc8107" "ghc962"])
78-
|| (system == "aarch64-darwin" && __elem compiler-nix-name ["ghc8107" "ghc962"])
76+
&& ((system == "x86_64-linux" && __elem compiler-nix-name ["ghc8107" "ghc962" "ghc9820230704"])
77+
|| (system == "aarch64-linux" && __elem compiler-nix-name ["ghc8107" "ghc962" "ghc9820230704"])
78+
|| (system == "x86_64-darwin" && __elem compiler-nix-name ["ghc8107" "ghc962" "ghc9820230704"])
79+
|| (system == "aarch64-darwin" && __elem compiler-nix-name ["ghc8107" "ghc962" "ghc9820230704"])
7980
)) {
8081
inherit (lib.systems.examples) ghcjs;
8182
} // lib.optionalAttrs (nixpkgsName == "unstable"
82-
&& ((system == "x86_64-linux" && __elem compiler-nix-name ["ghc8107" "ghc902" "ghc926" "ghc927" "ghc928" "ghc945" "ghc962"])
83+
&& ((system == "x86_64-linux" && __elem compiler-nix-name ["ghc8107" "ghc902" "ghc926" "ghc927" "ghc928" "ghc945" "ghc962" "ghc9820230704"])
8384
|| (system == "x86_64-darwin" && __elem compiler-nix-name []))) { # TODO add ghc versions when we have more darwin build capacity
8485
inherit (lib.systems.examples) mingwW64;
85-
} // lib.optionalAttrs (system == "x86_64-linux" && nixpkgsName == "unstable" && __elem compiler-nix-name ["ghc8107" "ghc902" "ghc922" "ghc923" "ghc924" "ghc926" "ghc927" "ghc928" "ghc945" "ghc962"]) {
86+
} // lib.optionalAttrs (system == "x86_64-linux" && nixpkgsName == "unstable" && __elem compiler-nix-name ["ghc8107" "ghc902" "ghc922" "ghc923" "ghc924" "ghc926" "ghc927" "ghc928" "ghc945" "ghc962" "ghc9820230704"]) {
8687
# Musl cross only works on linux
8788
# aarch64 cross only works on linux
8889
inherit (lib.systems.examples) musl64 aarch64-multiplatform;
8990
} // lib.optionalAttrs (system == "x86_64-linux" && nixpkgsName == "unstable" && __elem compiler-nix-name ["ghc927" "ghc928"]) {
9091
# TODO fix this for the compilers we build with hadrian (ghc >=9.4)
9192
inherit (lib.systems.examples) aarch64-multiplatform-musl;
92-
} // lib.optionalAttrs (system == "aarch64-linux" && nixpkgsName == "unstable" && __elem compiler-nix-name ["ghc927" "ghc928" "ghc945" "ghc962"]) {
93+
} // lib.optionalAttrs (system == "aarch64-linux" && nixpkgsName == "unstable" && __elem compiler-nix-name ["ghc927" "ghc928" "ghc945" "ghc962" "ghc9820230704"]) {
9394
inherit (lib.systems.examples) aarch64-multiplatform-musl;
9495
};
9596
isDisabled = d: d.meta.disabled or false;

compiler/ghc/default.nix

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ assert enableNativeBignum -> !enableIntegerSimple;
8686
assert enableIntegerSimple -> !enableNativeBignum;
8787

8888
let
89-
src = src-spec.file or fetchurl { inherit (src-spec) url sha256; };
89+
src = src-spec.file or (fetchurl { inherit (src-spec) url sha256; });
9090

9191
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
9292
inherit (haskell-nix.haskellLib) isCrossTarget;
@@ -241,7 +241,9 @@ let
241241
then ../../materialized/ghc8107/hadrian-ghc92
242242
else if builtins.compareVersions ghc-version "9.6" < 0
243243
then ../../materialized/ghc8107/hadrian-ghc94
244-
else ../../materialized/ghc8107/hadrian-ghc96;
244+
else if builtins.compareVersions ghc-version "9.8" < 0
245+
then ../../materialized/ghc8107/hadrian-ghc96
246+
else ../../materialized/ghc8107/hadrian-ghc98;
245247
modules = [{
246248
# Apply the patches in a way that does not require using something
247249
# like `srcOnly`. The problem with `pkgs.srcOnly` was that it had to run
@@ -342,9 +344,8 @@ stdenv.mkDerivation (rec {
342344
patches = ghc-patches;
343345

344346
# configure was run by configured-src already.
345-
phases = [ "unpackPhase" "patchPhase" ]
346-
++ lib.optional (ghc-patches != [] && !stdenv.targetPlatform.isGhcjs) "autoreconfPhase" # autoreconf can replace config.sub with one that is missing ghcjs
347-
++ [ "configurePhase" "buildPhase"
347+
phases = [ "unpackPhase" "patchPhase" "autoreconfPhase"
348+
"configurePhase" "buildPhase"
348349
"checkPhase" "installPhase"
349350
"fixupPhase"
350351
"installCheckPhase"
@@ -358,11 +359,14 @@ stdenv.mkDerivation (rec {
358359
for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do
359360
export "''${env#TARGET_}=''${!env}"
360361
done
361-
'' + lib.optionalString (targetPlatform.isGhcjs) ''
362+
''
363+
# Use emscripten and the `config.sub` saved by `postPatch`
364+
+ lib.optionalString (targetPlatform.isGhcjs) ''
362365
export CC="${targetCC}/bin/emcc"
363366
export CXX="${targetCC}/bin/em++"
364367
export LD="${targetCC}/bin/emcc"
365368
export EM_CACHE=$(mktemp -d)
369+
mv config.sub.ghcjs config.sub
366370
''
367371
# GHC is a bit confused on its cross terminology, as these would normally be
368372
# the *host* tools.
@@ -425,8 +429,8 @@ stdenv.mkDerivation (rec {
425429
echo '${ghc-version-date}' > VERSION_DATE
426430
''
427431
# The official ghc 9.2.3 tarball requires booting.
428-
+ lib.optionalString (ghc-version == "9.2.3") ''
429-
./boot
432+
+ lib.optionalString (ghc-version == "9.2.3" || ghc-version == "9.8.20230704") ''
433+
python3 ./boot
430434
'';
431435

432436
configurePlatforms = [ "build" "host" ] ++ lib.optional (!targetPlatform.isGhcjs) "target";
@@ -626,14 +630,18 @@ stdenv.mkDerivation (rec {
626630
mkdir $doc
627631
mkdir $generated
628632
'';
629-
phases = [ "unpackPhase" "patchPhase" ]
630-
++ lib.optional (ghc-patches != []) "autoreconfPhase"
631-
++ [ "configurePhase" "installPhase"];
633+
phases = [ "unpackPhase" "patchPhase" "autoreconfPhase"
634+
"configurePhase" "installPhase"];
632635
} // lib.optionalAttrs useHadrian {
633636
postConfigure = ''
634637
for a in libraries/*/*.cabal.in utils/*/*.cabal.in compiler/ghc.cabal.in; do
635638
${hadrian}/bin/hadrian ${hadrianArgs} "''${a%.*}"
636639
done
640+
'' + lib.optionalString (builtins.compareVersions ghc-version "9.8.1" >= 0) ''
641+
for a in bytearray-access-ops.txt.pp addr-access-ops.txt.pp primops.txt; do
642+
${hadrian}/bin/hadrian ${hadrianArgs} _build/stage0/compiler/build/$a
643+
cp _build/stage0/compiler/build/$a compiler/GHC/Builtin/$a
644+
done
637645
'' + lib.optionalString stdenv.isDarwin ''
638646
substituteInPlace mk/system-cxx-std-lib-1.0.conf \
639647
--replace 'dynamic-library-dirs:' 'dynamic-library-dirs: ${libcxx}/lib ${libcxxabi}/lib'
@@ -644,6 +652,12 @@ stdenv.mkDerivation (rec {
644652
--replace 'cross-compiling = YES' \
645653
'cross-compiling = NO'
646654
'';
655+
} // lib.optionalAttrs targetPlatform.isGhcjs {
656+
# Backup the config.sub that knows what `ghcjs` is in case
657+
# `autoreconfPhase` replaces it
658+
postPatch = ''
659+
cp config.sub config.sub.ghcjs
660+
'';
647661
});
648662

649663
# Used to detect non haskell-nix compilers (accidental use of nixpkgs compilers can lead to unexpected errors)
@@ -671,6 +685,12 @@ stdenv.mkDerivation (rec {
671685
# Needed for `haddock` to work on source that includes non ASCII chars
672686
LANG = "en_US.UTF-8";
673687
LC_ALL = "en_US.UTF-8";
688+
} // lib.optionalAttrs targetPlatform.isGhcjs {
689+
# Backup the config.sub that knows what `ghcjs` is in case
690+
# `autoreconfPhase` replaces it
691+
postPatch = ''
692+
cp config.sub config.sub.ghcjs
693+
'';
674694
} // lib.optionalAttrs (stdenv.buildPlatform.libc == "glibc") {
675695
LOCALE_ARCHIVE = "${buildPackages.glibcLocales}/lib/locale/locale-archive";
676696
} // lib.optionalAttrs targetPlatform.useAndroidPrebuilt {
@@ -715,7 +735,7 @@ stdenv.mkDerivation (rec {
715735
'';
716736
buildPhase = ''
717737
${hadrian}/bin/hadrian ${hadrianArgs}
718-
'' + lib.optionalString (installStage1 && !stdenv.targetPlatform.isGhcjs) ''
738+
'' + lib.optionalString (installStage1 && !stdenv.targetPlatform.isGhcjs && builtins.compareVersions ghc-version "9.8" < 0) ''
719739
${hadrian}/bin/hadrian ${hadrianArgs} stage1:lib:libiserv
720740
'' + lib.optionalString targetPlatform.isMusl ''
721741
${hadrian}/bin/hadrian ${hadrianArgs} stage1:lib:terminfo

flake.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)