diff --git a/.github/workflows/flags.yml b/.github/workflows/flags.yml index 387c5ea8045..2283899d0c6 100644 --- a/.github/workflows/flags.yml +++ b/.github/workflows/flags.yml @@ -64,10 +64,6 @@ jobs: - name: Build `hls-graph` with flags run: cabal v2-build hls-graph --flags="embed-files stm-stats" - - if: matrix.ghc != '8.6.5' && matrix.ghc != '8.8.4' - name: Build `hie-compat` with flags - run: cabal v2-build hie-compat --flags="ghc-lib" - - name: Build `ghcide` with flags run: cabal v2-build ghcide --flags="ghc-patched-unboxed-bytecode test-exe executable bench-exe" diff --git a/cabal-ghc90.project b/cabal-ghc90.project index bdc720312d0..06e0d35262b 100644 --- a/cabal-ghc90.project +++ b/cabal-ghc90.project @@ -40,7 +40,6 @@ write-ghc-environment-files: never index-state: 2022-04-27T09:22:49Z constraints: - hls-hlint-plugin +ghc-lib -- 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 diff --git a/cabal-ghc92.project b/cabal-ghc92.project index 6911f59bea3..136ea7365b5 100644 --- a/cabal-ghc92.project +++ b/cabal-ghc92.project @@ -50,8 +50,6 @@ constraints: -retrie -splice -tactic, - hls-hlint-plugin +ghc-lib, - -- # Use ghc-lib force instead of ghc itself ghc-lib-parser-ex -auto, hlint +ghc-lib, stylish-haskell +ghc-lib diff --git a/cabal.project b/cabal.project index 2057ab1ab41..ea1114f19a8 100644 --- a/cabal.project +++ b/cabal.project @@ -37,15 +37,19 @@ optional-packages: vendored/*/*.cabal tests: true package * - ghc-options: -haddock + -- ghc 8.10 cannot build ghc-lib 9.2 with --haddock + -- ghc-options: -haddock test-show-details: direct write-ghc-environment-files: never -index-state: 2022-03-08T10:53:01Z +index-state: 2022-04-27T09:22:49Z constraints: - hyphenation +embed + hyphenation +embed, + -- remove this when hlint sets ghc-lib to true by default + -- https://github.com/ndmitchell/hlint/issues/1376 + hlint +ghc-lib allow-newer: -- for shake-bench diff --git a/hie-compat/hie-compat.cabal b/hie-compat/hie-compat.cabal index 143df06d447..13b0cb3ef14 100644 --- a/hie-compat/hie-compat.cabal +++ b/hie-compat/hie-compat.cabal @@ -25,7 +25,7 @@ library build-depends: base < 4.17, array, bytestring, containers, directory, filepath, transformers if flag(ghc-lib) - build-depends: ghc-lib + build-depends: ghc-lib < 9.0 else build-depends: ghc, ghc-boot if (impl(ghc >= 9.0) && impl(ghc < 9.1)) diff --git a/plugins/hls-hlint-plugin/hls-hlint-plugin.cabal b/plugins/hls-hlint-plugin/hls-hlint-plugin.cabal index 2edb560ad3b..d17d788be9e 100644 --- a/plugins/hls-hlint-plugin/hls-hlint-plugin.cabal +++ b/plugins/hls-hlint-plugin/hls-hlint-plugin.cabal @@ -26,17 +26,9 @@ flag pedantic manual: True flag ghc-lib - default: False - manual: True - description: - Force dependency on ghc-lib-parser even if GHC API in the ghc package is supported - -flag hlint34 - default: True - manual: False - description: - Hlint-3.4 doesn't support versions ghc-lib < 9.0.1 nor ghc <= 8.6, so we can use hlint-3.2 for backwards compat - This flag can be removed when all dependencies support ghc-lib-9.0.* and we drop support for ghc-8.6 + default: True + manual: True + description: Use ghc-lib types (requires hlint to be built with ghc-lib) library exposed-modules: Ide.Plugin.Hlint @@ -56,7 +48,7 @@ library , ghc-exactprint >=0.6.3.4 , ghcide ^>=1.7 , hashable - , hlint + , hlint < 3.5 , hls-plugin-api ^>=1.4 , hslogger , lens @@ -69,41 +61,11 @@ library , transformers , unordered-containers , apply-refact >=0.9.0.0 - -- can be removed if https://github.com/ndmitchell/hlint/pull/1325#issue-1077062712 is merged - -- and https://github.com/haskell/haskell-language-server/pull/2464#issue-1077133441 is updated - -- accordingly + , ghc-lib + , ghc-lib-parser , ghc-lib-parser-ex - if (flag(hlint34)) - -- This mirrors the logic in hlint.cabal for hlint-3.3 - -- https://github.com/ndmitchell/hlint/blob/d3576de4529d8df6cca5a345f5b7e04474ff7bff/hlint.cabal#L79-L88 - -- so we can make sure that we do the same thing as hlint - build-depends: hlint ^>=3.4 - - if (!flag(ghc-lib) && impl(ghc >=9.0.1) && impl(ghc <9.1.0)) - build-depends: ghc ==9.0.* - else - build-depends: - , ghc-lib ^>=9.2 - , ghc-lib-parser-ex ^>=9.2 - , ghc-lib-parser ^>=9.2 - - cpp-options: -DHLINT_ON_GHC_LIB - - else - -- This mirrors the logic in hlint.cabal for hlint-3.2 - -- https://github.com/ndmitchell/hlint/blob/c7354e473c7d09213c8adc3dc94bf50a6eb4a42d/hlint.cabal#L79-L88 - build-depends: hlint ^>=3.2 - if (!flag(ghc-lib) && impl(ghc >=8.10.1) && impl(ghc < 8.11.0)) - build-depends: ghc >=8.10 && <9.0 - else - build-depends: - , ghc - , ghc-lib ^>=8.10.7.20210828 - , ghc-lib-parser-ex ^>=8.10 - - cpp-options: -DHLINT_ON_GHC_LIB - + cpp-options: -DHLINT_ON_GHC_LIB ghc-options: -Wall -Wredundant-constraints -Wno-name-shadowing -Wno-unticked-promoted-constructors diff --git a/plugins/hls-hlint-plugin/test/Main.hs b/plugins/hls-hlint-plugin/test/Main.hs index 6aa4966aad4..ee1ab380d6c 100644 --- a/plugins/hls-hlint-plugin/test/Main.hs +++ b/plugins/hls-hlint-plugin/test/Main.hs @@ -371,7 +371,7 @@ disableHlint = sendConfigurationChanged $ toJSON $ def { Plugin.plugins = Map.fr -- Although a given hlint version supports one direct ghc, we could use several versions of hlint -- each one supporting a different ghc version. It should be a temporary situation though. knownBrokenForHlintOnGhcLib :: String -> TestTree -> TestTree -knownBrokenForHlintOnGhcLib = knownBrokenForGhcVersions [GHC86, GHC88, GHC90, GHC92] +knownBrokenForHlintOnGhcLib = expectFailBecause -- 1's based data Point = Point { diff --git a/stack-lts16.yaml b/stack-lts16.yaml index 7c43657322f..ee471e35219 100644 --- a/stack-lts16.yaml +++ b/stack-lts16.yaml @@ -103,12 +103,10 @@ flags: pedantic: true retrie: BuildExecutable: false - # Stack doesn't support automatic flags. - # Until the formatters support ghc-lib-9, we need this flag disabled - hls-hlint-plugin: - hlint34: false hyphenation: embed: true + hlint: + ghc-lib: true nix: packages: [icu libcxx zlib] diff --git a/stack-lts19.yaml b/stack-lts19.yaml index 1c7789869b1..3ea5eee80a7 100644 --- a/stack-lts19.yaml +++ b/stack-lts19.yaml @@ -67,12 +67,10 @@ flags: retrie: BuildExecutable: false # Stack doesn't support automatic flags. - # Until the formatters support ghc-lib-9, we need this flag disabled - hls-hlint-plugin: - hlint34: true - ghc-lib: true hyphenation: embed: true + hlint: + ghc-lib: true nix: packages: [ icu libcxx zlib ] diff --git a/stack.yaml b/stack.yaml index ef240e9e536..ffd0a81ac55 100644 --- a/stack.yaml +++ b/stack.yaml @@ -82,9 +82,6 @@ flags: retrie: BuildExecutable: false # Stack doesn't support automatic flags. - hls-hlint-plugin: - hlint34: true - ghc-lib: true # Use ghc-lib force instead of ghc itself ghc-lib-parser-ex: auto: false