Skip to content

Add GHC 9.10.1 #2194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion build.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ in rec {

tools = pkgs.lib.optionalAttrs (ifdLevel >= 3) (
pkgs.recurseIntoAttrs ({
cabal-latest = tool compiler-nix-name "cabal" { inherit evalPackages; };
cabal-latest = tool compiler-nix-name "cabal" ({
inherit evalPackages;
} // pkgs.lib.optionalAttrs (ghcFromTo "9.10" "9.12") {
cabalProjectLocal = builtins.readFile ./test/cabal.project.local;
});
} // pkgs.lib.optionalAttrs (__compareVersions haskell.compiler.${compiler-nix-name}.version "9.8" < 0) {
hlint-latest = tool compiler-nix-name "hlint" {
inherit evalPackages;
Expand Down
2 changes: 1 addition & 1 deletion ci.nix
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
ghc96llvm = true;
ghc98 = true;
ghc98llvm = true;
ghc910X = true;
ghc910 = true;
ghc911 = true;
})));
crossSystems = nixpkgsName: nixpkgs: compiler-nix-name:
Expand Down
12 changes: 0 additions & 12 deletions modules/cabal-project.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,6 @@ in {
compiler-nix-name = mkOption {
type = str;
description = "The name of the ghc compiler to use eg. \"ghc884\"";
# Map short version names to the latest GHC version.
# TODO: perhaps combine this with the `latestVer` mapping in `overlays/boostrap.nix`.
apply = name:
let
fullName = pkgs.haskell-nix.resolve-compiler-name name;
ghc910FullName = pkgs.haskell-nix.resolve-compiler-name "ghc910X";
ghc911FullName = pkgs.haskell-nix.resolve-compiler-name "ghc911";
in
# cabal-install from hackage (3.10.3.0) does not build with GHC HEAD
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"])
then "ghc964"
else pkgs.haskell-nix.resolve-compiler-name name;
};
compilerSelection = mkOption {
type = unspecified;
Expand Down
34 changes: 32 additions & 2 deletions overlays/bootstrap.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ let
"9.4" = "9.4.8";
"9.6" = "9.6.5";
"9.8" = "9.8.2";
"9.10" = "9.10.1";
};
gitInputs = {
ghc910X = "9.10.0";
ghc911 = "9.11";
};
versionToNixName = v: "ghc${builtins.replaceStrings ["."] [""] v}";
Expand Down Expand Up @@ -279,6 +279,7 @@ in {
++ 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
++ 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
++ fromUntil "9.9" "9.12" ./patches/ghc/ghc-9.9-Cabal-3.11.patch
++ fromUntil "9.8" "9.9" ./patches/ghc/ghc-9.8-text-upper-bound.patch
++ fromUntil "9.10" "9.12" ./patches/ghc/ghc-9.10-containers-upper-bound.patch
++ fromUntil "9.10" "9.12" ./patches/ghc/ghc-9.10-merge-objects.patch
;
Expand Down Expand Up @@ -1123,6 +1124,35 @@ in {

ghc-patches = ghc-patches "9.8.2";
});
ghc9101 = final.callPackage ../compiler/ghc (traceWarnOld "9.10" {
extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc9101; };

bootPkgs = bootPkgsGhc94 // {
ghc = if final.stdenv.buildPlatform != final.stdenv.targetPlatform
then final.buildPackages.buildPackages.haskell-nix.compiler.ghc9101
else final.buildPackages.buildPackages.haskell.compiler.ghc982
or final.buildPackages.buildPackages.haskell.compiler.ghc981
or final.buildPackages.buildPackages.haskell.compiler.ghc965
or final.buildPackages.buildPackages.haskell.compiler.ghc964
or final.buildPackages.buildPackages.haskell.compiler.ghc963
or final.buildPackages.buildPackages.haskell.compiler.ghc962
or final.buildPackages.buildPackages.haskell.compiler.ghc945
or final.buildPackages.buildPackages.haskell.compiler.ghc944
or final.buildPackages.buildPackages.haskell.compiler.ghc943;
};
inherit sphinx;

buildLlvmPackages = final.buildPackages.llvmPackages_12;
llvmPackages = final.llvmPackages_12;

src-spec = rec {
version = "9.10.1";
url = "https://downloads.haskell.org/~ghc/${version}/ghc-${version}-src.tar.xz";
sha256 = "sha256-vzhqMC1O4FR5H/1RdIkA8V1xdg/RmRV5ItEgzB+J4vc=";
};

ghc-patches = ghc-patches "9.10.1";
});
} // (__listToAttrs (final.lib.mapAttrsToList (source-name: ver:
let
src = final.haskell-nix.sources.${source-name};
Expand All @@ -1136,7 +1166,7 @@ in {

bootPkgs = bootPkgsGhc94 // {
ghc = if final.stdenv.buildPlatform != final.stdenv.targetPlatform
then final.buildPackages.buildPackages.haskell-nix.compiler.ghc982 # TODO use ${compiler-nix-name}
then final.buildPackages.buildPackages.haskell-nix.compiler.ghc9101 # TODO use ${compiler-nix-name}
else final.buildPackages.buildPackages.haskell.compiler.ghc982
or final.buildPackages.buildPackages.haskell.compiler.ghc981
or final.buildPackages.buildPackages.haskell.compiler.ghc965
Expand Down
5 changes: 0 additions & 5 deletions overlays/ghc-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,6 @@ let
iserv = "utils/iserv";
} // final.lib.optionalAttrs ((!final.stdenv.hostPlatform.isGhcjs || builtins.compareVersions ghcVersion "9.6" < 0) && builtins.compareVersions ghcVersion "9.8" < 0) {
libiserv = "libraries/libiserv";
} // final.lib.optionalAttrs (builtins.compareVersions ghcVersion "9.9" > 0) {
Cabal = "libraries/Cabal/Cabal";
Cabal-syntax = "libraries/Cabal/Cabal-syntax";
cabal-install = "libraries/Cabal/cabal-install";
cabal-install-solver = "libraries/Cabal/cabal-install-solver";
} // final.lib.optionalAttrs (!final.stdenv.hostPlatform.isGhcjs) {
ghc = "compiler";
ghc-boot = "libraries/ghc-boot";
Expand Down
46 changes: 46 additions & 0 deletions overlays/patches/ghc/ghc-9.8-text-upper-bound.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
diff --git a/linters/lint-commit-msg/lint-commit-msg.cabal b/linters/lint-commit-msg/lint-commit-msg.cabal
index 7d1dbd0fcb..861ad6f03d 100644
--- a/linters/lint-commit-msg/lint-commit-msg.cabal
+++ b/linters/lint-commit-msg/lint-commit-msg.cabal
@@ -26,4 +26,4 @@ executable lint-commit-msg
base
>= 4.14 && < 5,
text
- >= 1.2 && < 2.1
+ >= 1.2 && < 2.2
diff --git a/linters/lint-submodule-refs/lint-submodule-refs.cabal b/linters/lint-submodule-refs/lint-submodule-refs.cabal
index ce4012adfc..9ff85d2731 100644
--- a/linters/lint-submodule-refs/lint-submodule-refs.cabal
+++ b/linters/lint-submodule-refs/lint-submodule-refs.cabal
@@ -15,7 +15,7 @@ executable lint-submodule-refs
base
>= 4.14 && < 5,
text
- >= 1.2 && < 2.1,
+ >= 1.2 && < 2.2,
linters-common

ghc-options:
diff --git a/linters/lint-whitespace/lint-whitespace.cabal b/linters/lint-whitespace/lint-whitespace.cabal
index 61e376d1f9..ab49690435 100644
--- a/linters/lint-whitespace/lint-whitespace.cabal
+++ b/linters/lint-whitespace/lint-whitespace.cabal
@@ -28,4 +28,4 @@ executable lint-whitespace
base
>= 4.14 && < 5,
text
- >= 1.2 && < 2.1,
+ >= 1.2 && < 2.2,
diff --git a/linters/linters-common/linters-common.cabal b/linters/linters-common/linters-common.cabal
index 02245750dd..0bdd04a761 100644
--- a/linters/linters-common/linters-common.cabal
+++ b/linters/linters-common/linters-common.cabal
@@ -16,7 +16,7 @@ library
base
>= 4.14 && < 5,
text
- >= 1.2 && < 2.1,
+ >= 1.2 && < 2.2,
deepseq
>= 1.1,

2 changes: 1 addition & 1 deletion test/plugin/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ in recurseIntoAttrs {

# Not sure why this breaks for ghc 8.10.7
meta.disabled = compiler-nix-name == "ghc8107"
|| builtins.elem compiler-nix-name [ "ghc910020240430" "ghc91120240504" ]
|| builtins.elem compiler-nix-name [ "ghc9101" "ghc91120240504" ]
|| stdenv.hostPlatform.isMusl
|| stdenv.hostPlatform.isGhcjs
|| stdenv.hostPlatform.isWindows
Expand Down
Loading