Skip to content

Commit 4b491c2

Browse files
authored
Cleanup conditional build logic pertaining to pre 9.2 GHCs (#3948)
* Remove conditional cabal logic pertaining to no-longer supported (pre 9.2) GHCs * Cleanup in github workflows * Apply review suggestions * Remove unnecessary fourmolu constraint
1 parent db8efbe commit 4b491c2

File tree

9 files changed

+14
-53
lines changed

9 files changed

+14
-53
lines changed

.github/workflows/flags.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,7 @@ jobs:
7575
- name: Build `ghcide` with flags
7676
run: cabal v2-build ghcide --flags="ghc-patched-unboxed-bytecode test-exe executable bench-exe ekg"
7777

78-
# wingman fails with flags on 9.0, so this can be removed when that's gone
79-
- if: matrix.ghc != '9.0'
80-
name: Build with pedantic (-WError)
78+
- name: Build with pedantic (-WError)
8179
run: cabal v2-build --flags="pedantic"
8280

8381
flags_post_job:

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ jobs:
236236
name: Test hls-retrie-plugin test suite
237237
run: cabal test hls-retrie-plugin --test-options="$TEST_OPTS" || cabal test hls-retrie-plugin --test-options="$TEST_OPTS"
238238

239-
- if: matrix.test && matrix.ghc != '9.0'
239+
- if: matrix.test
240240
name: Test hls-overloaded-record-dot-plugin test suite
241241
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"
242242

ghcide/ghcide.cabal

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -232,12 +232,7 @@ library
232232
-Wwarn=duplicate-exports -Wwarn=dodgy-exports
233233
-Wwarn=incomplete-patterns -Wwarn=overlapping-patterns
234234
-Wwarn=incomplete-record-updates
235-
236-
-- ambiguous-fields is only understood by GHC >= 9.2, so we only disable it
237-
-- then. The above comment goes for here too -- this should be understood to
238-
-- be temporary until we can remove these warnings.
239-
if (impl(ghc >=9.2) && flag(pedantic))
240-
ghc-options: -Wwarn=ambiguous-fields
235+
-Wwarn=ambiguous-fields
241236

242237
if flag(ekg)
243238
build-depends:
@@ -268,7 +263,7 @@ executable ghcide
268263
default-language: Haskell2010
269264
hs-source-dirs: exe
270265
ghc-options:
271-
-threaded -Wall -Wincomplete-uni-patterns -Wno-name-shadowing
266+
-threaded -Wall -Wincomplete-uni-patterns -Wno-name-shadowing -Wunused-packages
272267
-rtsopts "-with-rtsopts=-I0 -A128M -T"
273268

274269
-- allow user RTS overrides
@@ -318,9 +313,6 @@ executable ghcide
318313

319314
cpp-options: -DMONITORING_EKG
320315

321-
if impl(ghc >=9)
322-
ghc-options: -Wunused-packages
323-
324316
test-suite ghcide-tests
325317
type: exitcode-stdio-1.0
326318
default-language: Haskell2010
@@ -340,6 +332,13 @@ test-suite ghcide-tests
340332
, extra
341333
, filepath
342334
, fuzzy
335+
--------------------------------------------------------------
336+
-- The MIN_VERSION_ghc macro relies on MIN_VERSION pragmas
337+
-- which require depending on ghc. So the tests need to depend
338+
-- on ghc if they need to use MIN_VERSION_ghc. Maybe a
339+
-- better solution can be found, but this is a quick solution
340+
-- which works for now.
341+
--------------------------------------------------------------
343342
, ghc
344343
, ghcide
345344
, hls-plugin-api
@@ -368,18 +367,6 @@ test-suite ghcide-tests
368367
, text-rope
369368
, unordered-containers
370369

371-
--------------------------------------------------------------
372-
-- The MIN_VERSION_ghc macro relies on MIN_VERSION pragmas
373-
-- which require depending on ghc. So the tests need to depend
374-
-- on ghc if they need to use MIN_VERSION_ghc. Maybe a
375-
-- better solution can be found, but this is a quick solution
376-
-- which works for now.
377-
--------------------------------------------------------------
378-
if impl(ghc <9.2)
379-
build-depends:
380-
, record-dot-preprocessor
381-
, record-hasfield
382-
383370
if impl(ghc <9.3)
384371
build-depends: ghc-typelits-knownnat
385372

haskell-language-server.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ common explicitFields
307307
cpp-options: -DexplicitFields
308308

309309
common overloadedRecordDot
310-
if flag(overloadedRecordDot) && (impl(ghc >= 9.2.0) || flag(ignore-plugins-ghc-bounds))
310+
if flag(overloadedRecordDot)
311311
build-depends: hls-overloaded-record-dot-plugin == 2.6.0.0
312312
cpp-options: -Dhls_overloaded_record_dot
313313

hie-compat/hie-compat.cabal

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ library
3535
Compat.HieDebug
3636
Compat.HieUtils
3737

38-
if (impl(ghc >= 9.0) && impl(ghc < 9.1))
39-
hs-source-dirs: src-ghc90 src-reexport-ghc9
4038
if (impl(ghc >= 9.2) && impl(ghc < 9.3))
4139
hs-source-dirs: src-ghc92 src-reexport-ghc9
4240
if (impl(ghc >= 9.4))

hie-compat/src-ghc90/Compat/HieAst.hs

Lines changed: 0 additions & 3 deletions
This file was deleted.

plugins/hls-class-plugin/hls-class-plugin.cabal

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ library
4444
, deepseq
4545
, extra
4646
, ghc
47+
, ghc-exactprint >= 1.5
4748
, ghcide == 2.6.0.0
4849
, ghc-boot-th
4950
, hls-graph
@@ -54,11 +55,6 @@ library
5455
, text
5556
, transformers
5657

57-
if impl(ghc >=9.2.1)
58-
build-depends: ghc-exactprint >= 1.5
59-
else
60-
build-depends: ghc-exactprint >= 0.6.4 && <1.1
61-
6258
default-language: Haskell2010
6359
default-extensions:
6460
DataKinds

plugins/hls-fourmolu-plugin/hls-fourmolu-plugin.cabal

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ library
3030
build-depends:
3131
, base >=4.12 && <5
3232
, filepath
33+
, fourmolu ^>= 0.14
3334
, ghc
3435
, ghc-boot-th
3536
, ghcide == 2.6.0.0
@@ -41,14 +42,6 @@ library
4142
, text
4243
, transformers
4344

44-
if impl(ghc >= 9.0) && impl(ghc < 9.2)
45-
build-depends: fourmolu ^>= 0.11
46-
else
47-
build-depends: fourmolu ^>= 0.14
48-
49-
-- fourmolu 0.9.0 fails to build on Windows CI for reasons unknown
50-
if impl(ghc >= 9.2) && os(windows) && impl(ghc < 9.4)
51-
build-depends: fourmolu > 0.9.0.0 || < 0.9.0.0
5245
default-language: Haskell2010
5346

5447
test-suite tests

plugins/hls-overloaded-record-dot-plugin/hls-overloaded-record-dot-plugin.cabal

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ common warnings
2323

2424
library
2525
import: warnings
26-
if impl(ghc < 9.2)
27-
buildable: False
28-
else
29-
buildable: True
3026
exposed-modules: Ide.Plugin.OverloadedRecordDot
3127
build-depends:
3228
, base >=4.16 && <5
@@ -48,10 +44,6 @@ library
4844

4945
test-suite tests
5046
import: warnings
51-
if impl(ghc < 9.2)
52-
buildable: False
53-
else
54-
buildable: True
5547
default-language: GHC2021
5648
type: exitcode-stdio-1.0
5749
hs-source-dirs: test

0 commit comments

Comments
 (0)