Skip to content

Merged plugins pull in disabled deps when building with Setup.hs #4100

Closed
@hololeap

Description

@hololeap

I'm taking a look at packaging haskell-language-server-2.7.0.0 for Gentoo Linux. Currently, I have 2.6.0.0 and most plugins installed to my system, although I do not have the hls-fourmolu-plugin or fourmolu packages installed. Just experimenting with the Setup.hs interface, I notice that the fourmolu dependency is being pulled in even when the fourmolu flag is disabled:

cd haskell-language-server-2.7.0.0/
runhaskell Setup.hs configure --flag=-fourmolu

As you can see, it is still looking for fourmolu:

Configuring haskell-language-server-2.7.0.0...
Setup.hs: Encountered missing or private dependencies:
fourmolu >=0.14 && <0.16,
ghcide ==2.7.0.0,
hiedb >=0.6.0.0 && <0.7,
hls-graph ==2.7.0.0,
hls-plugin-api ==2.7.0.0,
lsp >=2.4 && <2.5

The changes made in #3976 seem to be selectively choosing which sub-libraries to build using build-depends:

common fourmolu
if flag(fourmolu)
build-depends: haskell-language-server:hls-fourmolu-plugin
cpp-options: -Dhls_fourmolu

It seems to me that Setup.hs does not seem to have the functionality to handle this, and instead tries to build all sub-libraries mentioned in the .cabal file, regardless of what flags are toggled.

This experiment was done using ghc-9.2.8 and Cabal-3.6.3.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: needs infoNot actionable, because there's missing informationtype: bugSomething isn't right: doesn't work as intended, documentation is missing/outdated, etc..

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions