haskell/haskell-language-server

Cannot build HLS with cabal-add 0.2

Closed this issue · 3 comments

Your environment

ghc 9.12.2, Fedora 42

did cabal update recently

Steps to reproduce

cabal install haskell-language-server --disable-documentation --overwrite-policy=always

Expected behaviour

HLS gets built

Actual behaviour

[16 of 19] Compiling Ide.Plugin.Cabal.CabalAdd ( plugins/hls-cabal-plugin/src/Ide/Plugin/Cabal/CabalAdd.hs, dist/build/hls-cabal-plugin/Ide/Plugin/Cabal/CabalAdd.o, dist/build/hls-cabal-plugin/Ide/Plugin/Cabal/CabalAdd.dyn_o )
plugins/hls-cabal-plugin/src/Ide/Plugin/Cabal/CabalAdd.hs:283:55: error: [GHC-76037]
    Not in scope: data constructor ‘Config’
    Suggested fix:
      Add ‘Config’ to the import list in the import of ‘Ide.Types’
      (at plugins/hls-cabal-plugin/src/Ide/Plugin/Cabal/CabalAdd.hs:(61,1)-(65,82)).
    |
283 |   case executeConfig (validateChanges origPackDescr) (Config {..}) of
    |                                                       ^^^^^^

The reason for this is that in cabal-add 0.2 there were renamings: executeConfig -> executeAddConfig and Config -> AddConfig

Hi, thank you for your bug report!

The upper bound for cabal-add is incorrect, HLS doesn't build with cabal-add-0.2, the PR #4617 fixes this.

Ill make a revision for hackage.

Should be fixed now, please run cabal update and try again!

Thanks for the prompt reply. Now it builds properly!