-
-
Notifications
You must be signed in to change notification settings - Fork 388
Visual Studio Code: can't get HLS running #3367
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
Thank you for your bug report! This looks like bug in the pre-built binaries. I think you are pretty much forced to build HLS from source at the moment. You may build hls from source via cc @hasufell |
Yes. The reason is that we build the wrapper for every GHC version, but only keep the one from the latest GHC, which is 9.2.4 in the bindist. 9.2.4 has the glibc "bug", because it bumped the Fedora version from 27 to 33. What you can do is this:
Editing But this is also worth a shot. For future reference: Relevant lines in ghcup metadata: https://github.com/haskell/ghcup-metadata/blob/5b58beb3bdefe95c822ca29fa03f946eafbd6a46/ghcup-0.0.7.yaml#L3582 GHC bindists lacking fedora 27: https://gitlab.haskell.org/ghc/ghc/-/issues/22268 |
This is an instance of #3247 |
I nuked the ghcup and reinstalled it wihout HLS, Then tried to do this, but the install did not work: IN TERMINAL : ghcup compile hls -g master --ghc 9.0.2 |
I tried this also. First I nuked ghcup again. Then changed my /etc/os-release to: Then tried reinstall ghcup with HLS and stack integration: This script can download and install the following binaries:
ghcup installs only into the following directory, Press ENTER to proceed or ctrl-c to abort. Detected bash shell on your system... [P] Yes, prepend [A] Yes, append [N] No [?] Help (default is "P"). aDo you want to install haskell-language-server (HLS)? [Y] Yes [N] No [?] Help (default is "N"). yDo you want to enable better integration of stack with GHCup? [Y] Yes [N] No [?] Help (default is "Y"). % Total % Received % Xferd Average Speed Time Time Time Current System requirements [ Info ] downloading: https://downloads.haskell.org/~ghc/9.2.5/ghc-9.2.5-x86_64-deb9-linux.tar.xz as file /home/archill-56/.ghcup/cache/ghc-9.2.5-x86_64-deb9-linux.tar.xz The hack seems to not have worked out. I am thinking of changing my distro to suit Haskell development. Any suggestions on what distro is the best choice for that? |
Looks like your toolchain is borked. Try |
It opens up ghci:
|
Well, I don't know what exactly you're doing, but it doesn't build the specified package. Try to build the said package somehow. |
This time it worked out: $ cabal repl -w ghc-9.0.2 --build-depends ghc-source-gen
Does this mean the toolchain is working somewhat? |
I don't know. What did you change? |
The first time, I was accidentally in the parent folder of the project. That is why it didn't build. Now, I have a different distro for Haskell development where everything works as intended. I hope you guys the best with solving this issue in the future. Thank you both for the help! |
DISTRIBUTION:
NAME="Linux Mint"
VERSION="20.1 (Ulyssa)"
ID=linuxmint
ID_LIKE=ubuntu
PRETTY_NAME="Linux Mint 20.1"
VERSION_ID="20.1"
HOME_URL="https://www.linuxmint.com/"
SUPPORT_URL="https://forums.linuxmint.com/"
BUG_REPORT_URL="http://linuxmint-troubleshooting-guide.readthedocs.io/en/latest/"
PRIVACY_POLICY_URL="https://www.linuxmint.com/"
VERSION_CODENAME=ulyssa
UBUNTU_CODENAME=focal
GHCUP INSTALLATION:
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
When installing, I appended the PATH-variable, said yes to HSL and to integration of stack with GHCup.
VSCODE INSTALLATION:
sudo apt install code
VSCODE HASKELL EXTENSION INSTALLATION v2.2.1
Via extensions in vscode (no other extension intalled)
SETTING UP THE STACK PROJECT
stack new --resolver=lts-19.33 HaskellTesti
stack setup
stack build
After setting up the stack project I opened the HaskellTesti folder in vscode and opened src/Lib.hs to the editor. The following happened:
2022-11-26 21:52:41.9970000 [client] INFO Finding haskell-language-server
2022-11-26 21:52:44.2550000 [client] INFO Checking for ghcup installation
2022-11-26 21:52:44.2630000 [client] INFO found ghcup at ghcup
2022-11-26 21:52:44.2680000 [client] INFO Executing 'ghcup --no-verbose upgrade' in cwd '/home/archill-56'
2022-11-26 21:52:45.1810000 [client] INFO Checking for ghcup installation
2022-11-26 21:52:45.2220000 [client] INFO found ghcup at ghcup
2022-11-26 21:52:45.2240000 [client] INFO Executing 'ghcup --no-verbose list -t hls -c installed -r' in cwd '/home/archill-56'
2022-11-26 21:52:45.4440000 [client] INFO Checking for ghcup installation
2022-11-26 21:52:45.4690000 [client] INFO found ghcup at ghcup
2022-11-26 21:52:45.4700000 [client] INFO Executing 'ghcup --no-verbose list -t cabal -c installed -r' in cwd '/home/archill-56'
2022-11-26 21:52:45.6890000 [client] INFO Checking for ghcup installation
2022-11-26 21:52:45.7090000 [client] INFO found ghcup at ghcup
2022-11-26 21:52:45.7110000 [client] INFO Executing 'ghcup --no-verbose list -t stack -c installed -r' in cwd '/home/archill-56'
2022-11-26 21:52:45.8740000 [client] INFO Checking for ghcup installation
2022-11-26 21:52:45.8860000 [client] INFO found ghcup at ghcup
2022-11-26 21:52:45.8870000 [client] INFO Executing 'ghcup --no-verbose whereis hls 1.8.0.0' in cwd '/home/archill-56'
2022-11-26 21:52:45.9070000 [client] INFO Checking for ghcup installation
2022-11-26 21:52:45.9190000 [client] INFO found ghcup at ghcup
2022-11-26 21:52:45.9210000 [client] INFO Executing 'ghcup --no-verbose whereis cabal 3.6.2.0' in cwd '/home/archill-56'
2022-11-26 21:52:45.9420000 [client] INFO Checking for ghcup installation
2022-11-26 21:52:45.9540000 [client] INFO found ghcup at ghcup
2022-11-26 21:52:45.9550000 [client] INFO Executing 'ghcup --no-verbose whereis stack 2.9.1' in cwd '/home/archill-56'
2022-11-26 21:52:45.9830000 [client] INFO Executing 'ghc --numeric-version' in cwd '/home/archill-56'
2022-11-26 21:52:46.0530000 [client] INFO Checking for ghcup installation
2022-11-26 21:52:46.0680000 [client] INFO found ghcup at ghcup
2022-11-26 21:52:46.0690000 [client] INFO Executing 'ghcup --no-verbose run --hls 1.8.0.0 --cabal 3.6.2.0 --stack 2.9.1 --install' in cwd '/home/archill-56'
2022-11-26 21:52:46.2460000 [client] INFO Working out the project GHC version. This might take a while...
2022-11-26 21:52:46.2480000 [client] INFO Executing 'haskell-language-server-wrapper --project-ghc-version' in cwd '/home/archill-56/Documents/Koodausprojektit/Haskell-projektit/HaskellTesti'
2022-11-26 21:52:46.2750000 [client] ERROR Error executing 'haskell-language-server-wrapper --project-ghc-version' with error code 1
2022-11-26 21:52:46.2750000 [client] ERROR stderr: haskell-language-server-wrapper: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by haskell-language-server-wrapper)
2022-11-26 21:52:46.2770000 [client] ERROR Error: haskell-language-server --project-ghc-version exited with exit code 1:
haskell-language-server-wrapper: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by haskell-language-server-wrapper)
2022-11-26 21:52:46.2790000 [client] INFO Executing 'ghc --numeric-version' in cwd '/home/archill-56'
2022-11-26 21:52:46.8410000 [client] INFO Platform constants: Linux_UnknownLinux, A_64
2022-11-26 21:52:46.8420000 [client] INFO Checking for ghcup installation
2022-11-26 21:52:46.8540000 [client] INFO found ghcup at ghcup
2022-11-26 21:52:46.8560000 [client] INFO Executing 'ghcup --no-verbose list -t hls -c installed -r' in cwd '/home/archill-56'
2022-11-26 21:52:47.0040000 [client] INFO Checking for ghcup installation
2022-11-26 21:52:47.0160000 [client] INFO found ghcup at ghcup
2022-11-26 21:52:47.0170000 [client] INFO Executing 'ghcup --no-verbose whereis bindir' in cwd '/home/archill-56'
2022-11-26 21:52:47.0570000 [client] INFO Checking for ghcup installation
2022-11-26 21:52:47.0740000 [client] INFO found ghcup at ghcup
2022-11-26 21:52:47.0770000 [client] INFO Executing 'ghcup --no-verbose whereis hls 1.8.0.0' in cwd '/home/archill-56'
2022-11-26 21:52:47.1090000 [client] INFO Checking for ghcup installation
2022-11-26 21:52:47.1240000 [client] INFO found ghcup at ghcup
2022-11-26 21:52:47.1250000 [client] INFO Executing 'ghcup --no-verbose whereis ghc 9.0.2' in cwd '/home/archill-56'
2022-11-26 21:52:47.1450000 [client] INFO Checking for ghcup installation
2022-11-26 21:52:47.1580000 [client] INFO found ghcup at ghcup
2022-11-26 21:52:47.1590000 [client] INFO Executing 'ghcup --no-verbose run --hls 1.8.0.0 --cabal 3.6.2.0 --stack 2.9.1 --ghc 9.0.2 --install' in cwd '/home/archill-56'
2022-11-26 21:52:47.3270000 [client] INFO Activating the language server in working dir: /home/archill-56/Documents/Koodausprojektit/Haskell-projektit/HaskellTesti (the workspace folder)
2022-11-26 21:52:47.3270000 [client] INFO run command: /home/archill-56/.ghcup/tmp/ghcup-ghc-9.0.2_cabal-3.6.2.0_hls-1.8.0.0_stack-2.9.1/haskell-language-server-wrapper --lsp -d
2022-11-26 21:52:47.3270000 [client] INFO debug command: /home/archill-56/.ghcup/tmp/ghcup-ghc-9.0.2_cabal-3.6.2.0_hls-1.8.0.0_stack-2.9.1/haskell-language-server-wrapper --lsp -d
2022-11-26 21:52:47.3270000 [client] INFO server environment variables:
2022-11-26 21:52:47.3270000 [client] INFO PATH=/home/archill-56/.ghcup/tmp/ghcup-ghc-9.0.2_cabal-3.6.2.0_hls-1.8.0.0_stack-2.9.1:/home/archill-56/.local/bin:/home/archill-56/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/archill-56/.cabal/bin:/home/archill-56/.ghcup/bin
2022-11-26 21:52:47.3370000 [client] INFO Starting language server
[Trace - 11:52:47 PM] Sending request 'initialize - (0)'.
[Error - 11:52:47 PM] Connection to server is erroring. Shutting down server.
[Trace - 11:52:47 PM] Sending request 'shutdown - (1)'.
/home/archill-56/.ghcup/tmp/ghcup-ghc-9.0.2_cabal-3.6.2.0_hls-1.8.0.0_stack-2.9.1/haskell-language-server-wrapper: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /home/archill-56/.ghcup/tmp/ghcup-ghc-9.0.2_cabal-3.6.2.0_hls-1.8.0.0_stack-2.9.1/haskell-language-server-wrapper)
So my problem is, that HLS is not clearly working for me at all. How can I fix this?
The text was updated successfully, but these errors were encountered: