Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cabal and HLS should coordinate the cabal-version generated by cabal init #10457

Open
fendor opened this issue Oct 12, 2024 · 0 comments
Open

Comments

@fendor
Copy link
Collaborator

fendor commented Oct 12, 2024

Describe the feature request

HLS is about to add support for .cabal files, displaying errors and warnings, offering completions, etc...

The .cabal file generated by cabal init has the latest available cabal-version.

For example:

> mkdir munihac-test 
> cd munihac-test 
> cabal-3.12.1.0 init -n --lib
> head -n 1 munihac-test.cabal
cabal-version:      3.12

This poses a problem for HLS, as HLS depends on ghc, we have to use the Cabal version linked against the ghc version the HLS binary supports. This means that the cabal-version produced by cabal init is by default virtually always newer than what any HLS version supports.

This leads to an ugly error message and most features not working in the hls-cabal-plugin :
image

My suggestion, after talking to @Kleidukos, is to coordinate the default cabal-version produced by cabal init with the support window of HLS. As the HLS-2.9.0.1 release supports GHC 9.4 - 9.10, we consequentially need the default cabal-version to be 3.6 (assuming, ghc-9.4 is linked against Cabal-3.6) for a better UX.

Additional context
HLS issue: haskell/haskell-language-server#4401

The issue is softened once private dependencies allow us to depend on a newer, private Cabal version for the cabal plugin: #9743

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant