From d910974e5245b28c8800d8beaa435ca544ad34df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Hr=C4=8Dek?= Date: Tue, 16 Jan 2024 06:03:31 +0100 Subject: [PATCH 1/4] Remove conditional cabal logic pertaining to no-longer supported (pre 9.2) GHCs --- ghcide/ghcide.cabal | 31 ++++++------------- haskell-language-server.cabal | 2 +- hie-compat/hie-compat.cabal | 2 -- hie-compat/src-ghc90/Compat/HieAst.hs | 3 -- .../hls-class-plugin/hls-class-plugin.cabal | 6 +--- .../hls-fourmolu-plugin.cabal | 8 ++--- .../hls-overloaded-record-dot-plugin.cabal | 8 ----- 7 files changed, 13 insertions(+), 47 deletions(-) delete mode 100644 hie-compat/src-ghc90/Compat/HieAst.hs diff --git a/ghcide/ghcide.cabal b/ghcide/ghcide.cabal index a64e854950..d297d49bbf 100644 --- a/ghcide/ghcide.cabal +++ b/ghcide/ghcide.cabal @@ -232,12 +232,7 @@ library -Wwarn=duplicate-exports -Wwarn=dodgy-exports -Wwarn=incomplete-patterns -Wwarn=overlapping-patterns -Wwarn=incomplete-record-updates - - -- ambiguous-fields is only understood by GHC >= 9.2, so we only disable it - -- then. The above comment goes for here too -- this should be understood to - -- be temporary until we can remove these warnings. - if (impl(ghc >=9.2) && flag(pedantic)) - ghc-options: -Wwarn=ambiguous-fields + -Wwarn=ambiguous-fields if flag(ekg) build-depends: @@ -269,7 +264,7 @@ executable ghcide hs-source-dirs: exe ghc-options: -threaded -Wall -Wincomplete-uni-patterns -Wno-name-shadowing - -rtsopts "-with-rtsopts=-I0 -A128M -T" + -rtsopts "-with-rtsopts=-I0 -A128M -T" -Wunused-packages -- allow user RTS overrides -- disable idle GC @@ -318,9 +313,6 @@ executable ghcide cpp-options: -DMONITORING_EKG - if impl(ghc >=9) - ghc-options: -Wunused-packages - test-suite ghcide-tests type: exitcode-stdio-1.0 default-language: Haskell2010 @@ -340,6 +332,13 @@ test-suite ghcide-tests , extra , filepath , fuzzy + -------------------------------------------------------------- + -- The MIN_VERSION_ghc macro relies on MIN_VERSION pragmas + -- which require depending on ghc. So the tests need to depend + -- on ghc if they need to use MIN_VERSION_ghc. Maybe a + -- better solution can be found, but this is a quick solution + -- which works for now. + -------------------------------------------------------------- , ghc , ghcide , hls-plugin-api @@ -368,18 +367,6 @@ test-suite ghcide-tests , text-rope , unordered-containers - -------------------------------------------------------------- - -- The MIN_VERSION_ghc macro relies on MIN_VERSION pragmas - -- which require depending on ghc. So the tests need to depend - -- on ghc if they need to use MIN_VERSION_ghc. Maybe a - -- better solution can be found, but this is a quick solution - -- which works for now. - -------------------------------------------------------------- - if impl(ghc <9.2) - build-depends: - , record-dot-preprocessor - , record-hasfield - if impl(ghc <9.3) build-depends: ghc-typelits-knownnat diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index 3743059e43..43ee12e74b 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -307,7 +307,7 @@ common explicitFields cpp-options: -DexplicitFields common overloadedRecordDot - if flag(overloadedRecordDot) && (impl(ghc >= 9.2.0) || flag(ignore-plugins-ghc-bounds)) + if flag(overloadedRecordDot) build-depends: hls-overloaded-record-dot-plugin == 2.6.0.0 cpp-options: -Dhls_overloaded_record_dot diff --git a/hie-compat/hie-compat.cabal b/hie-compat/hie-compat.cabal index 2b9e78d323..db574901b9 100644 --- a/hie-compat/hie-compat.cabal +++ b/hie-compat/hie-compat.cabal @@ -35,8 +35,6 @@ library Compat.HieDebug Compat.HieUtils - if (impl(ghc >= 9.0) && impl(ghc < 9.1)) - hs-source-dirs: src-ghc90 src-reexport-ghc9 if (impl(ghc >= 9.2) && impl(ghc < 9.3)) hs-source-dirs: src-ghc92 src-reexport-ghc9 if (impl(ghc >= 9.4)) diff --git a/hie-compat/src-ghc90/Compat/HieAst.hs b/hie-compat/src-ghc90/Compat/HieAst.hs deleted file mode 100644 index c6d0260f6b..0000000000 --- a/hie-compat/src-ghc90/Compat/HieAst.hs +++ /dev/null @@ -1,3 +0,0 @@ -module Compat.HieAst ( enrichHie ) where - -import GHC.Iface.Ext.Ast (enrichHie) diff --git a/plugins/hls-class-plugin/hls-class-plugin.cabal b/plugins/hls-class-plugin/hls-class-plugin.cabal index a48cbb9906..569cf87ecb 100644 --- a/plugins/hls-class-plugin/hls-class-plugin.cabal +++ b/plugins/hls-class-plugin/hls-class-plugin.cabal @@ -44,6 +44,7 @@ library , deepseq , extra , ghc + , ghc-exactprint >= 1.5 , ghcide == 2.6.0.0 , ghc-boot-th , hls-graph @@ -54,11 +55,6 @@ library , text , transformers - if impl(ghc >=9.2.1) - build-depends: ghc-exactprint >= 1.5 - else - build-depends: ghc-exactprint >= 0.6.4 && <1.1 - default-language: Haskell2010 default-extensions: DataKinds diff --git a/plugins/hls-fourmolu-plugin/hls-fourmolu-plugin.cabal b/plugins/hls-fourmolu-plugin/hls-fourmolu-plugin.cabal index edfdd85054..027b9d33ad 100644 --- a/plugins/hls-fourmolu-plugin/hls-fourmolu-plugin.cabal +++ b/plugins/hls-fourmolu-plugin/hls-fourmolu-plugin.cabal @@ -30,6 +30,7 @@ library build-depends: , base >=4.12 && <5 , filepath + , fourmolu ^>= 0.14 , ghc , ghc-boot-th , ghcide == 2.6.0.0 @@ -41,13 +42,8 @@ library , text , transformers - if impl(ghc >= 9.0) && impl(ghc < 9.2) - build-depends: fourmolu ^>= 0.11 - else - build-depends: fourmolu ^>= 0.14 - -- fourmolu 0.9.0 fails to build on Windows CI for reasons unknown - if impl(ghc >= 9.2) && os(windows) && impl(ghc < 9.4) + if os(windows) && impl(ghc < 9.4) build-depends: fourmolu > 0.9.0.0 || < 0.9.0.0 default-language: Haskell2010 diff --git a/plugins/hls-overloaded-record-dot-plugin/hls-overloaded-record-dot-plugin.cabal b/plugins/hls-overloaded-record-dot-plugin/hls-overloaded-record-dot-plugin.cabal index 57ddb33998..a6c460c83d 100644 --- a/plugins/hls-overloaded-record-dot-plugin/hls-overloaded-record-dot-plugin.cabal +++ b/plugins/hls-overloaded-record-dot-plugin/hls-overloaded-record-dot-plugin.cabal @@ -23,10 +23,6 @@ common warnings library import: warnings - if impl(ghc < 9.2) - buildable: False - else - buildable: True exposed-modules: Ide.Plugin.OverloadedRecordDot build-depends: , base >=4.16 && <5 @@ -48,10 +44,6 @@ library test-suite tests import: warnings - if impl(ghc < 9.2) - buildable: False - else - buildable: True default-language: GHC2021 type: exitcode-stdio-1.0 hs-source-dirs: test From 8172bde4fa4b05d415d66f2aa4ce6ddf3aebfe39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Hr=C4=8Dek?= Date: Sat, 13 Jan 2024 13:27:46 +0100 Subject: [PATCH 2/4] Cleanup in github workflows --- .github/workflows/flags.yml | 4 +--- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/flags.yml b/.github/workflows/flags.yml index 52d971a046..6a5089184f 100644 --- a/.github/workflows/flags.yml +++ b/.github/workflows/flags.yml @@ -75,9 +75,7 @@ jobs: - name: Build `ghcide` with flags run: cabal v2-build ghcide --flags="ghc-patched-unboxed-bytecode test-exe executable bench-exe ekg" - # wingman fails with flags on 9.0, so this can be removed when that's gone - - if: matrix.ghc != '9.0' - name: Build with pedantic (-WError) + - name: Build with pedantic (-WError) run: cabal v2-build --flags="pedantic" flags_post_job: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 65db1d0d2b..44d46d00d9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -236,7 +236,7 @@ jobs: name: Test hls-retrie-plugin test suite run: cabal test hls-retrie-plugin --test-options="$TEST_OPTS" || cabal test hls-retrie-plugin --test-options="$TEST_OPTS" - - if: matrix.test && matrix.ghc != '9.0' + - if: matrix.test name: Test hls-overloaded-record-dot-plugin test suite run: cabal test hls-overloaded-record-dot-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-overloaded-record-dot-plugin --test-options="$TEST_OPTS" From 1267c73ccd358d8dc71f112f9877839181e0a67b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Hr=C4=8Dek?= Date: Sat, 13 Jan 2024 16:13:27 +0100 Subject: [PATCH 3/4] Apply review suggestions --- ghcide/ghcide.cabal | 4 ++-- plugins/hls-fourmolu-plugin/hls-fourmolu-plugin.cabal | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ghcide/ghcide.cabal b/ghcide/ghcide.cabal index d297d49bbf..f2d3d4ce77 100644 --- a/ghcide/ghcide.cabal +++ b/ghcide/ghcide.cabal @@ -263,8 +263,8 @@ executable ghcide default-language: Haskell2010 hs-source-dirs: exe ghc-options: - -threaded -Wall -Wincomplete-uni-patterns -Wno-name-shadowing - -rtsopts "-with-rtsopts=-I0 -A128M -T" -Wunused-packages + -threaded -Wall -Wincomplete-uni-patterns -Wno-name-shadowing -Wunused-packages + -rtsopts "-with-rtsopts=-I0 -A128M -T" -- allow user RTS overrides -- disable idle GC diff --git a/plugins/hls-fourmolu-plugin/hls-fourmolu-plugin.cabal b/plugins/hls-fourmolu-plugin/hls-fourmolu-plugin.cabal index 027b9d33ad..8af32c9f73 100644 --- a/plugins/hls-fourmolu-plugin/hls-fourmolu-plugin.cabal +++ b/plugins/hls-fourmolu-plugin/hls-fourmolu-plugin.cabal @@ -30,7 +30,7 @@ library build-depends: , base >=4.12 && <5 , filepath - , fourmolu ^>= 0.14 + , fourmolu ^>= 0.14 , ghc , ghc-boot-th , ghcide == 2.6.0.0 From 4430fc73cd2f9962a6183c4dad8e19a404052840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Hr=C4=8Dek?= Date: Sat, 13 Jan 2024 16:59:03 +0100 Subject: [PATCH 4/4] Remove unnecessary fourmolu constraint --- plugins/hls-fourmolu-plugin/hls-fourmolu-plugin.cabal | 3 --- 1 file changed, 3 deletions(-) diff --git a/plugins/hls-fourmolu-plugin/hls-fourmolu-plugin.cabal b/plugins/hls-fourmolu-plugin/hls-fourmolu-plugin.cabal index 8af32c9f73..ae72cb643c 100644 --- a/plugins/hls-fourmolu-plugin/hls-fourmolu-plugin.cabal +++ b/plugins/hls-fourmolu-plugin/hls-fourmolu-plugin.cabal @@ -42,9 +42,6 @@ library , text , transformers - -- fourmolu 0.9.0 fails to build on Windows CI for reasons unknown - if os(windows) && impl(ghc < 9.4) - build-depends: fourmolu > 0.9.0.0 || < 0.9.0.0 default-language: Haskell2010 test-suite tests