-
-
Notifications
You must be signed in to change notification settings - Fork 355
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
hls-hlint-plugin: Build fails with ghc-lib >= 9.0 and ghc <= 8.10.7 #2728
Comments
My initial assumption about what the problem is, was wrong.
I could fix the problem for this specific config by replacing the above line with
The other solution did not work because then I got a mismatch in the type of BufSpan (the ghc or ghc lib BufSpan vs. the IDE Compat BufSpan). |
That fix isn‘t a fix after all. We get the following runtime error:
|
cc @pepeiborra |
I've actually also observed that runtime error in HLS from |
Currently you need to build hlint with the ghc-lib flag until ndmitchell/hlint#1376 is fixed and released |
Is there an example for how to build hlint with the ghc-lib with nix? Do you override the Haskell package HLS inputs somehow? |
Looks like there is an incomplete pattern match in the |
Presumably from here? It doesn't look non-exhaustive to me and it doesn't look like its changed in a recent GHC version to add a new constructor. Am I missing something obvious? |
The runtime error in nixpkgs could totally be my fault, because I have added this line in nixpkgs to make the setup compile: |
Ohhhh, yes indeed I think that could be the culprit Stepping back for a second, and sorry if this is obvious as I'm a bit new to GHC Lib, but shouldn't we be trying to compile GHC-Lib 8.10.7 with GHC 8.10.7? Can we force the package bounds in the nix derivation? [edit below] Im wondering if |
I believe your initial assessment was indeed correct. The pragma line should be changed from
to
It was changed from the latter to the former in #2128, probably by mistake, when updating the pattern synonym to take two arguments instead of one. |
I think it has been fixed in a recent commit |
The change to
would assert that the second field must be nothing, which is what caused the non-exhaustive pattern match error. The correct version would be
but that is just equivalent to
which is what the other branch of the (All of these versions only works with the ghc-9 api, since that's where GHC.RealSrcSpan was changed to have two fields instead of one) |
Ah, well I hadn‘t dabbled with pattern synonyms before and got confused somewhere along the way. The easiest way for me to try this is out is waiting for the next release. Depending on when that happens I‘d rather wait for that. |
@maralorn do you know when that release will be? I'd love to get this working again and am happy to try to build it if I can get some instructions on how to do so. It wasn't super obvious how to do so in the nixpkgs repo |
Is there a workaround for getting hlint to work with hls on 8.10.7 in nix? |
@shinzui Since this is now a downstream issue, I have continued the discussion here: NixOS/nixpkgs#168064 |
GHC 8.10.7 is no longer supported |
I am trying to build hls-hlint-plugin in the above mentioned combination.
I get the following error:
I might be holding it wrong, but my impression is, that this line should not compare ghc, but ghc-lib versions.
haskell-language-server/plugins/hls-hlint-plugin/src/Ide/Plugin/Hlint.hs
Line 139 in 3b687a5
If someone more knowledgeable (e.g. @fendor) could tell me if that’s right, I‘d be very grateful.
The text was updated successfully, but these errors were encountered: