Skip to content

GHC ABI don't match #2862

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

Closed
marcosh opened this issue Apr 27, 2022 · 5 comments
Closed

GHC ABI don't match #2862

marcosh opened this issue Apr 27, 2022 · 5 comments
Labels
status: needs triage type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@marcosh
Copy link

marcosh commented Apr 27, 2022

Your environment

Which OS do you use:
ArchLinux
Which LSP client (editor/plugin) do you use:
visual studio code + haskell.haskell extension
Describe your project (alternative: link to the project):
https://github.com/marcosh/existential-optics

Issue

When I open an .hs file in visual studio code, HLS starts analyzing the file and produces this output

2022-04-27 09:46:10.2690000 [client] INFO Finding haskell-language-server
2022-04-27 09:46:10.2700000 [client] INFO Checking for ghcup installation
2022-04-27 09:46:10.2700000 [client] INFO Trying to find the ghcup executable in: /home/marcosh/.ghcup/bin/ghcup
2022-04-27 09:46:10.2760000 [client] INFO Executing '/home/marcosh/.ghcup/bin/ghcup --no-verbose upgrade' in cwd '/home/marcosh'
2022-04-27 09:46:10.3620000 [client] INFO Checking for ghcup installation
2022-04-27 09:46:10.3620000 [client] INFO Trying to find the ghcup executable in: /home/marcosh/.ghcup/bin/ghcup
2022-04-27 09:46:10.3670000 [client] INFO Executing '/home/marcosh/.ghcup/bin/ghcup --no-verbose list -t hls -c installed -r' in cwd '/home/marcosh'
2022-04-27 09:46:10.4040000 [client] INFO Checking for ghcup installation
2022-04-27 09:46:10.4040000 [client] INFO Trying to find the ghcup executable in: /home/marcosh/.ghcup/bin/ghcup
2022-04-27 09:46:10.4090000 [client] INFO Executing '/home/marcosh/.ghcup/bin/ghcup --no-verbose list -t cabal -c installed -r' in cwd '/home/marcosh'
2022-04-27 09:46:10.4440000 [client] INFO Checking for ghcup installation
2022-04-27 09:46:10.4440000 [client] INFO Trying to find the ghcup executable in: /home/marcosh/.ghcup/bin/ghcup
2022-04-27 09:46:10.4490000 [client] INFO Executing '/home/marcosh/.ghcup/bin/ghcup --no-verbose list -t stack -c installed -r' in cwd '/home/marcosh'
2022-04-27 09:46:10.4900000 [client] INFO Checking for ghcup installation
2022-04-27 09:46:10.4900000 [client] INFO Trying to find the ghcup executable in: /home/marcosh/.ghcup/bin/ghcup
2022-04-27 09:46:10.4960000 [client] INFO Executing '/home/marcosh/.ghcup/bin/ghcup --no-verbose list -t ghc -c available -r' in cwd '/home/marcosh'
2022-04-27 09:46:10.5410000 [client] INFO Checking for ghcup installation
2022-04-27 09:46:10.5410000 [client] INFO Trying to find the ghcup executable in: /home/marcosh/.ghcup/bin/ghcup
2022-04-27 09:46:10.5460000 [client] INFO Executing '/home/marcosh/.ghcup/bin/ghcup --no-verbose whereis hls 1.7.0.0' in cwd '/home/marcosh'
2022-04-27 09:46:10.5610000 [client] INFO Checking for ghcup installation
2022-04-27 09:46:10.5610000 [client] INFO Trying to find the ghcup executable in: /home/marcosh/.ghcup/bin/ghcup
2022-04-27 09:46:10.5670000 [client] INFO Executing '/home/marcosh/.ghcup/bin/ghcup --no-verbose whereis cabal 3.6.2.0' in cwd '/home/marcosh'
2022-04-27 09:46:10.5820000 [client] INFO Checking for ghcup installation
2022-04-27 09:46:10.5820000 [client] INFO Trying to find the ghcup executable in: /home/marcosh/.ghcup/bin/ghcup
2022-04-27 09:46:10.5880000 [client] INFO Executing '/home/marcosh/.ghcup/bin/ghcup --no-verbose whereis stack 2.7.5' in cwd '/home/marcosh'
2022-04-27 09:46:10.6100000 [client] INFO Checking for ghcup installation
2022-04-27 09:46:10.6100000 [client] INFO Trying to find the ghcup executable in: /home/marcosh/.ghcup/bin/ghcup
2022-04-27 09:46:10.6170000 [client] INFO Executing '/home/marcosh/.ghcup/bin/ghcup --no-verbose whereis ghc 8.10.7' in cwd '/home/marcosh'
2022-04-27 09:46:10.6320000 [client] INFO Checking for ghcup installation
2022-04-27 09:46:10.6320000 [client] INFO Trying to find the ghcup executable in: /home/marcosh/.ghcup/bin/ghcup
2022-04-27 09:46:10.6390000 [client] INFO Executing '/home/marcosh/.ghcup/bin/ghcup --no-verbose run --hls 1.7.0.0 --cabal 3.6.2.0 --stack 2.7.5 --ghc 8.10.7 --install' in cwd '/home/marcosh'
2022-04-27 09:46:10.6860000 [client] INFO Working out the project GHC version. This might take a while...
2022-04-27 09:46:10.6860000 [client] INFO Executing 'haskell-language-server-wrapper --project-ghc-version' in cwd '/home/marcosh/projects/haskell/existential-optics'
2022-04-27 09:46:11.3940000 [client] INFO The GHC version for the project or file: 9.0.2
2022-04-27 09:46:11.6790000 [client] INFO Platform constants: Linux_UnknownLinux, A_64
2022-04-27 09:46:11.6800000 [client] INFO Checking for ghcup installation
2022-04-27 09:46:11.6800000 [client] INFO Trying to find the ghcup executable in: /home/marcosh/.ghcup/bin/ghcup
2022-04-27 09:46:11.6920000 [client] INFO Executing '/home/marcosh/.ghcup/bin/ghcup --no-verbose list -t hls -c installed -r' in cwd '/home/marcosh'
2022-04-27 09:46:11.7410000 [client] INFO Checking for ghcup installation
2022-04-27 09:46:11.7410000 [client] INFO Trying to find the ghcup executable in: /home/marcosh/.ghcup/bin/ghcup
2022-04-27 09:46:11.7470000 [client] INFO Executing '/home/marcosh/.ghcup/bin/ghcup --no-verbose whereis bindir' in cwd '/home/marcosh'
2022-04-27 09:46:11.7640000 [client] INFO Checking for ghcup installation
2022-04-27 09:46:11.7640000 [client] INFO Trying to find the ghcup executable in: /home/marcosh/.ghcup/bin/ghcup
2022-04-27 09:46:11.7710000 [client] INFO Executing '/home/marcosh/.ghcup/bin/ghcup --no-verbose whereis hls 1.7.0.0' in cwd '/home/marcosh'
2022-04-27 09:46:11.7880000 [client] INFO Checking for ghcup installation
2022-04-27 09:46:11.7880000 [client] INFO Trying to find the ghcup executable in: /home/marcosh/.ghcup/bin/ghcup
2022-04-27 09:46:11.7980000 [client] INFO Executing '/home/marcosh/.ghcup/bin/ghcup --no-verbose whereis ghc 9.0.2' in cwd '/home/marcosh'
2022-04-27 09:46:11.8160000 [client] INFO Checking for ghcup installation
2022-04-27 09:46:11.8160000 [client] INFO Trying to find the ghcup executable in: /home/marcosh/.ghcup/bin/ghcup
2022-04-27 09:46:11.8270000 [client] INFO Executing '/home/marcosh/.ghcup/bin/ghcup --no-verbose run --hls 1.7.0.0 --cabal 3.6.2.0 --stack 2.7.5 --ghc 9.0.2 --install' in cwd '/home/marcosh'
2022-04-27 09:46:11.8760000 [client] INFO Activating the language server in working dir: /home/marcosh/projects/haskell/existential-optics (the workspace folder)
2022-04-27 09:46:11.8760000 [client] INFO run command: /tmp/ghcup-ghc-9.0.2_cabal-3.6.2.0_hls-1.7.0.0_stack-2.7.5/haskell-language-server-wrapper --lsp
2022-04-27 09:46:11.8760000 [client] INFO debug command: /tmp/ghcup-ghc-9.0.2_cabal-3.6.2.0_hls-1.7.0.0_stack-2.7.5/haskell-language-server-wrapper --lsp
2022-04-27 09:46:11.8760000 [client] INFO server environment variables:
2022-04-27 09:46:11.8770000 [client] INFO   PATH=/tmp/ghcup-ghc-9.0.2_cabal-3.6.2.0_hls-1.7.0.0_stack-2.7.5:/home/marcosh/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/home/marcosh/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/var/lib/snapd/snap/bin
2022-04-27 09:46:11.8810000 [client] INFO Starting language server
Found "/home/marcosh/projects/haskell/existential-optics/hie.yaml" for "/home/marcosh/projects/haskell/existential-optics/a"
Run entered for haskell-language-server-wrapper(haskell-language-server-wrapper) Version 1.7.0.0 x86_64 ghc-9.2.2
Current directory: /home/marcosh/projects/haskell/existential-optics
Operating system: linux
Arguments: ["--lsp"]
Cradle directory: /home/marcosh/projects/haskell/existential-optics
Cradle type: Stack

Tool versions found on the $PATH
cabal:		3.6.2.0
stack:		2.7.5
ghc:		9.0.2


Consulting the cradle to get project GHC version...
Project GHC version: 9.0.2
haskell-language-server exe candidates: ["haskell-language-server-9.0.2","haskell-language-server"]
Launching haskell-language-server exe at:/tmp/ghcup-ghc-9.0.2_cabal-3.6.2.0_hls-1.7.0.0_stack-2.7.5/haskell-language-server-9.0.2
�[0;31mGHC ABIs don't match!�[0m
�[0;31m�[0m
�[0;31mExpected: Cabal-3.4.1.0:bd8a150942e263abdddf4556ba717d44 array-0.5.4.0:6e4d88804dfcdc3d22d4fbacc50bc1d6 base-4.15.1.0:fb0259dfc517fcf0cbf3b39385ccaa15 binary-0.8.8.0:cf20238660376a402396a5d4742a523c bytestring-0.10.12.1:52acb6e3c7139e62dcd0ee5efc262d92 containers-0.6.4.1:4ab0fc030c5cfe45e9e1c4e13244ae50 deepseq-1.4.5.0:4b79675dd6c09afbf9ddae98b204c1c7 directory-1.3.6.2:889ae771f88259f6e9d2b87abb376354 exceptions-0.10.4:50818d159f922b8f71a558855927f976 filepath-1.4.2.1:16a12e277861b40a192400d87b60b411 ghc-9.0.2:fb68bb7a9a06b02609a90ffd8a188a06 ghc-bignum-1.1:4748ab2ad2c09a7b11142e1827d09dd8 ghc-boot-9.0.2:a2d3e78df9bddf082292c2459e23363d ghc-boot-th-9.0.2:3d0f1ef586376a9243dec57892d89111 ghc-compact-0.1.0.0:e5086a2c2f77fd7772508746f65d6936 ghc-heap-9.0.2:3c179a165a9dd5e1fbae0d1f0caa9aba ghc-prim-0.7.0:73976e16cfa5a2a403911029813074eb ghci-9.0.2:2f493b8e7d2e752fbad919136afab3ac haskeline-0.8.2:b1436d710cd2d6d67babca1a8a13b84e hpc-0.6.1.0:2ceabfcda18ab6a6c855ec5f8f158da6 integer-gmp-1.1:eaab7e0252d2a6f7f57f3afab6359f5d libiserv-9.0.2:c5ff0c8c005016d81737b7720b9576c5 mtl-2.2.2:5aed3b46593d26245d63d0d44730bcb6 parsec-3.1.14.0:2a8eeb86f7c06b99558e2daf0779bcea pretty-1.1.3.6:3db6d05f1f02d5c09e348036ceefd23e process-1.6.13.2:64bd8619ed599a2fa9e254c2b89a9b65 rts-1.0.2: stm-2.5.0.0:cff0a4dd2d19d828eb1e1e34d25a5da6 template-haskell-2.17.0.0:fd6ed37874e523bb0bfb3da225da7375 terminfo-0.4.1.5:fc0f06acb01c1aaed286784e5c1172c1 text-1.2.5.0:02ce341e2cba6b5fd9e9868681383053 time-1.9.3:3e763282a8dead59e113f3ec407a60bf transformers-0.5.6.2:6b2415e00ad52111d1ef952610844ea3 unix-2.7.2.2:d326cecdc12930f6a83aeccaa5b7aead xhtml-3000.2.2.1:97ae940ac14864fca6f3dbd08dc3f6ed�[0m
�[0;31mGot:      Cabal-3.4.1.0:ab74f2c3161b496273c112bc304128c5 array-0.5.4.0:60b03bb14f2fb672c7d45b226c353ec1 base-4.15.1.0:b7bb9d150077ce1eefa2cb650417b227 binary-0.8.8.0:fa88338820a9bd0b504bf213a8e72719 bytestring-0.10.12.1:28912719bcbb836263ecf818c4004d98 containers-0.6.4.1:bf00c7599db8af6c073a044b172248dc deepseq-1.4.5.0:0cf68babae66ababbe71ea47b01804fa directory-1.3.6.2:b82e95002902f0bdb50c05dc51b225ca exceptions-0.10.4:a3c9fa639722ef9d50341c6cd2385d93 filepath-1.4.2.1:f9de4a7f0f552804d24b9223eb693d53 ghc-9.0.2:0cab42b9f0b20868d0736b02935b8866 ghc-bignum-1.1:15967d121cc201c802258aaa5c934bcb ghc-boot-9.0.2:039cdff4f5fc2e0f39b30a6c78d62d65 ghc-boot-th-9.0.2:1fac6b56dc58f2dcc9db351a93d9ba82 ghc-compact-0.1.0.0:d89810b7bdcf2139de5c6556a1ac4a7f ghc-heap-9.0.2:15ea845dceccc5a82c8f166b98b06abb ghc-prim-0.7.0:73976e16cfa5a2a403911029813074eb ghci-9.0.2:44e4f88c631e291af61ce91b76fbea09 haskeline-0.8.2:5361530f9aec03de9188d994aa62c524 hpc-0.6.1.0:b68473d0ac443f4d1d885c4e320214e9 integer-gmp-1.1:6e51ea8b50a9fe5db3b235fec13d166d libiserv-9.0.2:298c71b0c3b7568c92e50683303fba08 mtl-2.2.2:281e19dd29c936cd4c9d8e152d50033f parsec-3.1.14.0:1ba7fb990e3bfe3823a06a9994c407da pretty-1.1.3.6:0afd3b4e13803cee680552ac40e3619e process-1.6.13.2:d13b828d4126001ef8415f7d2bba1fae rts-1.0.2: stm-2.5.0.0:2abafd3d3074be9dbfcd04c00dc359a8 template-haskell-2.17.0.0:0f82000709e76bc945a8f1d61f8c081d terminfo-0.4.1.5:78bfad4e1a38582ba34d5d263d1d1f75 text-1.2.5.0:cf399f9a19fcee928a7fc309096a7c48 time-1.9.3:62b52209105ec2b6827bf78dfbd8cb45 transformers-0.5.6.2:2a63be5f37cb981a011ed62743dba8c8 unix-2.7.2.2:db9a0e7818cd41e42f6ec7fe4546e402 xhtml-3000.2.2.1:6106604d25403bc5424f906bf9952fe2�[0m
[Info  - 11:46:14] Connection to server got closed. Server will restart.

I tried to reproduce the issue on the command line and I got to the following, which seems to be the origin of the problem

~ > ghc-pkg-9.0.2 --global --global-package-db ".ghcup/ghc/9.0.2/lib/ghc-9.0.2/package.conf.d" field ghc-9.0.2 abi
abi: fb68bb7a9a06b02609a90ffd8a188a06

~ > ghc-pkg-9.0.2 --global --global-package-db ".stack/programs/x86_64-linux/ghc-tinfo6-9.0.2/lib/ghc-9.0.2/package.conf.d" field ghc-9.0.2 abi
abi: 0cab42b9f0b20868d0736b02935b8866

I just installed GHCUP, so this behaviour could be related to a pre-existing installation of Stack. I tried to delete manually all the files in .stack-work, ~/.stack/programs and ~/.stack/snapshots but the issue remains

@marcosh marcosh added status: needs triage type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. labels Apr 27, 2022
@wz1000
Copy link
Collaborator

wz1000 commented Apr 27, 2022

See #2857

@marcosh
Copy link
Author

marcosh commented Apr 27, 2022

thanks @wz1000!

That was exactly the issue.

For future reference, I solved it as follows:

  • I added
setup-info-locations:
- setup-info.yaml

to stack.yaml

and I added a new setup-info.yaml file

ghc:
  linux64-tinfo6:
    9.0.2:
      url: "https://downloads.haskell.org/ghc/9.0.2/ghc-9.0.2a-x86_64-fedora27-linux.tar.xz"

@shubham-cpp
Copy link

Hi @marcosh did the same thing as your but didn't manage to resolve it. I'm also facing the same error with emacs lsp-mode as well as neovim's nvim-lspconfig

@marcosh
Copy link
Author

marcosh commented May 2, 2022

@shubham-cpp probably you need to clean your Stack environment with stack clean or stack purge and rebuild all dependencies

@shubham-cpp
Copy link

I'm not using any deps. I've opened a single file and thats about it. No project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

No branches or pull requests

3 participants