diff --git a/.github/actions/setup-build/action.yml b/.github/actions/setup-build/action.yml index ef07a3bf17..82d4fbdf69 100644 --- a/.github/actions/setup-build/action.yml +++ b/.github/actions/setup-build/action.yml @@ -121,6 +121,7 @@ runs: - name: Form the package list ('cabal.project.freeze') run: | + rm cabal.project.freeze || \ cabal v2-freeze && \ echo "" && \ echo 'Output:' && \ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4d4ad3ccc5..00dc30d913 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,11 +16,11 @@ variables: - GHC_VERSION: 8.10.7 CABAL_PROJECT: cabal.project - GHC_VERSION: 9.0.2 - CABAL_PROJECT: cabal-ghc90.project + CABAL_PROJECT: cabal.project - GHC_VERSION: 9.2.2 - CABAL_PROJECT: cabal-ghc92.project + CABAL_PROJECT: cabal.project - GHC_VERSION: 9.2.1 - CABAL_PROJECT: cabal-ghc92.project + CABAL_PROJECT: cabal.project workflow: rules: diff --git a/bindist/ghcs b/bindist/ghcs index 32cfc187ed..886c529d64 100644 --- a/bindist/ghcs +++ b/bindist/ghcs @@ -1,6 +1,6 @@ 8.6.5,cabal.project 8.8.4,cabal.project 8.10.7,cabal.project -9.0.2,cabal-ghc90.project -9.2.1,cabal-ghc92.project -9.2.2,cabal-ghc92.project +9.0.2,cabal.project +9.2.1,cabal.project +9.2.2,cabal.project diff --git a/bindist/ghcs-FreeBSD b/bindist/ghcs-FreeBSD index cab2c69bb2..a1b4b6e0bf 100644 --- a/bindist/ghcs-FreeBSD +++ b/bindist/ghcs-FreeBSD @@ -1,2 +1,2 @@ 8.10.7,cabal.project -9.0.2,cabal-ghc90.project +9.0.2,cabal.project diff --git a/bindist/ghcs-Msys b/bindist/ghcs-Msys index a6210abe73..b2e04cac3c 100644 --- a/bindist/ghcs-Msys +++ b/bindist/ghcs-Msys @@ -1,4 +1,4 @@ 8.10.7,cabal.project -9.0.2,cabal-ghc90.project -9.2.2,cabal-ghc92.project -9.2.1,cabal-ghc92.project +9.0.2,cabal.project +9.2.2,cabal.project +9.2.1,cabal.project diff --git a/cabal-ghc90.project b/cabal-ghc90.project deleted file mode 100644 index 06e0d35262..0000000000 --- a/cabal-ghc90.project +++ /dev/null @@ -1,58 +0,0 @@ -packages: - ./ - ./hie-compat - ./shake-bench - ./hls-graph - ./ghcide - ./hls-plugin-api - ./hls-test-utils - ./plugins/hls-tactics-plugin - ./plugins/hls-brittany-plugin - ./plugins/hls-stylish-haskell-plugin - ./plugins/hls-fourmolu-plugin - ./plugins/hls-class-plugin - ./plugins/hls-eval-plugin - ./plugins/hls-explicit-imports-plugin - ./plugins/hls-refine-imports-plugin - ./plugins/hls-hlint-plugin - ./plugins/hls-rename-plugin - ./plugins/hls-retrie-plugin - ./plugins/hls-haddock-comments-plugin - ./plugins/hls-splice-plugin - ./plugins/hls-qualify-imported-names-plugin - ./plugins/hls-floskell-plugin - ./plugins/hls-pragmas-plugin - ./plugins/hls-module-name-plugin - ./plugins/hls-ormolu-plugin - ./plugins/hls-call-hierarchy-plugin - ./plugins/hls-alternate-number-format-plugin - ./plugins/hls-selection-range-plugin - ./plugins/hls-change-type-signature-plugin - -tests: true - -package * - ghc-options: -haddock - test-show-details: direct - -write-ghc-environment-files: never - -index-state: 2022-04-27T09:22:49Z - -constraints: - --- although we are not building all plugins cabal solver phase is run for all packages --- this way we track explicitly all transitive dependencies which need support for ghc-9 -allow-newer: - - -- brittany: update ghc bounds in hls.cabal when those are removed - -- https://github.com/lspitzner/multistate/pull/8 - multistate:base, - -- https://github.com/lspitzner/data-tree-print/pull/3 - data-tree-print:base, - -- https://github.com/lspitzner/butcher/pull/8 - butcher:base, - - -- ghc-9.0.2 specific - -- for ghcide:test via ghc-typelits-knownnat - ghc-typelits-natnormalise:ghc-bignum diff --git a/cabal-ghc92.project b/cabal-ghc92.project deleted file mode 100644 index 136ea7365b..0000000000 --- a/cabal-ghc92.project +++ /dev/null @@ -1,93 +0,0 @@ -packages: - ./ - ./hie-compat - ./shake-bench - ./hls-graph - ./ghcide - ./hls-plugin-api - ./hls-test-utils - ./plugins/hls-tactics-plugin - ./plugins/hls-brittany-plugin - ./plugins/hls-stylish-haskell-plugin - ./plugins/hls-fourmolu-plugin - ./plugins/hls-class-plugin - ./plugins/hls-eval-plugin - ./plugins/hls-explicit-imports-plugin - ./plugins/hls-refine-imports-plugin - ./plugins/hls-hlint-plugin - ./plugins/hls-rename-plugin - ./plugins/hls-retrie-plugin - ./plugins/hls-haddock-comments-plugin - ./plugins/hls-splice-plugin - ./plugins/hls-qualify-imported-names-plugin - ./plugins/hls-floskell-plugin - ./plugins/hls-pragmas-plugin - ./plugins/hls-module-name-plugin - ./plugins/hls-ormolu-plugin - ./plugins/hls-call-hierarchy-plugin - ./plugins/hls-alternate-number-format-plugin - ./plugins/hls-selection-range-plugin - ./plugins/hls-change-type-signature-plugin - -with-compiler: ghc-9.2.2 - -tests: true - -package * - ghc-options: -haddock - test-show-details: direct - -write-ghc-environment-files: never - -index-state: 2022-04-27T09:22:49Z - -constraints: - -- These plugins don't build/work on GHC92 yet - haskell-language-server - +ignore-plugins-ghc-bounds - -brittany - -haddockComments - -retrie - -splice - -tactic, - ghc-lib-parser-ex -auto, - hlint +ghc-lib, - stylish-haskell +ghc-lib - -allow-newer: - -- for shake-bench - Chart:lens, - Chart-diagrams:lens, - - -- for head.hackage - primitive-unlifted:base, - - brittany:ghc-boot, - brittany:ghc-boot-th, - brittany:ghc, - brittany:ghc-exactprint, - brittany:bytestring, - brittany:base, - -- https://github.com/lspitzner/multistate/pull/8 - multistate:base, - -- https://github.com/lspitzner/data-tree-print/pull/3 - data-tree-print:base, - -- https://github.com/lspitzner/butcher/pull/8 - butcher:base, - - hls-haddock-comments-plugin:ghc-exactprint, - - implicit-hie-cradle:bytestring, - implicit-hie-cradle:time, - - -- For tactics - ghc-source-gen:ghc, - - -- for ghcide:test via ghc-typelits-knownnat - ghc-typelits-natnormalise:ghc-bignum, - - hiedb:base, - retrie:ghc-exactprint - -allow-older: - primitive-extras:primitive-unlifted diff --git a/cabal.project b/cabal.project index ea1114f19a..78ceb8e2ff 100644 --- a/cabal.project +++ b/cabal.project @@ -46,12 +46,27 @@ write-ghc-environment-files: never index-state: 2022-04-27T09:22:49Z constraints: - hyphenation +embed, - -- remove this when hlint sets ghc-lib to true by default - -- https://github.com/ndmitchell/hlint/issues/1376 - hlint +ghc-lib + hyphenation +embed, + -- remove this when hlint sets ghc-lib to true by default + -- https://github.com/ndmitchell/hlint/issues/1376 + hlint +ghc-lib, + ghc-lib-parser-ex -auto, + stylish-haskell +ghc-lib allow-newer: - -- for shake-bench - Chart-diagrams:diagrams-core, - SVGFonts:diagrams-core + -- ghc-9.2 + ---------- + hiedb:base, + retrie:ghc-exactprint, + + -- for brittany + -- https://github.com/lspitzner/multistate/pull/8 + multistate:base, + -- https://github.com/lspitzner/data-tree-print/pull/3 + data-tree-print:base, + -- https://github.com/lspitzner/butcher/pull/8 + butcher:base, + + -- for shake-bench + Chart:lens, + Chart-diagrams:lens, diff --git a/configuration-ghc-901.nix b/configuration-ghc-901.nix deleted file mode 100644 index 789a5d2e19..0000000000 --- a/configuration-ghc-901.nix +++ /dev/null @@ -1,36 +0,0 @@ -# nix version of cabal-ghc901.project -{ pkgs }: - -let - disabledPlugins = [ - "hls-brittany-plugin" - "hls-stylish-haskell-plugin" - ]; - - hpkgsOverride = hself: hsuper: - with pkgs.haskell.lib; - { - hlsDisabledPlugins = disabledPlugins; - - fourmolu = hself.fourmolu_0_4_0_0; - primitive-extras = hself.primitive-extras_0_10_1_2; - - # Re-generate HLS drv excluding some plugins - haskell-language-server = - hself.callCabal2nixWithOptions "haskell-language-server" ./. - (pkgs.lib.concatStringsSep " " [ - "-f-brittany" - "-f-stylishhaskell" - ]) { }; - - # YOLO - mkDerivation = args: - hsuper.mkDerivation (args // { - jailbreak = true; - doCheck = false; - }); - }; -in { - inherit disabledPlugins; - tweakHpkgs = hpkgs: hpkgs.extend hpkgsOverride; -} diff --git a/configuration-ghc-921.nix b/configuration-ghc-921.nix deleted file mode 100644 index d8660da1d9..0000000000 --- a/configuration-ghc-921.nix +++ /dev/null @@ -1,51 +0,0 @@ -# nix version of cabal-ghc901.project -{ pkgs, inputs }: - -let - disabledPlugins = [ - "hls-brittany-plugin" - "hls-hlint-plugin" - "hls-haddock-comments-plugin" - "hls-tactics-plugin" - # That one is not technically a plugin, but by putting it in this list, we - # get it removed from the top level list of requirement and it is not pull - # in the nix shell. - "shake-bench" - ]; - - hpkgsOverride = hself: hsuper: - with pkgs.haskell.lib; - { - hlsDisabledPlugins = disabledPlugins; - - fourmolu = hself.callCabal2nix "fourmolu" inputs.fourmolu {}; - primitive-extras = hself.primitive-extras_0_10_1_2; - ghc-exactprint = hself.callCabal2nix "ghc-exactprint" inputs.ghc-exactprint {}; - constraints-extras = hself.callCabal2nix "constraints-extras" inputs.constraints-extras {}; - retrie = hself.callCabal2nix "retrie" inputs.retrie {}; - - # Hlint is still broken - hlint = doJailbreak (hself.callCabal2nix "hlint" inputs.hlint {}); - hiedb = hself.hiedb_0_4_1_0; - - # Re-generate HLS drv excluding some plugins - haskell-language-server = - hself.callCabal2nixWithOptions "haskell-language-server" ./. - (pkgs.lib.concatStringsSep " " [ - "-f-brittany" - "-f-hlint" - "-f-haddockComments" - "-f-tactics" - ]) { }; - - # YOLO - mkDerivation = args: - hsuper.mkDerivation (args // { - jailbreak = true; - doCheck = false; - }); - }; -in { - inherit disabledPlugins; - tweakHpkgs = hpkgs: hpkgs.extend hpkgsOverride; -} diff --git a/docs/installation.md b/docs/installation.md index 59710c69be..614052b097 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -36,7 +36,7 @@ ghcup compile hls -v 1.6.1.0 --ghc 8.10.7 --ghc 8.8.4 Use a different `cabal.project` for a GHC version: ``` -ghcup compile hls -v 1.6.1.0 --ghc 9.2.1 --cabal-project cabal-ghc92.project +ghcup compile hls -v 1.6.1.0 --ghc 9.2.1 --cabal-project cabal.project ``` Check `ghcup compile hls --help` for a full list of compilation options. diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 68642dada1..153f34275a 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -171,16 +171,10 @@ The easiest way to obtain a dynamically linked HLS binary is to build HLS locall cabal update && cabal install :pkg:haskell-language-server ``` -If you are compiling with a ghc version with a specific `cabal-ghc${ghcVersion}.project` in the repo you will have to use it. For example for ghc-9.0.x: - -```bash -cabal update && cabal install :pkg:haskell-language-server --project-file=cabal-ghc90.project -``` - Or with `stack`: ```bash -stack install haskell-language-server --stack-yaml=stack-${ghcVersion}.yaml +stack install haskell-language-server ``` You also can leverage `ghcup compile hls`: @@ -189,12 +183,6 @@ You also can leverage `ghcup compile hls`: ghcup compile hls -v 1.6.1.0 --ghc 8.10.7 ``` -as it uses cabal underneath you might need to use a specific cabal.project for some ghc versions: - -```bash -ghcup compile hls -v 1.6.1.0 --ghc 9.0.2 --cabal-project cabal-ghc90.project -``` - ### Preprocessors HLS is [not yet](https://github.com/haskell/haskell-language-server/issues/176) able to find project preprocessors, which may result in `could not execute: ` errors. diff --git a/flake.nix b/flake.nix index 1676dbed47..d7975491b8 100644 --- a/flake.nix +++ b/flake.nix @@ -336,8 +336,8 @@ haskell-language-server-dev = mkDevShell ghcDefault "cabal.project"; haskell-language-server-884-dev = mkDevShell ghc884 "cabal.project"; haskell-language-server-8107-dev = mkDevShell ghc8107 "cabal.project"; - haskell-language-server-901-dev = mkDevShell ghc901 "cabal-ghc90.project"; - haskell-language-server-921-dev = mkDevShell ghc921 "cabal-ghc92.project"; + haskell-language-server-901-dev = mkDevShell ghc901 "cabal.project"; + haskell-language-server-921-dev = mkDevShell ghc921 "cabal.project"; }; # Developement shell, haskell packages are also provided by nix @@ -345,8 +345,8 @@ haskell-language-server-dev-nix = mkDevShellWithNixDeps ghcDefault "cabal.project"; haskell-language-server-884-dev-nix = mkDevShellWithNixDeps ghc884 "cabal.project"; haskell-language-server-8107-dev-nix = mkDevShellWithNixDeps ghc8107 "cabal.project"; - haskell-language-server-901-dev-nix = mkDevShellWithNixDeps ghc901 "cabal-ghc90.project"; - haskell-language-server-921-dev-nix = mkDevShellWithNixDeps ghc921 "cabal-ghc92.project"; + haskell-language-server-901-dev-nix = mkDevShellWithNixDeps ghc901 "cabal.project"; + haskell-language-server-921-dev-nix = mkDevShellWithNixDeps ghc921 "cabal.project"; }; allPackages = { diff --git a/hie-compat/hie-compat.cabal b/hie-compat/hie-compat.cabal index 13b0cb3ef1..0683c7a628 100644 --- a/hie-compat/hie-compat.cabal +++ b/hie-compat/hie-compat.cabal @@ -24,7 +24,7 @@ library default-language: Haskell2010 build-depends: base < 4.17, array, bytestring, containers, directory, filepath, transformers - if flag(ghc-lib) + if flag(ghc-lib) && impl(ghc < 9) build-depends: ghc-lib < 9.0 else build-depends: ghc, ghc-boot diff --git a/plugins/hls-brittany-plugin/hls-brittany-plugin.cabal b/plugins/hls-brittany-plugin/hls-brittany-plugin.cabal index 28b1f96b6b..9928d1f74b 100644 --- a/plugins/hls-brittany-plugin/hls-brittany-plugin.cabal +++ b/plugins/hls-brittany-plugin/hls-brittany-plugin.cabal @@ -17,6 +17,10 @@ extra-source-files: test/testdata/**/*.hs library + if impl(ghc >= 9.2) + buildable: False + else + buildable: True exposed-modules: Ide.Plugin.Brittany hs-source-dirs: src build-depends: @@ -39,6 +43,10 @@ library default-language: Haskell2010 test-suite tests + if impl(ghc >= 9.2) + buildable: False + else + buildable: True type: exitcode-stdio-1.0 default-language: Haskell2010 hs-source-dirs: test diff --git a/plugins/hls-haddock-comments-plugin/hls-haddock-comments-plugin.cabal b/plugins/hls-haddock-comments-plugin/hls-haddock-comments-plugin.cabal index e250aa16be..9acc5e916c 100644 --- a/plugins/hls-haddock-comments-plugin/hls-haddock-comments-plugin.cabal +++ b/plugins/hls-haddock-comments-plugin/hls-haddock-comments-plugin.cabal @@ -18,6 +18,10 @@ extra-source-files: test/testdata/*.hs library + if impl(ghc >= 9.2) + buildable: False + else + buildable: True exposed-modules: Ide.Plugin.HaddockComments hs-source-dirs: src ghc-options: @@ -41,6 +45,10 @@ library TypeOperators test-suite tests + if impl(ghc >= 9.2) + buildable: False + else + buildable: True type: exitcode-stdio-1.0 default-language: Haskell2010 hs-source-dirs: test