Description
I do not know anything about/write Haskell, but I have been trying to make the tooling and experience better for contributors and folks on our team.
Part of our Codebase is in Haskell. I wrote a development Dockerfile that reproducibly creates an environment with needed deps for our Haskell app -- but I am unable to get HLS to function properly in it
Probably user error, but taking an informal poll shows:
- Approx ~30% of our Haskell devs are unable to get HLS working
- 100% of devs who responded said they use or would like to use HLS, if it worked
- Trend appears to be that those who have issues are running Linux. Mac/OSx users don't report trouble.
What happens is that it builds, and then gets stuck in a segfault
loop.
To make this easy to reproduce, I've containerized everything -- you should be able to open it in your browser or use a VS Code Devcontainer locally to get an identical environment to the one that is broken.
Your environment
Output of haskell-language-server --probe-tools
or haskell-language-server-wrapper --probe-tools
:
@GavinRay97 ➜ /workspaces/graphql-engine (master ✗) $ ~/.ghcup/bin/haskell-language-server-wrapper --probe-tools
haskell-language-server version: 1.4.0.0 (GHC: 8.10.4) (PATH: /home/codespace/.ghcup/bin/haskell-language-server-wrapper-1.4.0) (GIT hash: 253547816ee216c53ee7dacc0ad3cac43e863d30)
Tool versions found on the $PATH
cabal: 3.6.2.0
stack: Not found
ghc: 8.10.2
Which OS do you use:
- Docker Container based on Ubuntu 20.04
Which lsp-client do you use:
- VS Code
Describe your project (alternative: link to the project):
- https://github.com/hasura/graphql-engine/blob/master/server/graphql-engine.cabal
- https://github.com/hasura/graphql-engine/blob/master/cabal.project
- https://github.com/hasura/graphql-engine/blob/master/cabal.project.dev
Steps to reproduce
CLICK TO SHOW INSTRUCTIONS 👇
- Without VS Code or Codespaces at all
- In a browser
- In VS Code locally/offline
- In VS Code locally, but connected to a remote Codespace ("Thin Client")
- In a text editor like
vim
,emacs
, etc, connected to remote Codespace ("Thin client")
Without VS Code or Codespaces at all
- Use the Dockerfile at
.devcontainer/Dockerfile
- Set up a bind mount over
/graphql-engine
, and run the Docker image (either manually or with Compose)
In a browser
- Go here: https://github.com/GavinRay97/graphql-engine
- Press "New Codespace", as in image below
In VS Code locally/offline
- Clone the repo from https://github.com/GavinRay97/graphql-engine
- Open the repo in VS Code
- Accept this prompt:
In VS Code locally, but connected to a remote Codespace ("Thin Client")
- Install the
Codespaces
extension in VS Code - On the navigation panel thing, click the Remote Explorer icon (circled in red), then from the dropdown at the top (circled in red) select
Codespaces
, and either press+
to create a new one or click to connect to an existing:
In a text editor like vim
, emacs
, etc, connected to remote Codespace ("Thin client"):**
- Use the Github CLI's
ssh
command to connect to the codespace and then run it through your editor of choice - https://github.blog/changelog/2021-10-27-new-codespaces-features-launching-at-universe-2021/
Expected behaviour
It doesn't segfault, or instead of segfaulting it prints helpful debug info before dying (I have tried turning verbose logging on, no dice 🙁)
Actual behaviour
It starts, segfaults at random (no pattern), and restarts itself, repeating the loop.
Include debug information
Execute in the root of your project the command haskell-language-server --debug .
and paste the logs here:
Debug output:
<paste your logs here>
Paste the logs from the lsp-client, e.g. for VS Code
LSP logs:
<paste your logs here>