Cannot connect to language server with VS Code and GHCup.
pdcxs opened this issue · 3 comments
Your environment
Which OS do you use?
Linux Mint Debian Edition (LMDE 6 'Faye')
Which version of GHC do you use and how did you install it?
I install ghc 9.8.4, it is installed automatically by stack with the install hooks (https://www.haskell.org/ghcup/guide/#stack-integration)
How is your project built (alternative: link to the project)?
I just install GHCup with the command showed in official website of GHCup, while setting up the environment, everything keeps default. Than I use stack to create a new project (stack new first), go into the project directory and open it with VS code. Everything else is set up by vscode Haskell plugin, automatically. The tools I used is:
- ghcup 0.1.50.2
- stack 3.3.1
- hls 2.11.0.0
- cabal 3.12.1.0
- ghc 9.8.4
The project snapshot is: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/23/27.yaml
Which LSP client (editor/plugin) do you use?
vscode and Haskell plugin
Which version of HLS do you use and how did you install it?
2.11.0.0
Have you configured HLS in any way (especially: a hie.yaml file)?
No
Steps to reproduce
Setup ghcup with all default options, install vscode and haskell plugin. Use stack new first to create a project, and use vscode to open it.
Expected behaviour
HLS should automatically run.
Actual behaviour
HLS crashes.
Debug information
The error message shows:
No 'hie.yaml' found. Try to discover the project type!
Run entered for haskell-language-server-wrapper(haskell-language-server-wrapper) Version 2.11.0.0 x86_64 ghc-9.10.2
Current directory: /home/pdcxs/first
Operating system: linux
Arguments: ["--lsp"]
Cradle directory: /home/pdcxs/first
Cradle type: Stack
Tool versions found on the $PATH
cabal: 3.12.1.0
stack: 3.3.1
ghc: 9.8.4
Consulting the cradle to get project GHC version...
2025-07-11T18:00:33.494671Z | Debug | stack --stack-yaml /home/pdcxs/first/stack.yaml setup --silent
2025-07-11T18:00:34.099785Z | Debug | stack --stack-yaml /home/pdcxs/first/stack.yaml exec ghc -- --numeric-version
Project GHC version: 9.8.4
haskell-language-server exe candidates: ["haskell-language-server-9.8.4","haskell-language-server"]
Launching haskell-language-server exe at:/home/pdcxs/.ghcup/tmp/ghcup-ghc-9.8.4_cabal-3.12.1.0_hls-2.11.0.0_stack-3.3.1/haskell-language-server-9.8.4
2025-07-11T18:00:34.131818Z | Debug | stack --stack-yaml /home/pdcxs/first/stack.yaml setup --silent
2025-07-11T18:00:34.861108Z | Debug | stack --stack-yaml /home/pdcxs/first/stack.yaml exec ghc -- -v0 -package-env=- -ignore-dot-ghci -e Control.Monad.join (Control.Monad.fmap System.IO.putStr System.Environment.getExecutablePath)
2025-07-11T18:00:34.883631Z | Debug | stack --stack-yaml /home/pdcxs/first/stack.yaml setup --silent
2025-07-11T18:00:35.436386Z | Debug | stack --stack-yaml /home/pdcxs/first/stack.yaml exec ghc -- --print-libdir
�[0;31mGHC ABIs don't match!�[0m
�[0;31m�[0m
�[0;31mExpected: Cabal-3.10.3.0:c974a53f4557b15c5a5b83c8afbd1c5b Cabal-syntax-3.10.3.0:33b6c804bd7f3e83351a7cb21ca8f72c array-0.5.8.0:3268a03d12c0835d5fae5919d60ee172 base-4.19.2.0:7f8f6276ca9d7bed752311cfc5aa6553 binary-0.8.9.1:2b2576b0e4434c392c3efd775bd454f6 bytestring-0.12.1.0:234d51aa043bc1c064238833ef03da35 containers-0.6.8:e5d2040d5888e5a2522e17b1efcd3b21 deepseq-1.5.1.0:c5fdb4b6aa633acabddf0e73eb40bb2a directory-1.3.8.5:36683f9132caeecb2fb13ba957264541 exceptions-0.10.7:39a9f368e3daeb92eaa4bf7c61fac0ee filepath-1.4.301.0:d659d2f0dfc41cdc6acc8682489b5579 ghc-9.8.4:cbe60f5416b0bfbcc5ba75785c0596d5 ghc-bignum-1.3:9bdb24c11acde848c5acb89f05dd13b6 ghc-boot-9.8.4:7a3e850133a0edc418671d4a57ac6c1d ghc-boot-th-9.8.4:be769483d58b8904f0419ef584758a18 ghc-compact-0.1.0.0:675c27b960d30be3073cf5eb5caf94dd ghc-heap-9.8.4:1735ed2bc713783c5578174663ac2282 ghc-prim-0.11.0:246f0f44d0eaaff2deb0d111ba71cd24 ghci-9.8.4:88e6ea2e6d6a3dfe92558c5841009841 haskeline-0.8.2.1:1dcd83121adda4f2c2308cd66e4ddda1 hpc-0.7.0.0:57bad49412a3232f56e7472f82e9c12b integer-gmp-1.1:98a42bc2ab0e51ade7711531b2bd6fc1 mtl-2.3.1:4ac0bef291f3b44d7242a3bdccbc4936 parsec-3.1.17.0:dfba0e7f28d579f146d45df4d955d31b pretty-1.1.3.6:eb5e57871b2e080184866ecf36718ef8 process-1.6.25.0:36966fbe9c83f110bc5687db17460c6a rts-1.0.2:22a2dd524ce68dd43407f216c921690e semaphore-compat-1.0.0:0b23aa2b33f87222b775d92a4d12e3fc stm-2.5.3.1:945e925025284e2526d980d8a9149f22 system-cxx-std-lib-1.0:00000000000000000000000000000000 template-haskell-2.21.0.0:5103c4e3c4ba44537d9d6a020c7c1af2 terminfo-0.4.1.6:56a699118cb463a8052b0f9f530a4d48 text-2.1.1:02b3927ec9b363afb99dfd94fd842be9 time-1.12.2:cee9fa5e58c8252a56cbbb72a252312d transformers-0.6.1.0:3f49d63f1f05e81b83d773bb6a3eca16 unix-2.8.6.0:edfbece886504120051be601775e63bb xhtml-3000.2.2.1:342a7a9eef74cf5f92b52c752d7f890f�[0m
�[0;31mGot: Cabal-3.10.3.0:7ba0c94c34f1b0eaa44729b8c52e11d2 Cabal-syntax-3.10.3.0:33b872033580d86249adf7077e205871 array-0.5.8.0:af7184c87d0170a1b6729f26354e3168 base-4.19.2.0:7f8f6276ca9d7bed752311cfc5aa6553 binary-0.8.9.1:d56d8e43eeffc068aac46aa3cde02760 bytestring-0.12.1.0:db944d6c8949e48d10b1c0d17c6ab9a3 containers-0.6.8:1769bea7264b98e34025eaa446ca42cf deepseq-1.5.1.0:e8776946bf7ba488276439e0e71d654e directory-1.3.8.5:fe154dd63b0432fea91af8c197956275 exceptions-0.10.7:2d10f51e4f3ea69d8367edbb5e96704b filepath-1.4.301.0:b966872fce8fb53b58f052b53c18b643 ghc-9.8.4:473ac6172f79a9851b5570d5a25d0a0a ghc-bignum-1.3:9bdb24c11acde848c5acb89f05dd13b6 ghc-boot-9.8.4:6624b2c92099d9b3df4287006b04a558 ghc-boot-th-9.8.4:ca5560dfbc1a21763258ade7dc5cb6f9 ghc-compact-0.1.0.0:48e37cfa321aeddf1ba93e1d84414338 ghc-heap-9.8.4:2471e4e588cfcf07777190acd2ccd05c ghc-prim-0.11.0:246f0f44d0eaaff2deb0d111ba71cd24 ghci-9.8.4:5cfe28760d43f60ac3be81bc2d3204e2 haskeline-0.8.2.1:424f299d330b92f8b441b92d091c180f hpc-0.7.0.0:c549d4240073817ae2c40dbe8fcee47c integer-gmp-1.1:8965eac57d61dff6acc2c3d0043f2875 mtl-2.3.1:4746e9ecd007ff24a1085d69934e7f33 parsec-3.1.17.0:5e09240310b73839a5a3399a64930e96 pretty-1.1.3.6:18651465cfb551e7f944545911b22751 process-1.6.25.0:4552db57cc2b61562508b3ab283d005e rts-1.0.2:22a2dd524ce68dd43407f216c921690e semaphore-compat-1.0.0:6998e4e3f80338b8ec82b001e22dd46d stm-2.5.3.1:8b98ba5a189df6a7adbe4703a0851bed system-cxx-std-lib-1.0:00000000000000000000000000000000 template-haskell-2.21.0.0:e1b8a2d2df0fe6546bf472a02e196bf8 terminfo-0.4.1.6:d55e56665df16f1a86350d4eda10b9df text-2.1.1:6e2b57e53c23c1d0fc4de50adfab4dd5 time-1.12.2:a0e3e86693d97596136bba6692052da9 transformers-0.6.1.0:93f28a57c716bbb4e6f089a5fca7fc2a unix-2.8.6.0:bd54481e3d230eca806e46242e569701 xhtml-3000.2.2.1:72350eeb5b31bf01ea01bab8d8c45f3f�[0m
[Error - 02:00:36] Server process exited with code 1.
[Error - 02:00:36] Server initialization failed.
Message: Pending response rejected since connection got disposed
Code: -32097
[Info - 02:00:36] Connection to server got closed. Server will restart.
true
[Error - 02:00:36] Haskell (first) client: couldn't create connection to server.
Message: Pending response rejected since connection got disposed
Code: -32097
[Error - 02:00:36] Restarting server failed
Message: Pending response rejected since connection got disposed
Code: -32097
I also tried compile the HLS:
ghcup compile hls -g 2.11.0.0 --ghc 9.8.4 --cabal-updateBut it still has the same error.
Hi, thank you for the bug report!
This seems very weird, can you try whether it works with cabal? E.g., mkdir hlstest && cd hlstest && cabal init -n --lib && code ..
ABI issues are usually caused by the stack install setup hook not being set up correctly, can you verify ~/.stack/programs is empty? (Or doesn't contain any GHC programs.)
Sorry, I am setting up an old computer, I previously setup linux mint debian version, then I found the computer is too slow and that is the system where the hls problems happens. Today I switch to CachyOS, and everything works fine in this operating system. As a result, the problem cannot be checked any more and hard to reproduce. I think this question should be caused because I use some different mirrors? I think I should close this issue.
Thanks for your reply!