Skip to content

Commit 9261dd9

Browse files
authored
Add GHC 9.12.1 (#2302)
1 parent c8f91dd commit 9261dd9

File tree

13 files changed

+118
-49
lines changed

13 files changed

+118
-49
lines changed

build.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ in rec {
2828
pkgs.recurseIntoAttrs ({
2929
cabal-latest = tool compiler-nix-name "cabal" ({
3030
inherit evalPackages;
31-
} // pkgs.lib.optionalAttrs (ghcFromTo "9.12" "9.13") {
31+
} // pkgs.lib.optionalAttrs (ghcFromTo "9.13" "9.14") {
3232
cabalProjectLocal = builtins.readFile ./test/cabal.project.local;
3333
});
3434
} // pkgs.lib.optionalAttrs (__compareVersions haskell.compiler.${compiler-nix-name}.version "9.8" < 0) {

ci.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
ghc98llvm = false;
7474
ghc910 = true;
7575
ghc910llvm = true;
76+
ghc9121 = true;
7677
ghc912X = true;
7778
ghc913 = true;
7879
})));

lazy-inputs/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ in {
3434
inherit ((callFlake { pkgs = final; src = ./ghc983; }).defaultNix) ghc983;
3535
inherit ((callFlake { pkgs = final; src = ./ghc984; }).defaultNix) ghc984;
3636
inherit ((callFlake { pkgs = final; src = ./ghc9101; }).defaultNix) ghc9101;
37+
inherit ((callFlake { pkgs = final; src = ./ghc9121; }).defaultNix) ghc9121;
3738
inherit ((callFlake { pkgs = final; src = ./ghc912X; }).defaultNix) ghc912X;
3839
inherit ((callFlake { pkgs = final; src = ./ghc913; }).defaultNix) ghc913;
3940
} // prev.haskell-nix.sources;

lazy-inputs/ghc9121/flake.lock

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

lazy-inputs/ghc9121/flake.nix

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
description = "Lazy Input for Haskell.nix";
3+
4+
inputs = {
5+
ghc9121 = {
6+
flake = false;
7+
url = "git+https://github.com/stable-haskell/ghc?ref=ghc-9.12.1-iog&submodules=1";
8+
};
9+
};
10+
11+
outputs = inputs: inputs;
12+
}

lazy-inputs/ghc912X/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.

lazy-inputs/ghc913/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.

lib/call-cabal-project-to-nix.nix

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -511,18 +511,18 @@ let
511511
json_cabal_file=$(mktemp)
512512
cabal2json $fixed_cabal_file > $json_cabal_file
513513
514-
exposed_modules="$(jq -r '.library."exposed-modules"[]|select(type=="array")[]' $json_cabal_file)"
515-
reexported_modules="$(jq -r '.library."reexported-modules"//[]|.[]|select(type=="array")[]' $json_cabal_file)"
514+
exposed_modules="$(jq -r '.library."exposed-modules"//[]|.[]|select(type=="array")[]' $json_cabal_file)"
515+
reexported_modules="$(jq -r '.library."reexported-modules"//[]|.[]|select(type=="array")[]' $json_cabal_file | sed 's/.* as //g')"
516516
517517
# FIXME This is a bandaid. Rather than doing this, conditionals should be interpreted.
518518
${pkgs.lib.optionalString pkgs.stdenv.targetPlatform.isGhcjs ''
519-
exposed_modules+=" $(jq -r '.library."exposed-modules"[]|select(type=="object" and .if.arch == "javascript")|.then[]' $json_cabal_file)"
519+
exposed_modules+=" $(jq -r '.library."exposed-modules"//[]|.[]|select(type=="object" and .if.arch == "javascript")|.then[]' $json_cabal_file)"
520520
''}
521521
${pkgs.lib.optionalString pkgs.stdenv.targetPlatform.isWindows ''
522-
exposed_modules+=" $(jq -r '.library."exposed-modules"[]|select(type=="object" and .if.os == "windows")|.then[]' $json_cabal_file)"
522+
exposed_modules+=" $(jq -r '.library."exposed-modules"//[]|.[]|select(type=="object" and .if.os == "windows")|.then[]' $json_cabal_file)"
523523
''}
524524
${pkgs.lib.optionalString (!pkgs.stdenv.targetPlatform.isWindows) ''
525-
exposed_modules+=" $(jq -r '.library."exposed-modules"[]|select(type=="object" and .if.not.os == "windows")|.then[]' $json_cabal_file)"
525+
exposed_modules+=" $(jq -r '.library."exposed-modules"//[]|.[]|select(type=="object" and .if.not.os == "windows")|.then[]' $json_cabal_file)"
526526
''}
527527
528528
EXPOSED_MODULES_${varname name}="$(tr '\n' ' ' <<< "$exposed_modules $reexported_modules")"

overlays/bootstrap.nix

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ let
99
"9.6" = "9.6.6";
1010
"9.8" = "9.8.4";
1111
"9.10" = "9.10.1";
12+
"9.12" = "9.12.1";
1213
};
1314
gitInputs = {
14-
ghc912X = "9.12.0";
15+
ghc912X = "9.12.1";
1516
ghc913 = "9.13";
1617
};
1718
versionToNixName = v: "ghc${builtins.replaceStrings ["."] [""] v}";
@@ -911,6 +912,38 @@ in {
911912

912913
ghc-patches = ghc-patches "9.10.1";
913914
});
915+
ghc9121 = traceWarnOld "9.12" (final.callPackage ../compiler/ghc {
916+
extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc9121; };
917+
918+
bootPkgs = bootPkgsGhc94 // {
919+
ghc = if final.stdenv.buildPlatform != final.stdenv.targetPlatform
920+
then final.buildPackages.buildPackages.haskell-nix.compiler.ghc9121
921+
else final.buildPackages.buildPackages.haskell.compiler.ghc9121
922+
or final.buildPackages.buildPackages.haskell.compiler.ghc9101
923+
or final.buildPackages.buildPackages.haskell.compiler.ghc984
924+
or final.buildPackages.buildPackages.haskell.compiler.ghc983
925+
or final.buildPackages.buildPackages.haskell.compiler.ghc982
926+
or final.buildPackages.buildPackages.haskell.compiler.ghc981
927+
or final.buildPackages.buildPackages.haskell.compiler.ghc966
928+
or final.buildPackages.buildPackages.haskell.compiler.ghc965
929+
or final.buildPackages.buildPackages.haskell.compiler.ghc964
930+
or final.buildPackages.buildPackages.haskell.compiler.ghc963
931+
or final.buildPackages.buildPackages.haskell.compiler.ghc962
932+
or final.buildPackages.buildPackages.haskell.compiler.ghc945
933+
or final.buildPackages.buildPackages.haskell.compiler.ghc944
934+
or final.buildPackages.buildPackages.haskell.compiler.ghc943;
935+
};
936+
inherit sphinx;
937+
938+
buildLlvmPackages = final.buildPackages.llvmPackages_15;
939+
llvmPackages = final.llvmPackages_15;
940+
941+
src-spec.file = final.haskell-nix.sources.ghc9121;
942+
src-spec.version = "9.12.1";
943+
src-spec.needsBooting = true;
944+
945+
ghc-patches = ghc-patches "9.12.1";
946+
});
914947
} // (__listToAttrs (final.lib.mapAttrsToList (source-name: ver:
915948
let
916949
src = final.haskell-nix.sources.${source-name};
@@ -924,8 +957,10 @@ in {
924957

925958
bootPkgs = bootPkgsGhc94 // {
926959
ghc = if final.stdenv.buildPlatform != final.stdenv.targetPlatform
927-
then final.buildPackages.buildPackages.haskell-nix.compiler.ghc9101 # TODO use ${compiler-nix-name}
928-
else final.buildPackages.buildPackages.haskell.compiler.ghc984
960+
then final.buildPackages.buildPackages.haskell-nix.compiler.ghc9121
961+
else final.buildPackages.buildPackages.haskell.compiler.ghc9121
962+
or final.buildPackages.buildPackages.haskell.compiler.ghc9101
963+
or final.buildPackages.buildPackages.haskell.compiler.ghc984
929964
or final.buildPackages.buildPackages.haskell.compiler.ghc983
930965
or final.buildPackages.buildPackages.haskell.compiler.ghc982
931966
or final.buildPackages.buildPackages.haskell.compiler.ghc981

test/cabal.project.local

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,20 @@
1-
if impl(ghc>=9.10.1)
1+
if impl(ghc>=9.12.1)
22
-- allow newer packages, that are bound to be newer due to
33
-- being shipped with a newer compiler. If you extend this
44
-- be very careful to only extend it for absolutely necessary packages
55
-- otherwise we risk running into broken build-plans down the line.
6-
allow-newer: *:base, *:template-haskell, *:bytestring, *:text, *:ghc-prim, *:deepseq, *:Cabal
6+
allow-newer: *:base, *:template-haskell, *:ghc-prim
77

8-
if impl(ghc > 9.11)
9-
allow-newer: *:containers, *:time
8+
if impl(ghc > 9.13)
9+
allow-newer: *:containers, *:time, *:ghc-bignum
1010
constraints: base-compat >=0.14.0, aeson >=2.2.1.0
1111
-- From https://ghc.gitlab.haskell.org/head.hackage/cabal.constraints
1212
constraints: extra ==1.7.14
13-
14-
if impl(ghc >9.13)
1513
constraints: base-orphans <0.9.3 || >0.9.3
1614

1715
-- This prevents hsc2hs from causing old versions of packages from being added to plan.json
1816
allow-newer: hsc2hs:*
1917

20-
if impl(ghc >=9.10.1)
21-
extra-packages: process
22-
2318
repository head.hackage.ghc.haskell.org
2419
url: https://ghc.gitlab.haskell.org/head.hackage/
2520
secure: True
@@ -28,7 +23,7 @@ repository head.hackage.ghc.haskell.org
2823
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
2924
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
3025
7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
31-
--sha256: sha256-EQKpiiwoIXiM7r+bGYvQzB4vWANqO6PJaSUlt1NUIeI=
26+
--sha256: sha256-RQS0PUBA6nAD1T0OSVFhcF7ldh+6L+cW+k96Hgo3z5s=
3227

3328
repository ghcjs-overlay
3429
url: https://raw.githubusercontent.com/input-output-hk/hackage-overlay-ghcjs/ffb32dce467b9a4d27be759fdd2740a6edd09d0b
@@ -41,14 +36,14 @@ if os(ghcjs)
4136
extra-packages: ghci
4237
constraints: ghci installed
4338

44-
if !impl(ghc>=9.11) && !os(ghcjs)
39+
if !impl(ghc>=9.13) && !os(ghcjs)
4540
active-repositories: hackage.haskell.org
4641

47-
if impl(ghc>=9.11) && !os(ghcjs)
42+
if impl(ghc>=9.13) && !os(ghcjs)
4843
active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org
4944

50-
if !impl(ghc>=9.11) && os(ghcjs)
45+
if !impl(ghc>=9.13) && os(ghcjs)
5146
active-repositories: hackage.haskell.org, ghcjs-overlay:override
5247

53-
if impl(ghc>=9.11) && os(ghcjs)
48+
if impl(ghc>=9.13) && os(ghcjs)
5449
active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org, ghcjs-overlay:override

test/gi-gtk/default.nix

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,8 @@ let
88
inherit compiler-nix-name evalPackages;
99
src = testSrc "gi-gtk";
1010
cabalProjectLocal = builtins.readFile ../cabal.project.local + ''
11-
-- haskell-gi 0.26.12 breaks gi-gtkpixbuf
12-
index-state: 2024-09-30T00:00:00Z
1311
-- The overloading feature of haskell-gi makes build times very long
1412
constraints: haskell-gi-overloading ==0.0
15-
if impl(ghc >=9.11)
16-
constraints: filepath source
1713
'';
1814
};
1915

