From 444f6a6c9a714b2ab5615b40c6017450875b489e Mon Sep 17 00:00:00 2001 From: hellwolf Date: Sat, 5 Apr 2025 23:53:36 +0300 Subject: [PATCH 1/3] build haskell-language-server for ghc912 --- .../configuration-ghc-9.12.x.nix | 96 ++++++++++++++++++- 1 file changed, 93 insertions(+), 3 deletions(-) diff --git a/pkgs/development/haskell-modules/configuration-ghc-9.12.x.nix b/pkgs/development/haskell-modules/configuration-ghc-9.12.x.nix index 921a029525ec..5813e29d8ffe 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-9.12.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-9.12.x.nix @@ -77,27 +77,83 @@ with haskellLib; unix = null; xhtml = null; - doctest = self.doctest_0_23_0; - extra = doDistribute self.extra_1_8; # compatible with base 4.21 htree = doDistribute self.htree_0_2_0_0; tagged = doDistribute self.tagged_0_8_9; time-compat = doDistribute (doJailbreak self.time-compat_1_9_8); # too strict lower bound on QuickCheck ghc-syntax-highlighter = doDistribute self.ghc-syntax-highlighter_0_0_13_0; - ghc-lib-parser = doDistribute self.ghc-lib-parser_9_12_1_20250105; ghc-lib = doDistribute self.ghc-lib_9_12_1_20250105; + # A given major version of ghc-exactprint only supports one version of GHC. + ghc-exactprint = doDistribute self.ghc-exactprint_1_12_0_0; + ghc-exactprint_1_12_0_0 = addBuildDepends [ + self.Diff + self.extra + self.ghc-paths + self.silently + self.syb + self.HUnit + ] super.ghc-exactprint_1_12_0_0; + ghc-lib-parser = doDistribute self.ghc-lib-parser_9_12_2_20250320; + ghc-lib-parser-ex = doDistribute self.ghc-lib-parser-ex_9_12_0_0; + hlint = doDistribute self.hlint_3_10; + ormolu = doDistribute super.ormolu_0_8_0_0; + apply-refact = doDistribute super.apply-refact_0_15_0_0; # # Jailbreaks # lucid = doJailbreak super.lucid; # base <4.21 + extensions = doDistribute (doJailbreak self.extensions_0_1_0_3); # hedgehog >=1.0 && <1.5, hspec-hedgehog >=0.0.1 && <0.2 + hie-compat = doJailbreak super.hie-compat; # base <4.21 + hiedb = doJailbreak super.hiedb; # base >=4.12 && <4.21, ghc >=8.6 && <9.11 ed25519 = doJailbreak super.ed25519; # https://github.com/thoughtpolice/hs-ed25519/issues/39 + ghc-trace-events = doJailbreak super.ghc-trace-events; # base <4.21 + cpphs = overrideCabal (drv: { + # jail break manually the conditional dependencies + postPatch = '' + sed -i 's/time >=1.5 \&\& <1.13/time >=1.5 \&\& <=1.14/g' cpphs.cabal + ''; + }) super.cpphs; + vector = doJailbreak super.vector; # doctest >=0.15 && <0.24 + binary-instances = doJailbreak super.binary-instances; # base >=4.6.0.1 && <4.21, tagged >=0.8.8 && <0.8.9 + cabal-install-parsers = doJailbreak super.cabal-install-parsers; # base, Cabal-syntax, etc. http-api-data = doJailbreak super.http-api-data; # base < 4.21 servant = doJailbreak super.servant; # base < 4.21 + co-log-core = doJailbreak super.co-log-core; # doctest >=0.16.0 && <0.24 + # # Test suite issues + # + call-stack = dontCheck super.call-stack; # https://github.com/sol/call-stack/issues/19 + relude = dontCheck super.relude; + + doctest = doDistribute ( + overrideCabal (drv: { + testFlags = drv.testFlags or [ ] ++ [ + # These tests require cabal-install (would cause infinite recursion) + "--skip=/Cabal.Options" + "--skip=/Cabal.Paths/paths" + "--skip=/Cabal.ReplOptions" # >= 0.23 + ]; + }) self.doctest_0_24_0 + ); + + # https://github.com/typeable/generic-arbitrary/issues/18 + generic-arbitrary = overrideCabal (drv: { + patches = drv.patches or [ ] ++ [ + (pkgs.fetchpatch { + name = "hellwolf:fix-recursive-test-hidding-unit"; + url = "https://github.com/typeable/generic-arbitrary/commit/133b80be93e6744f21e0e5ed4180a24c589f92e4.patch"; + sha256 = "sha256-z9EVcD1uNAYUOVTwmCCnrEFFOvFB7lD94Y6BwGVwVRQ="; + }) + ]; + }) super.generic-arbitrary; + + # Unreported: GHC crashes + generic-lens = dontCheck super.generic-lens; + # Cabal 3.14 regression (incorrect datadir in tests): https://github.com/haskell/cabal/issues/10717 alex = overrideCabal (drv: { preCheck = @@ -109,4 +165,38 @@ with haskellLib; # https://github.com/sjakobi/newtype-generics/pull/28/files newtype-generics = warnAfterVersion "0.6.2" (doJailbreak super.newtype-generics); + + # + # Things having lots of issues + # + + fourmolu = doDistribute ( + dontCheck ( + super.fourmolu_0_18_0_0.override { + # Diff >=1 && <2 + Diff = super.Diff_1_0_2; + } + ) + ); + + doctest-parallel = overrideCabal (drv: { + patches = drv.patches or [ ] ++ [ + (pkgs.fetchpatch { + name = "doctest-0.23.0-ghc-9.12.patch"; + url = "https://github.com/martijnbastiaan/doctest-parallel/commit/d3df7aa5d223f3daeb676c8a7efe093ee743d54f.patch"; + sha256 = "sha256-92CtqBCulfOTjLAeC205cIrqL/2CBP1YFLijTVcTD2M="; + includes = [ "src/Test/DocTest/Helpers.hs" ]; + }) + ]; + }) (dontCheck (doJailbreak super.doctest-parallel)); # Cabal >=2.4 && <3.13 + + haskell-language-server = disableCabalFlag "retrie" ( + disableCabalFlag "stylishhaskel" ( + super.haskell-language-server.override { + stylish-haskell = null; + floskell = null; + retrie = null; + } + ) + ); } From bddfe206bae60814a729a73b5ef1bd0f26a6a4ac Mon Sep 17 00:00:00 2001 From: hellwolf Date: Sun, 6 Apr 2025 00:28:18 +0300 Subject: [PATCH 2/3] reported GHC bug wrt generic-lens package --- pkgs/development/haskell-modules/configuration-ghc-9.12.x.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/haskell-modules/configuration-ghc-9.12.x.nix b/pkgs/development/haskell-modules/configuration-ghc-9.12.x.nix index 5813e29d8ffe..322dc986af9a 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-9.12.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-9.12.x.nix @@ -151,7 +151,7 @@ with haskellLib; ]; }) super.generic-arbitrary; - # Unreported: GHC crashes + # https://gitlab.haskell.org/ghc/ghc/-/issues/25930 generic-lens = dontCheck super.generic-lens; # Cabal 3.14 regression (incorrect datadir in tests): https://github.com/haskell/cabal/issues/10717 From 6eb682b16c77b9e0e98fe793b59564b72baf3d18 Mon Sep 17 00:00:00 2001 From: hellwolf Date: Sun, 6 Apr 2025 10:31:59 +0300 Subject: [PATCH 3/3] organize the ghc912 configuration a little bit --- .../configuration-ghc-9.12.x.nix | 69 ++++++++++--------- 1 file changed, 37 insertions(+), 32 deletions(-) diff --git a/pkgs/development/haskell-modules/configuration-ghc-9.12.x.nix b/pkgs/development/haskell-modules/configuration-ghc-9.12.x.nix index 322dc986af9a..a0187861a748 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-9.12.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-9.12.x.nix @@ -77,37 +77,37 @@ with haskellLib; unix = null; xhtml = null; - extra = doDistribute self.extra_1_8; # compatible with base 4.21 + # + # Hand pick versions that are compatible with ghc 9.12 and base 4.21 + # + + extra = doDistribute self.extra_1_8; htree = doDistribute self.htree_0_2_0_0; tagged = doDistribute self.tagged_0_8_9; - time-compat = doDistribute (doJailbreak self.time-compat_1_9_8); # too strict lower bound on QuickCheck + time-compat = doDistribute self.time-compat_1_9_8; + extensions = doDistribute self.extensions_0_1_0_3; + doctest = doDistribute self.doctest_0_24_0; ghc-syntax-highlighter = doDistribute self.ghc-syntax-highlighter_0_0_13_0; ghc-lib = doDistribute self.ghc-lib_9_12_1_20250105; - # A given major version of ghc-exactprint only supports one version of GHC. ghc-exactprint = doDistribute self.ghc-exactprint_1_12_0_0; - ghc-exactprint_1_12_0_0 = addBuildDepends [ - self.Diff - self.extra - self.ghc-paths - self.silently - self.syb - self.HUnit - ] super.ghc-exactprint_1_12_0_0; ghc-lib-parser = doDistribute self.ghc-lib-parser_9_12_2_20250320; ghc-lib-parser-ex = doDistribute self.ghc-lib-parser-ex_9_12_0_0; hlint = doDistribute self.hlint_3_10; - ormolu = doDistribute super.ormolu_0_8_0_0; - apply-refact = doDistribute super.apply-refact_0_15_0_0; + fourmolu = doDistribute self.fourmolu_0_18_0_0; + ormolu = doDistribute self.ormolu_0_8_0_0; + apply-refact = doDistribute self.apply-refact_0_15_0_0; # # Jailbreaks # + lucid = doJailbreak super.lucid; # base <4.21 - extensions = doDistribute (doJailbreak self.extensions_0_1_0_3); # hedgehog >=1.0 && <1.5, hspec-hedgehog >=0.0.1 && <0.2 + extensions_0_1_0_3 = doJailbreak super.extensions_0_1_0_3; # hedgehog >=1.0 && <1.5, hspec-hedgehog >=0.0.1 && <0.2 hie-compat = doJailbreak super.hie-compat; # base <4.21 hiedb = doJailbreak super.hiedb; # base >=4.12 && <4.21, ghc >=8.6 && <9.11 ed25519 = doJailbreak super.ed25519; # https://github.com/thoughtpolice/hs-ed25519/issues/39 ghc-trace-events = doJailbreak super.ghc-trace-events; # base <4.21 + time-compat_1_9_8 = doJailbreak super.time-compat_1_9_8; # too strict lower bound on QuickCheck cpphs = overrideCabal (drv: { # jail break manually the conditional dependencies postPatch = '' @@ -119,6 +119,15 @@ with haskellLib; cabal-install-parsers = doJailbreak super.cabal-install-parsers; # base, Cabal-syntax, etc. http-api-data = doJailbreak super.http-api-data; # base < 4.21 servant = doJailbreak super.servant; # base < 4.21 + ghc-exactprint_1_12_0_0 = addBuildDepends [ + # somehow buildDepends was missing + self.Diff + self.extra + self.ghc-paths + self.silently + self.syb + self.HUnit + ] super.ghc-exactprint_1_12_0_0; co-log-core = doJailbreak super.co-log-core; # doctest >=0.16.0 && <0.24 # @@ -129,16 +138,14 @@ with haskellLib; relude = dontCheck super.relude; - doctest = doDistribute ( - overrideCabal (drv: { - testFlags = drv.testFlags or [ ] ++ [ - # These tests require cabal-install (would cause infinite recursion) - "--skip=/Cabal.Options" - "--skip=/Cabal.Paths/paths" - "--skip=/Cabal.ReplOptions" # >= 0.23 - ]; - }) self.doctest_0_24_0 - ); + doctest_0_24_0 = overrideCabal (drv: { + testFlags = drv.testFlags or [ ] ++ [ + # These tests require cabal-install (would cause infinite recursion) + "--skip=/Cabal.Options" + "--skip=/Cabal.Paths/paths" + "--skip=/Cabal.ReplOptions" # >= 0.23 + ]; + }) super.doctest_0_24_0; # https://github.com/typeable/generic-arbitrary/issues/18 generic-arbitrary = overrideCabal (drv: { @@ -167,16 +174,14 @@ with haskellLib; newtype-generics = warnAfterVersion "0.6.2" (doJailbreak super.newtype-generics); # - # Things having lots of issues + # Multiple issues # - fourmolu = doDistribute ( - dontCheck ( - super.fourmolu_0_18_0_0.override { - # Diff >=1 && <2 - Diff = super.Diff_1_0_2; - } - ) + fourmolu_0_18_0_0 = dontCheck ( + super.fourmolu_0_18_0_0.override { + # Diff >=1 && <2 + Diff = super.Diff_1_0_2; + } ); doctest-parallel = overrideCabal (drv: {