Skip to content

Add support for GHC 9.12#2941

Open
martijnbastiaan wants to merge 7 commits intomasterfrom
add-ghc912
Open

Add support for GHC 9.12#2941
martijnbastiaan wants to merge 7 commits intomasterfrom
add-ghc912

Conversation

@martijnbastiaan
Copy link
Copy Markdown
Member

@martijnbastiaan martijnbastiaan commented Apr 19, 2025

Closes #2930

Still TODO:

@DigitalBrains1
Copy link
Copy Markdown
Member

Could you add 9.12 to the README in the GHC compatibility section as part of this PR?

@martijnbastiaan martijnbastiaan force-pushed the add-ghc912 branch 2 times, most recently from 141df71 to 6958d7e Compare April 27, 2025 18:30
@martijnbastiaan martijnbastiaan force-pushed the add-ghc912 branch 5 times, most recently from b405087 to 068d553 Compare September 28, 2025 13:34
@martijnbastiaan martijnbastiaan mentioned this pull request Nov 6, 2025
@christiaanb christiaanb force-pushed the add-ghc912 branch 2 times, most recently from 5dc8c10 to c6c19b6 Compare February 8, 2026 21:24
@martijnbastiaan martijnbastiaan force-pushed the add-ghc912 branch 3 times, most recently from 6a3c8d8 to 70aa037 Compare March 31, 2026 18:12
@kleinreact
Copy link
Copy Markdown
Member

kleinreact commented Apr 2, 2026

nix develop .#ghc9124 works for me using

$ nix flake update nixpkgs
$ cp nix/overlay-ghc910.nix nix/overlay-ghc912.nix
$ git add nix/overlay-ghc912.nix

with

--- a/flake.nix
+++ b/flake.nix
@@ -36,7 +36,7 @@
       # The versions of GHC that we want to be able to build / develop against
       # within the nix environment. Since nix is lazy, only derivations for
       # versions of GHC which are used are actually evaluated.
-      ghcVersions = [ "ghc967" "ghc984" "ghc9103" ];
+      ghcVersions = [ "ghc967" "ghc984" "ghc9103" "ghc9124" ];

       # We pick a single version of GHC to use by default within nix. This is
       # probably cleaner than always having N copies of each package / app and
--- a/nix/devshell.nix
+++ b/nix/devshell.nix
@@ -21,7 +21,7 @@ pkgs.mkShell {

   buildInputs = [
     clashPkgs.cabal-install
-    clashPkgs.haskell-language-server
+    #clashPkgs.haskell-language-server

     # https://discourse.nixos.org/t/non-interactive-bash-errors-from-flake-nix-mkshell/33310
     pkgs.bashInteractive
--- a/nix/overlay-ghc912.nix
+++ b/nix/overlay-ghc912.nix
@@ -11,6 +11,15 @@ in
   # brick 0.70.1 requires vty < 6.0.
   vty = doJailbreak (prev.callHackage "vty" "5.39" { });

+  # the selected defaults do not build with GHC 9.12.4
+  th-desugar = doJailbreak (prev.callHackage "th-desugar" "1.19" { });
+  singletons-th = doJailbreak (prev.callHackage "singletons-th" "3.5.1" { });
+  singletons-base = dontCheck (doJailbreak (prev.callHackage "singletons-base" "3.5" { }));
+  singletons-base-code-generator = markUnbroken prev.singletons-base-code-generator;
+  cabal-add = dontCheck prev.cabal-add;
+  statistics = dontCheck prev.statistics;
+  fourmolu = dontCheck prev.fourmolu;
+
   # Marked as broken in nixpkgs, since it specifies much older dependencies
   # than the defaults in nixpkgs.
   rewrite-inspector = doJailbreak (markUnbroken prev.rewrite-inspector);

Where I had to disable HLS, because one of it's dependencies ghcide runs into a GHC panic with 9.12.4. I would recommend to remove HLS from the default anyway, as it is not used by everyone and it can be still added as an extension like we do in clash-cores.

I recommend to add these changes as part of this PR as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GHC 9.12 support

4 participants