@@ -29,9 +25,7 @@ in recurseIntoAttrs rec {
2925
# error: incompatible pointer to integer conversion assigning to 'ffi_arg' (aka 'unsigned long') from 'HsPtr' (aka 'void *') [-Wint-conversion]
3026
|| builtins.elem compiler-nix-name ["ghc8107" "ghc902" "ghc928" "ghc948"] && stdenv.hostPlatform.isAarch64
3127
# Cross compilation to aarch64 is also broken
32-
|| stdenv.hostPlatform.isAarch64 && !stdenv.buildPlatform.isAarch64
33-
# Building profiled version of Cabal for haskell-gi is currently broken for GHC head
34-
|| compiler-nix-name == "ghc91320241204";
28+
|| stdenv.hostPlatform.isAarch64 && !stdenv.buildPlatform.isAarch64;
3529

3630
ifdInputs = {
3731
inherit (project) plan-nix;

test/plugin/default.nix

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

2121
# Not sure why this breaks for ghc 8.10.7
2222
meta.disabled = compiler-nix-name == "ghc8107"
23-
|| builtins.elem compiler-nix-name [ "ghc912020241128" "ghc91320241204" ]
23+
|| builtins.elem compiler-nix-name [ "ghc9121" "ghc912120241215" "ghc91320241230" ]
2424
|| stdenv.hostPlatform.isMusl
2525
|| stdenv.hostPlatform.isGhcjs
2626
|| stdenv.hostPlatform.isWindows

test/th-dlls/default.nix

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,28 +22,29 @@ in recurseIntoAttrs {
2222
meta.disabled = stdenv.hostPlatform.isGhcjs
2323
# On aarch64 this test also breaks form musl builds (including cross compiles on x86_64-linux)
2424
|| (stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isMusl)
25-
# On for aarch64 cross compile on GHC 9.8.4 this test is fails sometimes for non profiled builds
26-
# (and always for the profiled builds).
27-
# This may be related to the memory allocation changes made in 9.8.4 that
28-
# replace the pool allocator patches we used in earlier versions.
29-
|| (compiler-nix-name == "ghc984" && stdenv.buildPlatform.isx86_64 && stdenv.hostPlatform.isAarch64)
3025
# Failed to lookup symbol: __aarch64_swp8_acq_rel
3126
|| (builtins.elem compiler-nix-name ["ghc947" "ghc948"] && haskellLib.isCrossHost && stdenv.hostPlatform.isAarch64)
3227
# We have been unable to get windows cross compilation of th-orphans to work for GHC 8.10 using the latest nixpkgs
3328
|| (compiler-nix-name == "ghc8107" && stdenv.hostPlatform.isWindows)
34-
# We need to update GHC HEAD to get a version of ghc-internal compatible
35-
# with th-lift from head.hackage.
36-
|| builtins.elem compiler-nix-name [ "ghc91320241204" ]
3729
;
3830

3931
ifdInputs = {
4032
inherit (project true) plan-nix;
4133
};
4234

4335
build = packages.th-dlls.components.library;
44-
build-profiled = packages.th-dlls.components.library.profiled;
4536
just-template-haskell = packages.th-dlls.components.exes.just-template-haskell;
4637
build-ei = packages-ei.th-dlls.components.library;
47-
build-profiled-ei = packages-ei.th-dlls.components.library.profiled;
4838
just-template-haskell-ei = packages-ei.th-dlls.components.exes.just-template-haskell;
39+
} // optionalAttrs
40+
(!(builtins.elem compiler-nix-name ["ghc984" "ghc9121" "ghc912120241215"] && stdenv.buildPlatform.isx86_64 && stdenv.hostPlatform.isAarch64)) {
41+
# On for aarch64 cross compile on GHC this test is fails sometimes for non profiled builds
42+
# (and always for the profiled builds).
43+
# This may be related to the memory allocation changes made in 9.8.4 that
44+
# replace the pool allocator patches we used in earlier versions.
45+
46+
# Interestingly GHC 9.10.1 and HEAD are wotking while 9.8.4 and 9.12 seem break.
47+
# Perhaps there is a fix in GHC HEAD?
48+
build-profiled = packages.th-dlls.components.library.profiled;
49+
build-profiled-ei = packages-ei.th-dlls.components.library.profiled;
4950
}

0 commit comments

Comments
 (0)