Skip to content

Commit

Permalink
Move plugin ghc support conditionals into .cabal file
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
fendor committed Jun 14, 2024
1 parent 4293524 commit b396bfc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 29 deletions.
15 changes: 1 addition & 14 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,4 @@ constraints:
bitvec -simd,


if impl(ghc >= 9.9)
benchmarks: False
constraints:
lens >= 5.3.2,
-- See
-- https://github.com/haskell/stylish-haskell/issues/479
-- https://github.com/ennocramer/floskell/pull/82
-- https://github.com/ndmitchell/hlint/pull/1594
haskell-language-server -stylishHaskell -hlint -retrie -splice -floskell,
allow-newer:
haddock-library:base,
haddock-library:containers,
else
benchmarks: True
benchmarks: True
33 changes: 18 additions & 15 deletions haskell-language-server.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -619,13 +619,13 @@ flag retrie
manual: True

common retrie
if flag(retrie)
if flag(retrie) && impl(ghc < 9.10)
build-depends: haskell-language-server:hls-retrie-plugin
cpp-options: -Dhls_retrie

library hls-retrie-plugin
import: defaults, pedantic, warnings
if !flag(retrie)
if !(flag(retrie) && impl(ghc < 9.10))
buildable: False
exposed-modules: Ide.Plugin.Retrie
hs-source-dirs: plugins/hls-retrie-plugin/src
Expand Down Expand Up @@ -656,7 +656,7 @@ library hls-retrie-plugin

test-suite hls-retrie-plugin-tests
import: defaults, pedantic, test-defaults, warnings
if !flag(retrie)
if !(flag(retrie) && impl(ghc < 9.10))
buildable: False
type: exitcode-stdio-1.0
hs-source-dirs: plugins/hls-retrie-plugin/test
Expand Down Expand Up @@ -687,13 +687,14 @@ flag hlint
manual: True

common hlint
if flag(hlint)
if flag(hlint) && impl(ghc < 9.10)
build-depends: haskell-language-server:hls-hlint-plugin
cpp-options: -Dhls_hlint

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

test-suite hls-hlint-plugin-tests
import: defaults, pedantic, test-defaults, warnings
if !flag(hlint)
if !(flag(hlint) && impl(ghc < 9.10))
buildable: False
type: exitcode-stdio-1.0
hs-source-dirs: plugins/hls-hlint-plugin/test
Expand Down Expand Up @@ -919,13 +920,13 @@ flag splice
manual: True

common splice
if flag(splice)
if flag(splice) && impl(ghc < 9.10)
build-depends: haskell-language-server:hls-splice-plugin
cpp-options: -Dhls_splice

library hls-splice-plugin
import: defaults, pedantic, warnings
if !flag(splice)
if !(flag(splice) && impl(ghc < 9.10))
buildable: False
exposed-modules:
Ide.Plugin.Splice
Expand Down Expand Up @@ -955,7 +956,7 @@ library hls-splice-plugin

test-suite hls-splice-plugin-tests
import: defaults, pedantic, test-defaults, warnings
if !flag(splice)
if !(flag(splice) && impl(ghc < 9.10))
buildable: False
type: exitcode-stdio-1.0
hs-source-dirs: plugins/hls-splice-plugin/test
Expand Down Expand Up @@ -1404,13 +1405,14 @@ flag floskell
manual: True

common floskell
if flag(floskell)
if flag(floskell) && impl(ghc < 9.10)
build-depends: haskell-language-server:hls-floskell-plugin
cpp-options: -Dhls_floskell

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

test-suite hls-floskell-plugin-tests
import: defaults, pedantic, test-defaults, warnings
if !flag(floskell)
if !(flag(floskell) && impl(ghc < 9.10))
buildable: False
type: exitcode-stdio-1.0
hs-source-dirs: plugins/hls-floskell-plugin/test
Expand Down Expand Up @@ -1560,13 +1562,14 @@ flag stylishHaskell
manual: True

common stylishHaskell
if flag(stylishHaskell)
if flag(stylishHaskell) && impl(ghc < 9.10)
build-depends: haskell-language-server:hls-stylish-haskell-plugin
cpp-options: -Dhls_stylishHaskell

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

test-suite hls-stylish-haskell-plugin-tests
import: defaults, pedantic, test-defaults, warnings
if !flag(stylishHaskell)
if !(flag(stylishHaskell) && impl(ghc < 9.10))
buildable: False
type: exitcode-stdio-1.0
hs-source-dirs: plugins/hls-stylish-haskell-plugin/test
Expand Down

0 comments on commit b396bfc

Please sign in to comment.