haskell/haskell-language-server

hls-cabal-plugin-2.11.0: CabalAdd.hs: error: Not in scope: data constructor ‘Config’

juhp opened this issue · 2 comments

juhp commented

Not sure yet what changed but today when I tried to (re)build HLS 2.11 I hit the compilation error below.

Your environment

Which OS do you use? Fedora
Which version of GHC do you use and how did you install it? ghc's from Fedora
How is your project built (alternative: link to the project)?
https://github.com/fedora-haskell/haskell-language-server

Steps to reproduce

https://download.copr.fedorainfracloud.org/results/petersen/haskell-language-server/epel-10-x86_64/09225087-haskell-language-server-ghc9.12/builder-live.log.gz

https://download.copr.fedorainfracloud.org/results/petersen/haskell-language-server/fedora-rawhide-ppc64le/09225359-haskell-language-server/builder-live.log.gz

Expected behaviour

Successful build of HLS 2.11 with cabal-install

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
    |                                                       ^^^^^^

[17 of 19] Compiling Ide.Plugin.Cabal.Outline ( plugins/hls-cabal-plugin/src/Ide/Plugin/Cabal/Outline.hs, dist/build/hls-cabal-plugin/Ide/Plugin/Cabal/Outline.o, dist/build/hls-cabal-plugin/Ide/Plugin/Cabal/Outline.dyn_o )
[18 of 19] Compiling Ide.Plugin.Cabal.Parse ( plugins/hls-cabal-plugin/src/Ide/Plugin/Cabal/Parse.hs, dist/build/hls-cabal-plugin/Ide/Plugin/Cabal/Parse.o, dist/build/hls-cabal-plugin/Ide/Plugin/Cabal/Parse.dyn_o )
Error: [Cabal-7125]
Failed to build lib:hls-cabal-plugin from haskell-language-server-2.11.0.0 (which is required by exe:haskell-language-server-wrapper from haskell-language-server-2.11.0.0 and exe:haskell-language-server from haskell-language-server-2.11.0.0). See the build log above for details.

Debug information

It built okay at the end of May for Fedora 41, 42, and Rawhide on x86_64 and aarch64,
so I am not sure yet what changed: perhaps some dep bound would fix it possibly??

I also brought this up in a Matrix discussion a few days ago:

@fendor:matrix.org: That's expected, cabal-add needs an upper bound

https://hackage.haskell.org/package/cabal-add was updated recently which breaks HLS build.

The latest hackage revision should contain the upper bound, see #4637.
I am confused why this might still be broken?

EDIT: ah, I see, the fork isn't affected by the Hackage revision, and we haven't updated HLS itself, iirc.