Skip to content

Commit d5f5c7e

Browse files
authored
Add GHC 9.10.1 (#2194)
* Add GHC 9.10.1 * ifdLevel 1 * Fix text upper bound in ghc 9.8 linters * Fix text upper bound in ghc 9.8 linters * ifdLevel 2 * Build ghc 9.8 cross compilers with ghc 9.6 * ifdLevel 3 * Ignore cabal from GHC source for 9.10 * Build cabal-install from hackage with ghc HEAD * Disable plugin test for ghc 9.10 * Fix cabal-install build for ghc HEAD * Fix eval
1 parent 55e46dd commit d5f5c7e

File tree

7 files changed

+85
-22
lines changed

7 files changed

+85
-22
lines changed

build.nix

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ in rec {
2626

2727
tools = pkgs.lib.optionalAttrs (ifdLevel >= 3) (
2828
pkgs.recurseIntoAttrs ({
29-
cabal-latest = tool compiler-nix-name "cabal" { inherit evalPackages; };
29+
cabal-latest = tool compiler-nix-name "cabal" ({
30+
inherit evalPackages;
31+
} // pkgs.lib.optionalAttrs (ghcFromTo "9.10" "9.12") {
32+
cabalProjectLocal = builtins.readFile ./test/cabal.project.local;
33+
});
3034
} // pkgs.lib.optionalAttrs (__compareVersions haskell.compiler.${compiler-nix-name}.version "9.8" < 0) {
3135
hlint-latest = tool compiler-nix-name "hlint" {
3236
inherit evalPackages;

ci.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
ghc96llvm = true;
7474
ghc98 = true;
7575
ghc98llvm = true;
76-
ghc910X = true;
76+
ghc910 = true;
7777
ghc911 = true;
7878
})));
7979
crossSystems = nixpkgsName: nixpkgs: compiler-nix-name:

modules/cabal-project.nix

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,6 @@ in {
1717
compiler-nix-name = mkOption {
1818
type = str;
1919
description = "The name of the ghc compiler to use eg. \"ghc884\"";
20-
# Map short version names to the latest GHC version.
21-
# TODO: perhaps combine this with the `latestVer` mapping in `overlays/boostrap.nix`.
22-
apply = name:
23-
let
24-
fullName = pkgs.haskell-nix.resolve-compiler-name name;
25-
ghc910FullName = pkgs.haskell-nix.resolve-compiler-name "ghc910X";
26-
ghc911FullName = pkgs.haskell-nix.resolve-compiler-name "ghc911";
27-
in
28-
# cabal-install from hackage (3.10.3.0) does not build with GHC HEAD
29-
if builtins.elem fullName [ ghc910FullName ghc911FullName ] && config.name == "cabal-install" && (builtins.elem config.version ["3.10.1.0" "3.10.2.0" "3.10.2.1" "3.10.3.0"])
30-
then "ghc964"
31-
else pkgs.haskell-nix.resolve-compiler-name name;
3220
};
3321
compilerSelection = mkOption {
3422
type = unspecified;

overlays/bootstrap.nix

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ let
1111
"9.4" = "9.4.8";
1212
"9.6" = "9.6.5";
1313
"9.8" = "9.8.2";
14+
"9.10" = "9.10.1";
1415
};
1516
gitInputs = {
16-
ghc910X = "9.10.0";
1717
ghc911 = "9.11";
1818
};
1919
versionToNixName = v: "ghc${builtins.replaceStrings ["."] [""] v}";
@@ -279,6 +279,7 @@ in {
279279
++ final.lib.optional (versionAtLeast "9.6" && versionLessThan "9.8" && (final.stdenv.targetPlatform.isWindows || final.stdenv.targetPlatform.isMusl)) ./patches/ghc/ghc-9.6-0006-Adds-support-for-Hidden-symbols.patch
280280
++ final.lib.optional (versionAtLeast "9.6" && versionLessThan "9.8" && (final.stdenv.targetPlatform.isWindows || final.stdenv.targetPlatform.isMusl)) ./patches/ghc/ghc-9.6-0006-Adds-support-for-Hidden-symbols-2.patch
281281
++ fromUntil "9.9" "9.12" ./patches/ghc/ghc-9.9-Cabal-3.11.patch
282+
++ fromUntil "9.8" "9.9" ./patches/ghc/ghc-9.8-text-upper-bound.patch
282283
++ fromUntil "9.10" "9.12" ./patches/ghc/ghc-9.10-containers-upper-bound.patch
283284
++ fromUntil "9.10" "9.12" ./patches/ghc/ghc-9.10-merge-objects.patch
284285
;
@@ -1123,6 +1124,35 @@ in {
11231124

11241125
ghc-patches = ghc-patches "9.8.2";
11251126
});
1127+
ghc9101 = final.callPackage ../compiler/ghc (traceWarnOld "9.10" {
1128+
extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc9101; };
1129+
1130+
bootPkgs = bootPkgsGhc94 // {
1131+
ghc = if final.stdenv.buildPlatform != final.stdenv.targetPlatform
1132+
then final.buildPackages.buildPackages.haskell-nix.compiler.ghc9101
1133+
else final.buildPackages.buildPackages.haskell.compiler.ghc982
1134+
or final.buildPackages.buildPackages.haskell.compiler.ghc981
1135+
or final.buildPackages.buildPackages.haskell.compiler.ghc965
1136+
or final.buildPackages.buildPackages.haskell.compiler.ghc964
1137+
or final.buildPackages.buildPackages.haskell.compiler.ghc963
1138+
or final.buildPackages.buildPackages.haskell.compiler.ghc962
1139+
or final.buildPackages.buildPackages.haskell.compiler.ghc945
1140+
or final.buildPackages.buildPackages.haskell.compiler.ghc944
1141+
or final.buildPackages.buildPackages.haskell.compiler.ghc943;
1142+
};
1143+
inherit sphinx;
1144+
1145+
buildLlvmPackages = final.buildPackages.llvmPackages_12;
1146+
llvmPackages = final.llvmPackages_12;
1147+
1148+
src-spec = rec {
1149+
version = "9.10.1";
1150+
url = "https://downloads.haskell.org/~ghc/${version}/ghc-${version}-src.tar.xz";
1151+
sha256 = "sha256-vzhqMC1O4FR5H/1RdIkA8V1xdg/RmRV5ItEgzB+J4vc=";
1152+
};
1153+
1154+
ghc-patches = ghc-patches "9.10.1";
1155+
});
11261156
} // (__listToAttrs (final.lib.mapAttrsToList (source-name: ver:
11271157
let
11281158
src = final.haskell-nix.sources.${source-name};
@@ -1136,7 +1166,7 @@ in {
11361166

11371167
bootPkgs = bootPkgsGhc94 // {
11381168
ghc = if final.stdenv.buildPlatform != final.stdenv.targetPlatform
1139-
then final.buildPackages.buildPackages.haskell-nix.compiler.ghc982 # TODO use ${compiler-nix-name}
1169+
then final.buildPackages.buildPackages.haskell-nix.compiler.ghc9101 # TODO use ${compiler-nix-name}
11401170
else final.buildPackages.buildPackages.haskell.compiler.ghc982
11411171
or final.buildPackages.buildPackages.haskell.compiler.ghc981
11421172
or final.buildPackages.buildPackages.haskell.compiler.ghc965

overlays/ghc-packages.nix

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,6 @@ let
7373
iserv = "utils/iserv";
7474
} // final.lib.optionalAttrs ((!final.stdenv.hostPlatform.isGhcjs || builtins.compareVersions ghcVersion "9.6" < 0) && builtins.compareVersions ghcVersion "9.8" < 0) {
7575
libiserv = "libraries/libiserv";
76-
} // final.lib.optionalAttrs (builtins.compareVersions ghcVersion "9.9" > 0) {
77-
Cabal = "libraries/Cabal/Cabal";
78-
Cabal-syntax = "libraries/Cabal/Cabal-syntax";
79-
cabal-install = "libraries/Cabal/cabal-install";
80-
cabal-install-solver = "libraries/Cabal/cabal-install-solver";
8176
} // final.lib.optionalAttrs (!final.stdenv.hostPlatform.isGhcjs) {
8277
ghc = "compiler";
8378
ghc-boot = "libraries/ghc-boot";
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
diff --git a/linters/lint-commit-msg/lint-commit-msg.cabal b/linters/lint-commit-msg/lint-commit-msg.cabal
2+
index 7d1dbd0fcb..861ad6f03d 100644
3+
--- a/linters/lint-commit-msg/lint-commit-msg.cabal
4+
+++ b/linters/lint-commit-msg/lint-commit-msg.cabal
5+
@@ -26,4 +26,4 @@ executable lint-commit-msg
6+
base
7+
>= 4.14 && < 5,
8+
text
9+
- >= 1.2 && < 2.1
10+
+ >= 1.2 && < 2.2
11+
diff --git a/linters/lint-submodule-refs/lint-submodule-refs.cabal b/linters/lint-submodule-refs/lint-submodule-refs.cabal
12+
index ce4012adfc..9ff85d2731 100644
13+
--- a/linters/lint-submodule-refs/lint-submodule-refs.cabal
14+
+++ b/linters/lint-submodule-refs/lint-submodule-refs.cabal
15+
@@ -15,7 +15,7 @@ executable lint-submodule-refs
16+
base
17+
>= 4.14 && < 5,
18+
text
19+
- >= 1.2 && < 2.1,
20+
+ >= 1.2 && < 2.2,
21+
linters-common
22+
23+
ghc-options:
24+
diff --git a/linters/lint-whitespace/lint-whitespace.cabal b/linters/lint-whitespace/lint-whitespace.cabal
25+
index 61e376d1f9..ab49690435 100644
26+
--- a/linters/lint-whitespace/lint-whitespace.cabal
27+
+++ b/linters/lint-whitespace/lint-whitespace.cabal
28+
@@ -28,4 +28,4 @@ executable lint-whitespace
29+
base
30+
>= 4.14 && < 5,
31+
text
32+
- >= 1.2 && < 2.1,
33+
+ >= 1.2 && < 2.2,
34+
diff --git a/linters/linters-common/linters-common.cabal b/linters/linters-common/linters-common.cabal
35+
index 02245750dd..0bdd04a761 100644
36+
--- a/linters/linters-common/linters-common.cabal
37+
+++ b/linters/linters-common/linters-common.cabal
38+
@@ -16,7 +16,7 @@ library
39+
base
40+
>= 4.14 && < 5,
41+
text
42+
- >= 1.2 && < 2.1,
43+
+ >= 1.2 && < 2.2,
44+
deepseq
45+
>= 1.1,
46+

test/plugin/default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ in recurseIntoAttrs {
2121

2222
# Not sure why this breaks for ghc 8.10.7
2323
meta.disabled = compiler-nix-name == "ghc8107"
24-
|| builtins.elem compiler-nix-name [ "ghc910020240430" "ghc91120240504" ]
24+
|| builtins.elem compiler-nix-name [ "ghc9101" "ghc91120240504" ]
2525
|| stdenv.hostPlatform.isMusl
2626
|| stdenv.hostPlatform.isGhcjs
2727
|| stdenv.hostPlatform.isWindows

0 commit comments

Comments
 (0)