From 40ce16ef93a43931d7e48a36b8cdf8d69f302f5e Mon Sep 17 00:00:00 2001 From: maralorn Date: Sun, 22 Oct 2023 01:23:30 +0200 Subject: [PATCH] haskell-language-server: Fix for all supported GHCs --- .../haskell-modules/configuration-common.nix | 27 +-- .../configuration-ghc-9.0.x.nix | 11 +- .../configuration-ghc-9.2.x.nix | 5 +- .../configuration-ghc-9.4.x.nix | 31 ++- .../configuration-ghc-9.6.x.nix | 12 +- .../configuration-hackage2nix/main.yaml | 12 +- .../transitive-broken.yaml | 2 + .../haskell-modules/hackage-packages.nix | 206 +----------------- 8 files changed, 49 insertions(+), 257 deletions(-) diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index 151bfa8f9332..61c2e51b7939 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -96,11 +96,7 @@ self: super: { ### HASKELL-LANGUAGE-SERVER SECTION ### ####################################### - inherit (let - hls_overlay = lself: lsuper: { - ghc-lib-parser = lself.ghc-lib-parser_9_6_2_20230523; - ghc-lib-parser-ex = doDistribute lself.ghc-lib-parser-ex_9_6_0_2; - Cabal-syntax = lself.Cabal-syntax_3_10_1_0; + haskell-language-server = dontCheck (super.haskell-language-server.overrideScope (lself: lsuper: { # For most ghc versions, we overrideScope Cabal in the configuration-ghc-???.nix, # because some packages, like ormolu, need a newer Cabal version. # ghc-paths is special because it depends on Cabal for building @@ -111,26 +107,7 @@ self: super: { # otherwise we have different versions of ghc-paths # around which have the same abi-hash, which can lead to confusions and conflicts. ghc-paths = lsuper.ghc-paths.override { Cabal = null; }; - }; - in lib.mapAttrs (_: pkg: doDistribute (pkg.overrideScope hls_overlay)) { - haskell-language-server = allowInconsistentDependencies (dontCheck super.haskell-language-server); - # Tests fail due to the newly-build fourmolu not being in PATH - # https://github.com/fourmolu/fourmolu/issues/231 - fourmolu = dontCheck super.fourmolu_0_14_0_0; - ormolu = super.ormolu_0_7_2_0; - hlint = super.hlint_3_6_1; - stylish-haskell = super.stylish-haskell_0_14_5_0; - }) - haskell-language-server - # HLS from 2.3 needs at least formolu 0.14. - # This means we need to bump a lot of other tools, too, because they all us ghc-lib-parser - # We do this globally to prevent inconsistent formatting or lints between hls and the command line tools. - fourmolu - ormolu - hlint - stylish-haskell; - - fourmolu_0_13_1_0 = dontCheck super.fourmolu_0_13_1_0; + })); # hasn't bumped upper bounds # test fails: "floskell-test: styles/base.md: openBinaryFile: does not exist (No such file or directory)" diff --git a/pkgs/development/haskell-modules/configuration-ghc-9.0.x.nix b/pkgs/development/haskell-modules/configuration-ghc-9.0.x.nix index 7c2d3828866d..453526274094 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-9.0.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-9.0.x.nix @@ -76,9 +76,7 @@ self: super: { Cabal-syntax = self.Cabal-syntax_3_8_1_0; }; - fourmolu = self.fourmolu_0_10_1_0.override { - Cabal-syntax = self.Cabal-syntax_3_8_1_0; - }; + stylish-haskell = doJailbreak super.stylish-haskell_0_14_4_0; doctest = dontCheck super.doctest; # Apply patches from head.hackage. @@ -91,16 +89,15 @@ self: super: { # These aren't included in hackage-packages.nix because hackage2nix is configured for GHC 9.2, under which these plugins aren't supported. # See https://github.com/NixOS/nixpkgs/pull/205902 for why we use `self..scope` additionalDeps = with self.haskell-language-server.scope; [ - hls-haddock-comments-plugin (unmarkBroken hls-splice-plugin) - hls-tactics-plugin ]; - in addBuildDepends additionalDeps (super.haskell-language-server.overrideScope (lself: lsuper: { + in addBuildDepends additionalDeps (disableCabalFlag "fourmolu" (super.haskell-language-server.overrideScope (lself: lsuper: { # Needed for modern ormolu and fourmolu. # Apply this here and not in common, because other ghc versions offer different Cabal versions. Cabal = lself.Cabal_3_6_3_0; hls-overloaded-record-dot-plugin = null; - })); + hls-fourmolu-plugin = null; + }))); # Needs to use ghc-lib due to incompatible GHC ghc-tags = doDistribute (addBuildDepend self.ghc-lib self.ghc-tags_1_5); diff --git a/pkgs/development/haskell-modules/configuration-ghc-9.2.x.nix b/pkgs/development/haskell-modules/configuration-ghc-9.2.x.nix index 29e7aab2491a..0c1bf8518ea4 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-9.2.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-9.2.x.nix @@ -71,10 +71,9 @@ self: super: { Cabal-syntax = self.Cabal-syntax_3_8_1_0; }; - fourmolu = self.fourmolu_0_10_1_0.override { - Cabal-syntax = self.Cabal-syntax_3_8_1_0; - }; + stylish-haskell = doJailbreak super.stylish-haskell_0_14_4_0; + haskell-language-server = disableCabalFlag "fourmolu" (super.haskell-language-server.override { hls-fourmolu-plugin = null; }); # For GHC < 9.4, some packages need data-array-byte as an extra dependency hashable = addBuildDepends [ self.data-array-byte ] super.hashable; primitive = addBuildDepends [ self.data-array-byte ] super.primitive; diff --git a/pkgs/development/haskell-modules/configuration-ghc-9.4.x.nix b/pkgs/development/haskell-modules/configuration-ghc-9.4.x.nix index 7b9feb98dcba..691f82c09616 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-9.4.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-9.4.x.nix @@ -111,7 +111,32 @@ in { # https://github.com/kowainik/relude/issues/436 relude = dontCheck super.relude; - fourmolu = overrideCabal (drv: { - libraryHaskellDepends = drv.libraryHaskellDepends ++ [ self.file-embed ]; - }) (disableCabalFlag "fixity-th" super.fourmolu); + inherit + ( + let + hls_overlay = lself: lsuper: { + ghc-lib-parser = lself.ghc-lib-parser_9_6_2_20230523; + ghc-lib-parser-ex = doDistribute lself.ghc-lib-parser-ex_9_6_0_2; + Cabal-syntax = lself.Cabal-syntax_3_10_1_0; + }; + in + lib.mapAttrs (_: pkg: doDistribute (pkg.overrideScope hls_overlay)) { + haskell-language-server = allowInconsistentDependencies super.haskell-language-server; + # Tests fail due to the newly-build fourmolu not being in PATH + # https://github.com/fourmolu/fourmolu/issues/231 + fourmolu = dontCheck super.fourmolu_0_14_0_0; + ormolu = self.generateOptparseApplicativeCompletions [ "ormolu" ] (enableSeparateBinOutput super.ormolu_0_7_2_0); + hlint = super.hlint_3_6_1; + stylish-haskell = super.stylish-haskell; + } + ) + haskell-language-server + # HLS from 2.3 needs at least formolu 0.14. + # This means we need to bump a lot of other tools, too, because they all us ghc-lib-parser + # We do this globally to prevent inconsistent formatting or lints between hls and the command line tools. + fourmolu + ormolu + hlint + stylish-haskell + ; } diff --git a/pkgs/development/haskell-modules/configuration-ghc-9.6.x.nix b/pkgs/development/haskell-modules/configuration-ghc-9.6.x.nix index a23364a73149..f6ba21f37574 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-9.6.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-9.6.x.nix @@ -91,6 +91,12 @@ self: super: { ghc-lib-parser = doDistribute self.ghc-lib-parser_9_6_2_20230523; ghc-lib-parser-ex = doDistribute self.ghc-lib-parser-ex_9_6_0_2; + # Tests fail due to the newly-build fourmolu not being in PATH + # https://github.com/fourmolu/fourmolu/issues/231 + fourmolu = dontCheck super.fourmolu_0_14_0_0; + ormolu = self.generateOptparseApplicativeCompletions [ "ormolu" ] (enableSeparateBinOutput super.ormolu_0_7_2_0); + hlint = super.hlint_3_6_1; + # v0.1.6 forbids base >= 4.18 singleton-bool = doDistribute super.singleton-bool_0_1_7; @@ -166,10 +172,6 @@ self: super: { hls-floskell-plugin = null; }; - fourmolu = super.fourmolu_0_14_0_0; - ormolu = self.generateOptparseApplicativeCompletions [ "ormolu" ] (enableSeparateBinOutput super.ormolu_0_7_2_0); - stylish-haskell = super.stylish-haskell_0_14_5_0; - # Newer version of servant required for GHC 9.6 servant = self.servant_0_20_1; servant-server = self.servant-server_0_20; @@ -205,8 +207,6 @@ self: super: { HUnit Diff data-default extra fail free ghc-paths ordered-containers silently syb ]) super.ghc-exactprint_1_7_0_1); - hlint = super.hlint_3_6_1; - inherit (pkgs.lib.mapAttrs (_: doJailbreak ) super) hls-cabal-plugin algebraic-graphs diff --git a/pkgs/development/haskell-modules/configuration-hackage2nix/main.yaml b/pkgs/development/haskell-modules/configuration-hackage2nix/main.yaml index 0b5c1db73aaa..6836d27ad27a 100644 --- a/pkgs/development/haskell-modules/configuration-hackage2nix/main.yaml +++ b/pkgs/development/haskell-modules/configuration-hackage2nix/main.yaml @@ -47,10 +47,6 @@ default-package-overrides: - implicit-hie < 0.1.3 - hie-bios < 0.13 - # 2023-07-06: newer versions of stylish-haskell require - # ghc-lib-parser-ex >= 9.6, but LTS-21 contains ghc-lib-parser-ex-9.4 - - stylish-haskell < 0.14.5.0 - # 2023-09-17: reflex-dom 0.6.3.0 is broken https://github.com/reflex-frp/reflex-dom/issues/462 - reflex-dom < 0.6.2.0 @@ -124,17 +120,13 @@ extra-packages: - mmorph == 1.1.3 # Newest working version of mmorph on ghc 8.6.5. needed for hls - network == 2.6.3.1 # required by pkgs/games/hedgewars/default.nix, 2020-11-15 - optparse-applicative < 0.16 # needed for niv-0.2.19 - - ormolu == 0.5.0.1 # 2022-02-21: for hls on ghc 8.10 + - fourmolu == 0.11.* # 2023-10-22: for hls on ghc 9.0 - ormolu == 0.5.2.0 # 2023-08-08: for hls on ghc 9.0 and 9.2 - - fourmolu == 0.9.0.0 # 2022-09-21: for hls on ghc 8.10 - - fourmolu == 0.10.1.0 # 2023-04-18: for hls on ghc 9.0 and 9.2 - - fourmolu == 0.13.* # 2023-09-16: latest version compatible with hls 2.2.* on ghc 9.6 - - mod == 0.1.2.2 # needed for hls on ghc 8.10 - pantry == 0.5.2.1 # needed for stack-2.7.3 - path == 0.9.0 # 2021-12-03: path version building with stackage genvalidity and GHC 9.0.2 - resolv < 0.2 # required to build cabal-install-3.10.1.0 with Stackage LTS 21 - sbv == 7.13 # required for pkgs.petrinizer - - stylish-haskell == 0.14.3.0 # 2022-09-19: needed for hls on ghc 8.8 + - stylish-haskell == 0.14.4.0 # 2022-09-19: needed for hls on ghc 9.2 - tasty-hspec == 1.1.6 # 2022-04-07: Needed for elm-format - text == 2.0.2 # 2023-09-14: Needed for elm (which is currently on ghc-8.10) - th-abstraction < 0.6 # 2023-09-11: needed for aeson-2.2.0.0 diff --git a/pkgs/development/haskell-modules/configuration-hackage2nix/transitive-broken.yaml b/pkgs/development/haskell-modules/configuration-hackage2nix/transitive-broken.yaml index de575838a1c8..7a4c99fb2bbb 100644 --- a/pkgs/development/haskell-modules/configuration-hackage2nix/transitive-broken.yaml +++ b/pkgs/development/haskell-modules/configuration-hackage2nix/transitive-broken.yaml @@ -1143,6 +1143,7 @@ dont-distribute-packages: - distributed-process-systest - distributed-process-task - distributed-process-tests + - distributed-process-zookeeper - distributed-static - distribution-plot - dixi @@ -4299,4 +4300,5 @@ dont-distribute-packages: - zoom-cache - zoom-cache-pcm - zoom-cache-sndfile + - zoovisitor - zuramaru diff --git a/pkgs/development/haskell-modules/hackage-packages.nix b/pkgs/development/haskell-modules/hackage-packages.nix index 9915fc8723f7..b2c1d9c34566 100644 --- a/pkgs/development/haskell-modules/hackage-packages.nix +++ b/pkgs/development/haskell-modules/hackage-packages.nix @@ -108937,78 +108937,6 @@ self: { license = lib.licenses.bsd3; }) {}; - "fourmolu_0_9_0_0" = callPackage - ({ mkDerivation, aeson, ansi-terminal, array, base, bytestring - , Cabal, containers, Diff, directory, dlist, exceptions, filepath - , ghc-lib-parser, gitrev, hspec, hspec-discover, hspec-megaparsec - , megaparsec, MemoTrie, mtl, optparse-applicative, path, path-io - , pretty, process, QuickCheck, syb, template-haskell, temporary - , text, th-lift-instances, yaml - }: - mkDerivation { - pname = "fourmolu"; - version = "0.9.0.0"; - sha256 = "0zq9fv5yszm7icirgwj8g4lhg21lg87fhz56sssjnfikzmkwyh1l"; - revision = "1"; - editedCabalFile = "0hbjn9qzbr7a9571isi4i651gdi60qqa40idpfg87qlg2sd61485"; - isLibrary = true; - isExecutable = true; - libraryHaskellDepends = [ - aeson ansi-terminal array base bytestring Cabal containers Diff - directory dlist exceptions filepath ghc-lib-parser megaparsec - MemoTrie mtl syb template-haskell text th-lift-instances yaml - ]; - executableHaskellDepends = [ - base containers directory filepath ghc-lib-parser gitrev - optparse-applicative text yaml - ]; - testHaskellDepends = [ - base containers Diff directory filepath ghc-lib-parser hspec - hspec-megaparsec megaparsec path path-io pretty process QuickCheck - temporary text - ]; - testToolDepends = [ hspec-discover ]; - description = "A formatter for Haskell source code"; - license = lib.licenses.bsd3; - hydraPlatforms = lib.platforms.none; - mainProgram = "fourmolu"; - }) {}; - - "fourmolu_0_10_1_0" = callPackage - ({ mkDerivation, aeson, ansi-terminal, array, base, bytestring - , Cabal-syntax, containers, Diff, directory, dlist, exceptions - , filepath, ghc-lib-parser, gitrev, hspec, hspec-discover - , hspec-megaparsec, megaparsec, MemoTrie, mtl, optparse-applicative - , path, path-io, pretty, process, QuickCheck, syb, template-haskell - , temporary, text, th-lift-instances, yaml - }: - mkDerivation { - pname = "fourmolu"; - version = "0.10.1.0"; - sha256 = "0gkzd2wf8hji5j0pxjv7l43m405zwsvppj7hax69j86346mb8hp4"; - isLibrary = true; - isExecutable = true; - libraryHaskellDepends = [ - aeson ansi-terminal array base bytestring Cabal-syntax containers - Diff directory dlist exceptions filepath ghc-lib-parser megaparsec - MemoTrie mtl syb template-haskell text th-lift-instances yaml - ]; - executableHaskellDepends = [ - base containers directory filepath ghc-lib-parser gitrev - optparse-applicative text yaml - ]; - testHaskellDepends = [ - base containers Diff directory filepath ghc-lib-parser hspec - hspec-megaparsec megaparsec path path-io pretty process QuickCheck - temporary text - ]; - testToolDepends = [ hspec-discover ]; - description = "A formatter for Haskell source code"; - license = lib.licenses.bsd3; - hydraPlatforms = lib.platforms.none; - mainProgram = "fourmolu"; - }) {}; - "fourmolu" = callPackage ({ mkDerivation, aeson, ansi-terminal, array, base, binary , bytestring, Cabal-syntax, containers, Diff, directory, dlist @@ -109045,43 +108973,6 @@ self: { mainProgram = "fourmolu"; }) {}; - "fourmolu_0_13_1_0" = callPackage - ({ mkDerivation, aeson, ansi-terminal, array, base, binary - , bytestring, Cabal-syntax, containers, deepseq, Diff, directory - , file-embed, filepath, ghc-lib-parser, hspec, hspec-discover - , hspec-megaparsec, megaparsec, MemoTrie, mtl, optparse-applicative - , path, path-io, pretty, process, QuickCheck, scientific, syb - , temporary, text, th-env, yaml - }: - mkDerivation { - pname = "fourmolu"; - version = "0.13.1.0"; - sha256 = "05vkqygrmgfgmsd8a4vxq8mq0c1z9cb3hja28aszd6llfv427dm1"; - revision = "1"; - editedCabalFile = "0jqgixycw8cv0q7amx5fs4ml9knql70ghg31br3hjkcy0vb2hi5v"; - isLibrary = true; - isExecutable = true; - libraryHaskellDepends = [ - aeson ansi-terminal array base binary bytestring Cabal-syntax - containers deepseq Diff directory file-embed filepath - ghc-lib-parser megaparsec MemoTrie mtl scientific syb text yaml - ]; - executableHaskellDepends = [ - base Cabal-syntax containers directory filepath ghc-lib-parser - optparse-applicative text th-env yaml - ]; - testHaskellDepends = [ - base bytestring Cabal-syntax containers Diff directory filepath - ghc-lib-parser hspec hspec-megaparsec megaparsec path path-io - pretty process QuickCheck temporary text yaml - ]; - testToolDepends = [ hspec-discover ]; - description = "A formatter for Haskell source code"; - license = lib.licenses.bsd3; - hydraPlatforms = lib.platforms.none; - mainProgram = "fourmolu"; - }) {}; - "fourmolu_0_14_0_0" = callPackage ({ mkDerivation, aeson, ansi-terminal, array, base, binary , bytestring, Cabal-syntax, containers, deepseq, Diff, directory @@ -201361,28 +201252,6 @@ self: { license = lib.licenses.mit; }) {}; - "mod_0_1_2_2" = callPackage - ({ mkDerivation, base, deepseq, integer-gmp, primitive - , quickcheck-classes, quickcheck-classes-base, semirings, tasty - , tasty-bench, tasty-quickcheck, vector - }: - mkDerivation { - pname = "mod"; - version = "0.1.2.2"; - sha256 = "0m92yd323kjjwnphqlima2aj0hh7i1gnpblc8a29ks25gj0sv66v"; - libraryHaskellDepends = [ - base deepseq integer-gmp primitive semirings vector - ]; - testHaskellDepends = [ - base primitive quickcheck-classes quickcheck-classes-base semirings - tasty tasty-quickcheck vector - ]; - benchmarkHaskellDepends = [ base tasty-bench ]; - description = "Fast type-safe modular arithmetic"; - license = lib.licenses.mit; - hydraPlatforms = lib.platforms.none; - }) {}; - "mod" = callPackage ({ mkDerivation, base, containers, deepseq, ghc-bignum, primitive , quickcheck-classes, quickcheck-classes-base, semirings, tasty @@ -220944,40 +220813,6 @@ self: { broken = true; }) {}; - "ormolu_0_5_0_1" = callPackage - ({ mkDerivation, aeson, ansi-terminal, array, base, bytestring - , Cabal, containers, Diff, directory, dlist, exceptions, filepath - , ghc-lib-parser, gitrev, hspec, hspec-discover, hspec-megaparsec - , megaparsec, MemoTrie, mtl, optparse-applicative, path, path-io - , QuickCheck, syb, template-haskell, temporary, text - , th-lift-instances - }: - mkDerivation { - pname = "ormolu"; - version = "0.5.0.1"; - sha256 = "1rnf4x352k856avfllk4rc9v0wwkydr030cmp7j29p0y9cwf5pkg"; - isLibrary = true; - isExecutable = true; - libraryHaskellDepends = [ - aeson ansi-terminal array base bytestring Cabal containers Diff - directory dlist exceptions filepath ghc-lib-parser megaparsec - MemoTrie mtl syb template-haskell text th-lift-instances - ]; - executableHaskellDepends = [ - base containers filepath ghc-lib-parser gitrev optparse-applicative - text - ]; - testHaskellDepends = [ - base containers directory filepath ghc-lib-parser hspec - hspec-megaparsec megaparsec path path-io QuickCheck temporary text - ]; - testToolDepends = [ hspec-discover ]; - description = "A formatter for Haskell source code"; - license = lib.licenses.bsd3; - hydraPlatforms = lib.platforms.none; - mainProgram = "ormolu"; - }) {}; - "ormolu_0_5_2_0" = callPackage ({ mkDerivation, ansi-terminal, array, base, binary, bytestring , Cabal-syntax, containers, Diff, directory, dlist, file-embed @@ -286601,42 +286436,7 @@ self: { broken = true; }) {}; - "stylish-haskell_0_14_3_0" = callPackage - ({ mkDerivation, aeson, base, bytestring, Cabal, containers - , directory, file-embed, filepath, ghc, ghc-boot, ghc-boot-th - , ghc-lib-parser-ex, HsYAML, HsYAML-aeson, HUnit, mtl - , optparse-applicative, random, regex-tdfa, strict, syb - , test-framework, test-framework-hunit, text - }: - mkDerivation { - pname = "stylish-haskell"; - version = "0.14.3.0"; - sha256 = "17w92v0qnwj7m6yqdq5cxbr04xiz0yfnnyx5q54218wdl7n5lf6d"; - isLibrary = true; - isExecutable = true; - libraryHaskellDepends = [ - aeson base bytestring Cabal containers directory file-embed - filepath ghc ghc-boot ghc-boot-th ghc-lib-parser-ex HsYAML - HsYAML-aeson mtl regex-tdfa syb text - ]; - executableHaskellDepends = [ - aeson base bytestring Cabal containers directory file-embed - filepath ghc ghc-boot ghc-boot-th ghc-lib-parser-ex HsYAML - HsYAML-aeson mtl optparse-applicative regex-tdfa strict syb text - ]; - testHaskellDepends = [ - aeson base bytestring Cabal containers directory file-embed - filepath ghc ghc-boot ghc-boot-th ghc-lib-parser-ex HsYAML - HsYAML-aeson HUnit mtl random regex-tdfa syb test-framework - test-framework-hunit text - ]; - description = "Haskell code prettifier"; - license = lib.licenses.bsd3; - hydraPlatforms = lib.platforms.none; - mainProgram = "stylish-haskell"; - }) {}; - - "stylish-haskell" = callPackage + "stylish-haskell_0_14_4_0" = callPackage ({ mkDerivation, aeson, base, bytestring, Cabal, containers , directory, file-embed, filepath, ghc, ghc-boot, ghc-boot-th , ghc-lib-parser-ex, HsYAML, HsYAML-aeson, HUnit, mtl @@ -286667,10 +286467,11 @@ self: { ]; description = "Haskell code prettifier"; license = lib.licenses.bsd3; + hydraPlatforms = lib.platforms.none; mainProgram = "stylish-haskell"; }) {}; - "stylish-haskell_0_14_5_0" = callPackage + "stylish-haskell" = callPackage ({ mkDerivation, aeson, base, bytestring, Cabal, containers , directory, file-embed, filepath, ghc-lib-parser , ghc-lib-parser-ex, HsYAML, HsYAML-aeson, HUnit, mtl @@ -286700,7 +286501,6 @@ self: { ]; description = "Haskell code prettifier"; license = lib.licenses.bsd3; - hydraPlatforms = lib.platforms.none; mainProgram = "stylish-haskell"; }) {};