Skip to content

Commit 8a3896e

Browse files
committed
Move plugin ghc support conditionals into .cabal file
Having them in the cabal.project file is a very neat way to enable/disable a plugin, but it negatively affects Hackage users as they can no longer trivially install HLS from Hackage. This discussion might be revisited in the future, but not during a release process.
1 parent 27a7460 commit 8a3896e

File tree

2 files changed

+21
-24
lines changed

2 files changed

+21
-24
lines changed

cabal.project

+2-8
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,11 @@ constraints:
4141
bitvec -simd,
4242

4343

44+
4445
if impl(ghc >= 9.9)
45-
benchmarks: False
46-
constraints:
47-
lens >= 5.3.2,
48-
-- See
49-
-- https://github.com/haskell/stylish-haskell/issues/479
50-
-- https://github.com/ennocramer/floskell/pull/82
51-
-- https://github.com/ndmitchell/hlint/pull/1594
52-
haskell-language-server -stylishHaskell -hlint -retrie -splice -floskell,
5346
allow-newer:
5447
haddock-library:base,
5548
haddock-library:containers,
49+
benchmarks: False
5650
else
5751
benchmarks: True

haskell-language-server.cabal

+19-16
Original file line numberDiff line numberDiff line change
@@ -619,13 +619,13 @@ flag retrie
619619
manual: True
620620

621621
common retrie
622-
if flag(retrie)
622+
if flag(retrie) && impl(ghc < 9.10)
623623
build-depends: haskell-language-server:hls-retrie-plugin
624624
cpp-options: -Dhls_retrie
625625

626626
library hls-retrie-plugin
627627
import: defaults, pedantic, warnings
628-
if !flag(retrie)
628+
if !(flag(retrie) && impl(ghc < 9.10))
629629
buildable: False
630630
exposed-modules: Ide.Plugin.Retrie
631631
hs-source-dirs: plugins/hls-retrie-plugin/src
@@ -656,7 +656,7 @@ library hls-retrie-plugin
656656

657657
test-suite hls-retrie-plugin-tests
658658
import: defaults, pedantic, test-defaults, warnings
659-
if !flag(retrie)
659+
if !(flag(retrie) && impl(ghc < 9.10))
660660
buildable: False
661661
type: exitcode-stdio-1.0
662662
hs-source-dirs: plugins/hls-retrie-plugin/test
@@ -687,13 +687,14 @@ flag hlint
687687
manual: True
688688

689689
common hlint
690-
if flag(hlint)
690+
if flag(hlint) && impl(ghc < 9.10)
691691
build-depends: haskell-language-server:hls-hlint-plugin
692692
cpp-options: -Dhls_hlint
693693

694694
library hls-hlint-plugin
695695
import: defaults, pedantic, warnings
696-
if !flag(hlint)
696+
-- https://github.com/ndmitchell/hlint/pull/1594
697+
if !(flag(hlint) && impl(ghc < 9.10))
697698
buildable: False
698699
exposed-modules: Ide.Plugin.Hlint
699700
hs-source-dirs: plugins/hls-hlint-plugin/src
@@ -735,7 +736,7 @@ library hls-hlint-plugin
735736

736737
test-suite hls-hlint-plugin-tests
737738
import: defaults, pedantic, test-defaults, warnings
738-
if !flag(hlint)
739+
if !(flag(hlint) && impl(ghc < 9.10))
739740
buildable: False
740741
type: exitcode-stdio-1.0
741742
hs-source-dirs: plugins/hls-hlint-plugin/test
@@ -919,13 +920,13 @@ flag splice
919920
manual: True
920921

921922
common splice
922-
if flag(splice)
923+
if flag(splice) && impl(ghc < 9.10)
923924
build-depends: haskell-language-server:hls-splice-plugin
924925
cpp-options: -Dhls_splice
925926

926927
library hls-splice-plugin
927928
import: defaults, pedantic, warnings
928-
if !flag(splice)
929+
if !(flag(splice) && impl(ghc < 9.10))
929930
buildable: False
930931
exposed-modules:
931932
Ide.Plugin.Splice
@@ -955,7 +956,7 @@ library hls-splice-plugin
955956

956957
test-suite hls-splice-plugin-tests
957958
import: defaults, pedantic, test-defaults, warnings
958-
if !flag(splice)
959+
if !(flag(splice) && impl(ghc < 9.10))
959960
buildable: False
960961
type: exitcode-stdio-1.0
961962
hs-source-dirs: plugins/hls-splice-plugin/test
@@ -1404,13 +1405,14 @@ flag floskell
14041405
manual: True
14051406

14061407
common floskell
1407-
if flag(floskell)
1408+
if flag(floskell) && impl(ghc < 9.10)
14081409
build-depends: haskell-language-server:hls-floskell-plugin
14091410
cpp-options: -Dhls_floskell
14101411

14111412
library hls-floskell-plugin
14121413
import: defaults, pedantic, warnings
1413-
if !flag(floskell)
1414+
-- https://github.com/ennocramer/floskell/pull/82
1415+
if !(flag(floskell) && impl(ghc < 9.10))
14141416
buildable: False
14151417
exposed-modules: Ide.Plugin.Floskell
14161418
hs-source-dirs: plugins/hls-floskell-plugin/src
@@ -1426,7 +1428,7 @@ library hls-floskell-plugin
14261428

14271429
test-suite hls-floskell-plugin-tests
14281430
import: defaults, pedantic, test-defaults, warnings
1429-
if !flag(floskell)
1431+
if !(flag(floskell) && impl(ghc < 9.10))
14301432
buildable: False
14311433
type: exitcode-stdio-1.0
14321434
hs-source-dirs: plugins/hls-floskell-plugin/test
@@ -1560,13 +1562,14 @@ flag stylishHaskell
15601562
manual: True
15611563

15621564
common stylishHaskell
1563-
if flag(stylishHaskell)
1565+
if flag(stylishHaskell) && impl(ghc < 9.10)
15641566
build-depends: haskell-language-server:hls-stylish-haskell-plugin
15651567
cpp-options: -Dhls_stylishHaskell
15661568

15671569
library hls-stylish-haskell-plugin
15681570
import: defaults, pedantic, warnings
1569-
if !flag(stylishHaskell)
1571+
-- https://github.com/haskell/stylish-haskell/issues/479
1572+
if !(flag(stylishHaskell) && impl(ghc < 9.10))
15701573
buildable: False
15711574
exposed-modules: Ide.Plugin.StylishHaskell
15721575
hs-source-dirs: plugins/hls-stylish-haskell-plugin/src
@@ -1585,7 +1588,7 @@ library hls-stylish-haskell-plugin
15851588

15861589
test-suite hls-stylish-haskell-plugin-tests
15871590
import: defaults, pedantic, test-defaults, warnings
1588-
if !flag(stylishHaskell)
1591+
if !(flag(stylishHaskell) && impl(ghc < 9.10))
15891592
buildable: False
15901593
type: exitcode-stdio-1.0
15911594
hs-source-dirs: plugins/hls-stylish-haskell-plugin/test
@@ -2027,7 +2030,7 @@ test-suite func-test
20272030
if flag(eval)
20282031
cpp-options: -Dhls_eval
20292032
-- formatters
2030-
if flag(floskell)
2033+
if flag(floskell) && impl(ghc < 9.10)
20312034
cpp-options: -Dhls_floskell
20322035
if flag(fourmolu)
20332036
cpp-options: -Dhls_fourmolu

0 commit comments

Comments
 (0)