-
-
Notifications
You must be signed in to change notification settings - Fork 391
GHC ABIs don't match! GHC 9.2.4 from ghcup #3225
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
Comments
Can confirm, I got this too just today trying to make a PR for the |
I have the same problem, also using ghcup. I’m not using stack btw. |
Same problem, with a cabal cradle, on NixOS.
|
The problem in my case seems to have resulted from my Nix configuration: I was getting GHC from |
Building from source via ghcup compile ... solved the problem for me. |
I have the same problem. I'm also on Debian testing with these tool versions:
Edit: I have been informed that I can build using source from git instead of from hackage using this variation of the compile command which does work for me:
I've tried uninstalling and reinstalling tools through ghcup in different orders, deleting I have not tried different ghc versions because the project I am working on requires 9.2.4. |
Does anyone know how to get a haskell-language-server from Nix for a given compiler? Our project's stack.yaml / snapshot.yaml specify Also, #1926 (comment) may be relevant. |
I've hit the same error as OP with HLS 1.9.1.0 since upgrading to GHC 9.4.4, with everything being installed via GHCUp. What's very odd is that the failure seems to depend on which HLS is set as the default, rather than which one is actually used:
I'm on Manjaro Linux, which uses the Fedora GHC binaries. @hasufell Since this seems like it could be a GHCUp distribution issue, any ideas? |
Thanks! Good to see that the problem is known and understood (even if it doesn't explain most earlier comments in this thread). |
This has recently started happening to me again with GHC |
I had the same happen recently with 9.6.3 and 9.6.4, yeah 🤔 |
Confirmed that reverting my LTS snapshot to point to 9.4.x fixes the issue, and my LSP boots now. |
@fosskers If you use stack, then the HLS binaries may not be compatible. This is known, because stack doesn't pick GHC bindists as ghcup does. You can fix that with the stack-ghcup integration: https://www.haskell.org/ghcup/guide/#strategy-1-stack-hooks-new-recommended |
Oh interesting, thank you. |
Confirmed! My |
I am also getting the same error with GHC 9.10.1, Stack 3.3.1, and HLS 2.9.0.1. Installed using GHCup. Reverted GHC to 9.4.8, but none of the LSP features work in Neovim. I did manage to have it working before with a setup using Cabal, GHC, and HLS installed from Fedora 41 repositories, but with Stack and GHCup I was unable to get it working a single time. |
@maxwelljens Hi! Are you sure you configured stack to use GHCup's GHC bindists? https://www.haskell.org/ghcup/guide/#strategy-1-stack-hooks-new-recommended That's a requirement. |
@fendor Yes. I have been troubleshooting it hard for several hours. Tried the above, tried the second strategy, tried several different HLS-capable GHC versions in GHCup, different Stack versions in GHCup, even Cabal versions, etc. I went back to my old setup. Realised that HLS would not work with my old Cabal setup because there was Even tried deleting all the Stack-related files and using the Fedora repository distribution of Stack. Same issues persisted. It just does not appear that HLS wants to work with Stack. Not sure if it is specific to Neovim, perhaps, but I have been unable to find any hard clues that point exactly to the source of the problem. |
To properly investigate this, you need to provide some logs! My working theory is, that if cabal and HLS work, then stack and HLS must work as well, since HLS primarily interacts with GHC. The build tools are only used to extract the compilation options and then not used further. First, don't use the Fedora repository for GHC while using HLS installed via GHCup. HLS binaries installed via GHCup are only functional if used in conjunction with GHC binaries installed via GHCup. bug this, I would like to know the following: $ stack path --compiler-exe Executed in the root of your project which you are trying to use HLS in. $ haskell-language-server-wrapper --debug <some-path-in-your-project> If this invocation doesn't produce the GHC ABIs don't match error, then you likely have an issue in your editor setup. At last, you can try to delete |
Thank you for the very quick response. To be clear: yes, I did uninstall the Fedora package whenever I used GHCup to avoid conflicts, and vice-versa. I did go back to GHCup again, and I noticed that HLS does not work with Cabal projects either. Here is the output of Here is the output of Here is the output of /home/mjensen/.ghcup/ghc/9.10.1/bin/ghc Deleting caches did not change the situation either. The projects themselves seem to compile just fine, using Cabal and Stack respectively. The issue is only about what OP describes: a mysterious mismatch in GHC ABIs that prevent HLS from working. |
Ah, are you saying HLS never worked, neither with cabal not with stack? What system are you running? Maybe there is an incorrect arch mapping for HLS in GHCup. |
It does work, but only with the Fedora My system is Fedora 41, running Linux kernel version 6.12.11-200.fc41.x86_64. |
Might be a bug in GHCup, we might be using the wrong plattform. I am reaching out to GHCup to investigate. Thanks for your patience, I can only imagine how frustrating this debugging session must have been! |
As a workaround, you can build from source via |
Issue in GHCup: haskell/ghcup-metadata#247 |
I am trying the workaround with
|
sigh my mistake. Couple of technicalities, HLS 2.9.0.1 is a binary-only release, so it isn't on hackage (which we will change from now on), and Likely |
Awesome! That did the trick. Both Cabal and Stack projects work now. Once again, thank you very much for the timely responses. |
Your environment
$ haskell-language-server-wrapper --version haskell-language-server version: 1.8.0.0 (GHC: 9.4.2) (PATH: $HOME/.ghcup/hls/1.8.0.0/lib/haskell-language-server-1.8.0.0/bin/haskell-language-server-wrapper)
Which OS do you use? Debian Testing
Which version of GHC do you use and how did you install it? 9.2.4 with ghcup (reinstalled)
How is your project built (alternative: link to the project)? Cabal (https://github.com/MaybeJustJames/zephyr)
Which LSP client (editor/plugin) do you use? Emacs+lsp-mode
Which version of HLS do you use and how did you install it? 1.8.0.0 from ghcup
Have you configured HLS in any way (especially: a
hie.yaml
file)? NoSteps to reproduce
run
haskell-language-server-wrapper -d --lsp
Expected behaviour
Should start lsp server and not produce errors
Actual behaviour
Says
GHC ABIs don't match!
and quits.Debug information
Full output from running
haskell-language-server-wrapper -d --lsp
:The text was updated successfully, but these errors were encountered: