diff --git a/build.nix b/build.nix index 2bf29be8de..6eeefba7ae 100644 --- a/build.nix +++ b/build.nix @@ -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; diff --git a/ci.nix b/ci.nix index 6b057facd0..bd8bcd268d 100644 --- a/ci.nix +++ b/ci.nix @@ -73,7 +73,7 @@ ghc96llvm = true; ghc98 = true; ghc98llvm = true; - ghc910X = true; + ghc910 = true; ghc911 = true; }))); crossSystems = nixpkgsName: nixpkgs: compiler-nix-name: diff --git a/modules/cabal-project.nix b/modules/cabal-project.nix index 361a5f45f7..b9190178c3 100644 --- a/modules/cabal-project.nix +++ b/modules/cabal-project.nix @@ -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; diff --git a/overlays/bootstrap.nix b/overlays/bootstrap.nix index 977790fcae..bc14f6db96 100644 --- a/overlays/bootstrap.nix +++ b/overlays/bootstrap.nix @@ -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}"; @@ -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 ; @@ -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}; @@ -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 diff --git a/overlays/ghc-packages.nix b/overlays/ghc-packages.nix index 6de0bc9a03..d3c04aab5c 100644 --- a/overlays/ghc-packages.nix +++ b/overlays/ghc-packages.nix @@ -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"; diff --git a/overlays/patches/ghc/ghc-9.8-text-upper-bound.patch b/overlays/patches/ghc/ghc-9.8-text-upper-bound.patch new file mode 100644 index 0000000000..51432f5c16 --- /dev/null +++ b/overlays/patches/ghc/ghc-9.8-text-upper-bound.patch @@ -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, + diff --git a/test/plugin/default.nix b/test/plugin/default.nix index a38c5dde65..5826ee0c9a 100644 --- a/test/plugin/default.nix +++ b/test/plugin/default.nix @@ -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