diff --git a/build.nix b/build.nix index 84644af1a4..7284682327 100644 --- a/build.nix +++ b/build.nix @@ -28,7 +28,7 @@ in rec { pkgs.recurseIntoAttrs ({ cabal-latest = tool compiler-nix-name "cabal" ({ inherit evalPackages; - } // pkgs.lib.optionalAttrs (ghcFromTo "9.12" "9.13") { + } // pkgs.lib.optionalAttrs (ghcFromTo "9.13" "9.14") { cabalProjectLocal = builtins.readFile ./test/cabal.project.local; }); } // pkgs.lib.optionalAttrs (__compareVersions haskell.compiler.${compiler-nix-name}.version "9.8" < 0) { diff --git a/ci.nix b/ci.nix index 7ff0476808..d9378f8062 100644 --- a/ci.nix +++ b/ci.nix @@ -73,6 +73,7 @@ ghc98llvm = false; ghc910 = true; ghc910llvm = true; + ghc9121 = true; ghc912X = true; ghc913 = true; }))); diff --git a/lazy-inputs/default.nix b/lazy-inputs/default.nix index bdbc23aea6..a1b1f446bc 100644 --- a/lazy-inputs/default.nix +++ b/lazy-inputs/default.nix @@ -34,6 +34,7 @@ in { inherit ((callFlake { pkgs = final; src = ./ghc983; }).defaultNix) ghc983; inherit ((callFlake { pkgs = final; src = ./ghc984; }).defaultNix) ghc984; inherit ((callFlake { pkgs = final; src = ./ghc9101; }).defaultNix) ghc9101; + inherit ((callFlake { pkgs = final; src = ./ghc9121; }).defaultNix) ghc9121; inherit ((callFlake { pkgs = final; src = ./ghc912X; }).defaultNix) ghc912X; inherit ((callFlake { pkgs = final; src = ./ghc913; }).defaultNix) ghc913; } // prev.haskell-nix.sources; diff --git a/lazy-inputs/ghc9121/flake.lock b/lazy-inputs/ghc9121/flake.lock new file mode 100644 index 0000000000..2b1d28bfca --- /dev/null +++ b/lazy-inputs/ghc9121/flake.lock @@ -0,0 +1,30 @@ +{ + "nodes": { + "ghc9121": { + "flake": false, + "locked": { + "lastModified": 1734278290, + "narHash": "sha256-oSiGEkiQlkmCr7qsFUJ9qpwsU4AumOIpFn6zN4ByMNg=", + "ref": "ghc-9.12.1-iog", + "rev": "daf659b6e3c8f2a84100fbee797cd9d457c00df5", + "revCount": 67524, + "submodules": true, + "type": "git", + "url": "https://github.com/stable-haskell/ghc" + }, + "original": { + "ref": "ghc-9.12.1-iog", + "submodules": true, + "type": "git", + "url": "https://github.com/stable-haskell/ghc" + } + }, + "root": { + "inputs": { + "ghc9121": "ghc9121" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/lazy-inputs/ghc9121/flake.nix b/lazy-inputs/ghc9121/flake.nix new file mode 100644 index 0000000000..8973132b05 --- /dev/null +++ b/lazy-inputs/ghc9121/flake.nix @@ -0,0 +1,12 @@ +{ + description = "Lazy Input for Haskell.nix"; + + inputs = { + ghc9121 = { + flake = false; + url = "git+https://github.com/stable-haskell/ghc?ref=ghc-9.12.1-iog&submodules=1"; + }; + }; + + outputs = inputs: inputs; +} diff --git a/lazy-inputs/ghc912X/flake.lock b/lazy-inputs/ghc912X/flake.lock index dbf6108445..9b29a431ef 100644 --- a/lazy-inputs/ghc912X/flake.lock +++ b/lazy-inputs/ghc912X/flake.lock @@ -3,11 +3,11 @@ "ghc912X": { "flake": false, "locked": { - "lastModified": 1732798405, - "narHash": "sha256-gYYJMwnnPFHHbSc2SkJldBRl5ECZg3/muFAd21xJqfM=", + "lastModified": 1734278290, + "narHash": "sha256-oSiGEkiQlkmCr7qsFUJ9qpwsU4AumOIpFn6zN4ByMNg=", "ref": "ghc-9.12", - "rev": "5d938345841e3dff6a1dfa129202ba939a4564c9", - "revCount": 67485, + "rev": "daf659b6e3c8f2a84100fbee797cd9d457c00df5", + "revCount": 67524, "submodules": true, "type": "git", "url": "https://gitlab.haskell.org/ghc/ghc" diff --git a/lazy-inputs/ghc913/flake.lock b/lazy-inputs/ghc913/flake.lock index 010b5c7467..15c5acd8a1 100644 --- a/lazy-inputs/ghc913/flake.lock +++ b/lazy-inputs/ghc913/flake.lock @@ -3,11 +3,11 @@ "ghc913": { "flake": false, "locked": { - "lastModified": 1733355534, - "narHash": "sha256-kCiFiMIsOQWfXP73qWjhfvGv8OdFBg7nz6InQc/xhhQ=", + "lastModified": 1735577639, + "narHash": "sha256-sGNckeL3B6Iw+3wawRjgFEXo/dLiyKAtnbFxY9tX6Qg=", "ref": "refs/heads/master", - "rev": "cad6fede4252aeff3a0a93e81c2188a825ab39c6", - "revCount": 67629, + "rev": "278a53ee698d961d97afb60be9db2d8bf60b4074", + "revCount": 67713, "submodules": true, "type": "git", "url": "https://gitlab.haskell.org/ghc/ghc" diff --git a/lib/call-cabal-project-to-nix.nix b/lib/call-cabal-project-to-nix.nix index d90f5716b3..c8ba1c746b 100644 --- a/lib/call-cabal-project-to-nix.nix +++ b/lib/call-cabal-project-to-nix.nix @@ -511,18 +511,18 @@ let json_cabal_file=$(mktemp) cabal2json $fixed_cabal_file > $json_cabal_file - exposed_modules="$(jq -r '.library."exposed-modules"[]|select(type=="array")[]' $json_cabal_file)" - reexported_modules="$(jq -r '.library."reexported-modules"//[]|.[]|select(type=="array")[]' $json_cabal_file)" + exposed_modules="$(jq -r '.library."exposed-modules"//[]|.[]|select(type=="array")[]' $json_cabal_file)" + reexported_modules="$(jq -r '.library."reexported-modules"//[]|.[]|select(type=="array")[]' $json_cabal_file | sed 's/.* as //g')" # FIXME This is a bandaid. Rather than doing this, conditionals should be interpreted. ${pkgs.lib.optionalString pkgs.stdenv.targetPlatform.isGhcjs '' - exposed_modules+=" $(jq -r '.library."exposed-modules"[]|select(type=="object" and .if.arch == "javascript")|.then[]' $json_cabal_file)" + exposed_modules+=" $(jq -r '.library."exposed-modules"//[]|.[]|select(type=="object" and .if.arch == "javascript")|.then[]' $json_cabal_file)" ''} ${pkgs.lib.optionalString pkgs.stdenv.targetPlatform.isWindows '' - exposed_modules+=" $(jq -r '.library."exposed-modules"[]|select(type=="object" and .if.os == "windows")|.then[]' $json_cabal_file)" + exposed_modules+=" $(jq -r '.library."exposed-modules"//[]|.[]|select(type=="object" and .if.os == "windows")|.then[]' $json_cabal_file)" ''} ${pkgs.lib.optionalString (!pkgs.stdenv.targetPlatform.isWindows) '' - exposed_modules+=" $(jq -r '.library."exposed-modules"[]|select(type=="object" and .if.not.os == "windows")|.then[]' $json_cabal_file)" + exposed_modules+=" $(jq -r '.library."exposed-modules"//[]|.[]|select(type=="object" and .if.not.os == "windows")|.then[]' $json_cabal_file)" ''} EXPOSED_MODULES_${varname name}="$(tr '\n' ' ' <<< "$exposed_modules $reexported_modules")" diff --git a/overlays/bootstrap.nix b/overlays/bootstrap.nix index 1f3827ccd8..73628c024c 100644 --- a/overlays/bootstrap.nix +++ b/overlays/bootstrap.nix @@ -9,9 +9,10 @@ let "9.6" = "9.6.6"; "9.8" = "9.8.4"; "9.10" = "9.10.1"; + "9.12" = "9.12.1"; }; gitInputs = { - ghc912X = "9.12.0"; + ghc912X = "9.12.1"; ghc913 = "9.13"; }; versionToNixName = v: "ghc${builtins.replaceStrings ["."] [""] v}"; @@ -911,6 +912,38 @@ in { ghc-patches = ghc-patches "9.10.1"; }); + ghc9121 = traceWarnOld "9.12" (final.callPackage ../compiler/ghc { + extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc9121; }; + + bootPkgs = bootPkgsGhc94 // { + ghc = if final.stdenv.buildPlatform != final.stdenv.targetPlatform + then final.buildPackages.buildPackages.haskell-nix.compiler.ghc9121 + else final.buildPackages.buildPackages.haskell.compiler.ghc9121 + or final.buildPackages.buildPackages.haskell.compiler.ghc9101 + or final.buildPackages.buildPackages.haskell.compiler.ghc984 + or final.buildPackages.buildPackages.haskell.compiler.ghc983 + or final.buildPackages.buildPackages.haskell.compiler.ghc982 + or final.buildPackages.buildPackages.haskell.compiler.ghc981 + or final.buildPackages.buildPackages.haskell.compiler.ghc966 + 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_15; + llvmPackages = final.llvmPackages_15; + + src-spec.file = final.haskell-nix.sources.ghc9121; + src-spec.version = "9.12.1"; + src-spec.needsBooting = true; + + ghc-patches = ghc-patches "9.12.1"; + }); } // (__listToAttrs (final.lib.mapAttrsToList (source-name: ver: let src = final.haskell-nix.sources.${source-name}; @@ -924,8 +957,10 @@ in { bootPkgs = bootPkgsGhc94 // { ghc = if final.stdenv.buildPlatform != final.stdenv.targetPlatform - then final.buildPackages.buildPackages.haskell-nix.compiler.ghc9101 # TODO use ${compiler-nix-name} - else final.buildPackages.buildPackages.haskell.compiler.ghc984 + then final.buildPackages.buildPackages.haskell-nix.compiler.ghc9121 + else final.buildPackages.buildPackages.haskell.compiler.ghc9121 + or final.buildPackages.buildPackages.haskell.compiler.ghc9101 + or final.buildPackages.buildPackages.haskell.compiler.ghc984 or final.buildPackages.buildPackages.haskell.compiler.ghc983 or final.buildPackages.buildPackages.haskell.compiler.ghc982 or final.buildPackages.buildPackages.haskell.compiler.ghc981 diff --git a/test/cabal.project.local b/test/cabal.project.local index 7d32b6d983..139f84d654 100644 --- a/test/cabal.project.local +++ b/test/cabal.project.local @@ -1,25 +1,20 @@ -if impl(ghc>=9.10.1) +if impl(ghc>=9.12.1) -- allow newer packages, that are bound to be newer due to -- being shipped with a newer compiler. If you extend this -- be very careful to only extend it for absolutely necessary packages -- otherwise we risk running into broken build-plans down the line. - allow-newer: *:base, *:template-haskell, *:bytestring, *:text, *:ghc-prim, *:deepseq, *:Cabal + allow-newer: *:base, *:template-haskell, *:ghc-prim -if impl(ghc > 9.11) - allow-newer: *:containers, *:time +if impl(ghc > 9.13) + allow-newer: *:containers, *:time, *:ghc-bignum constraints: base-compat >=0.14.0, aeson >=2.2.1.0 -- From https://ghc.gitlab.haskell.org/head.hackage/cabal.constraints constraints: extra ==1.7.14 - -if impl(ghc >9.13) constraints: base-orphans <0.9.3 || >0.9.3 -- This prevents hsc2hs from causing old versions of packages from being added to plan.json allow-newer: hsc2hs:* -if impl(ghc >=9.10.1) - extra-packages: process - repository head.hackage.ghc.haskell.org url: https://ghc.gitlab.haskell.org/head.hackage/ secure: True @@ -28,7 +23,7 @@ repository head.hackage.ghc.haskell.org f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89 26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329 7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d - --sha256: sha256-EQKpiiwoIXiM7r+bGYvQzB4vWANqO6PJaSUlt1NUIeI= + --sha256: sha256-RQS0PUBA6nAD1T0OSVFhcF7ldh+6L+cW+k96Hgo3z5s= repository ghcjs-overlay url: https://raw.githubusercontent.com/input-output-hk/hackage-overlay-ghcjs/ffb32dce467b9a4d27be759fdd2740a6edd09d0b @@ -41,14 +36,14 @@ if os(ghcjs) extra-packages: ghci constraints: ghci installed -if !impl(ghc>=9.11) && !os(ghcjs) +if !impl(ghc>=9.13) && !os(ghcjs) active-repositories: hackage.haskell.org -if impl(ghc>=9.11) && !os(ghcjs) +if impl(ghc>=9.13) && !os(ghcjs) active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org -if !impl(ghc>=9.11) && os(ghcjs) +if !impl(ghc>=9.13) && os(ghcjs) active-repositories: hackage.haskell.org, ghcjs-overlay:override -if impl(ghc>=9.11) && os(ghcjs) +if impl(ghc>=9.13) && os(ghcjs) active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org, ghcjs-overlay:override diff --git a/test/gi-gtk/default.nix b/test/gi-gtk/default.nix index c8ef2232a9..7365e1ae7f 100644 --- a/test/gi-gtk/default.nix +++ b/test/gi-gtk/default.nix @@ -8,12 +8,8 @@ let inherit compiler-nix-name evalPackages; src = testSrc "gi-gtk"; cabalProjectLocal = builtins.readFile ../cabal.project.local + '' - -- haskell-gi 0.26.12 breaks gi-gtkpixbuf - index-state: 2024-09-30T00:00:00Z -- The overloading feature of haskell-gi makes build times very long constraints: haskell-gi-overloading ==0.0 - if impl(ghc >=9.11) - constraints: filepath source ''; }; @@ -29,9 +25,7 @@ in recurseIntoAttrs rec { # error: incompatible pointer to integer conversion assigning to 'ffi_arg' (aka 'unsigned long') from 'HsPtr' (aka 'void *') [-Wint-conversion] || builtins.elem compiler-nix-name ["ghc8107" "ghc902" "ghc928" "ghc948"] && stdenv.hostPlatform.isAarch64 # Cross compilation to aarch64 is also broken - || stdenv.hostPlatform.isAarch64 && !stdenv.buildPlatform.isAarch64 - # Building profiled version of Cabal for haskell-gi is currently broken for GHC head - || compiler-nix-name == "ghc91320241204"; + || stdenv.hostPlatform.isAarch64 && !stdenv.buildPlatform.isAarch64; ifdInputs = { inherit (project) plan-nix; diff --git a/test/plugin/default.nix b/test/plugin/default.nix index c2fdf16989..a20d95964c 100644 --- a/test/plugin/default.nix +++ b/test/plugin/default.nix @@ -20,7 +20,7 @@ in recurseIntoAttrs { # Not sure why this breaks for ghc 8.10.7 meta.disabled = compiler-nix-name == "ghc8107" - || builtins.elem compiler-nix-name [ "ghc912020241128" "ghc91320241204" ] + || builtins.elem compiler-nix-name [ "ghc9121" "ghc912120241215" "ghc91320241230" ] || stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isGhcjs || stdenv.hostPlatform.isWindows diff --git a/test/th-dlls/default.nix b/test/th-dlls/default.nix index 9e2ac540ae..e2d7bc93d1 100644 --- a/test/th-dlls/default.nix +++ b/test/th-dlls/default.nix @@ -22,18 +22,10 @@ in recurseIntoAttrs { meta.disabled = stdenv.hostPlatform.isGhcjs # On aarch64 this test also breaks form musl builds (including cross compiles on x86_64-linux) || (stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isMusl) - # On for aarch64 cross compile on GHC 9.8.4 this test is fails sometimes for non profiled builds - # (and always for the profiled builds). - # This may be related to the memory allocation changes made in 9.8.4 that - # replace the pool allocator patches we used in earlier versions. - || (compiler-nix-name == "ghc984" && stdenv.buildPlatform.isx86_64 && stdenv.hostPlatform.isAarch64) # Failed to lookup symbol: __aarch64_swp8_acq_rel || (builtins.elem compiler-nix-name ["ghc947" "ghc948"] && haskellLib.isCrossHost && stdenv.hostPlatform.isAarch64) # We have been unable to get windows cross compilation of th-orphans to work for GHC 8.10 using the latest nixpkgs || (compiler-nix-name == "ghc8107" && stdenv.hostPlatform.isWindows) - # We need to update GHC HEAD to get a version of ghc-internal compatible - # with th-lift from head.hackage. - || builtins.elem compiler-nix-name [ "ghc91320241204" ] ; ifdInputs = { @@ -41,9 +33,18 @@ in recurseIntoAttrs { }; build = packages.th-dlls.components.library; - build-profiled = packages.th-dlls.components.library.profiled; just-template-haskell = packages.th-dlls.components.exes.just-template-haskell; build-ei = packages-ei.th-dlls.components.library; - build-profiled-ei = packages-ei.th-dlls.components.library.profiled; just-template-haskell-ei = packages-ei.th-dlls.components.exes.just-template-haskell; +} // optionalAttrs + (!(builtins.elem compiler-nix-name ["ghc984" "ghc9121" "ghc912120241215"] && stdenv.buildPlatform.isx86_64 && stdenv.hostPlatform.isAarch64)) { + # On for aarch64 cross compile on GHC this test is fails sometimes for non profiled builds + # (and always for the profiled builds). + # This may be related to the memory allocation changes made in 9.8.4 that + # replace the pool allocator patches we used in earlier versions. + + # Interestingly GHC 9.10.1 and HEAD are wotking while 9.8.4 and 9.12 seem break. + # Perhaps there is a fix in GHC HEAD? + build-profiled = packages.th-dlls.components.library.profiled; + build-profiled-ei = packages-ei.th-dlls.components.library.profiled; }