Skip to content

Commit 8051be6

Browse files
committed
More troubleshooting
1 parent e81160d commit 8051be6

File tree

1 file changed

+47
-8
lines changed

1 file changed

+47
-8
lines changed

README.md

Lines changed: 47 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -224,14 +224,53 @@ Please include the output when filing any issues on the [haskell-language-server
224224
- Sometimes the language server might get stuck in a rut and stop responding to your latest changes.
225225
Should this occur you can try restarting the language server with <kbd>Ctrl</kbd> <kbd>shift</kbd> <kbd>P</kbd>/<kbd>⌘</kbd> <kbd>shift</kbd> <kbd>P</kbd> > Restart Haskell LSP Server.
226226

227-
#### `Cradle requires ghc/cabal/stack but it isn't installed`
228-
229-
- In Linux/MacOS systems, opening vscode in the windows system could not use the `$PATH` set in the shell
230-
so it will not see required tools as ghc, cabal or stack. This usually happens if you have installed them
231-
via ghcup.
232-
- It could be fixed changing the `$PATH` variable in the init config file used by the windows system
233-
(f.e. `~/.profile`, but i can vary depending on your system setup).
234-
- See [this stackoverflow question](https://stackoverflow.com/questions/43983718/set-global-path-environment-variable-in-vs-code) for more tricks.
227+
#### `Failed to get project GHC version` on darwin M1 with stack
228+
229+
If you have installed stack via the official cannels, the binary will not be M1 native, but x86 and trigger the rosetta compatibility layer. GHCup provides real stack/HLS M1 binaries, so make sure you install stack via GHCup. Also see https://github.com/haskell/haskell-language-server/issues/2864
230+
231+
#### `GHC ABIs don't match`
232+
233+
If you're running stack with GHC 9.0.2, you will get this because of an outdated
234+
GHC bindist that stack installs.
235+
236+
Force it to install the fixed bindist (that includes profiling libs) by adding this to your stack.yaml (depending on your platform):
237+
238+
```yml
239+
setup-info:
240+
ghc:
241+
linux64-tinfo6:
242+
9.0.2:
243+
url: "https://downloads.haskell.org/ghc/9.0.2/ghc-9.0.2a-x86_64-fedora27-linux.tar.xz"
244+
```
245+
246+
Alternatively let GHCup install the correct bindist and then set `system-ghc: true` in your `stack.yaml`.
247+
248+
Now make sure to remove cached/installed libraries to avoid getting segfaults at runtime.
249+
250+
If you hit this problem although you're not using stack or GHC 9.0.2, please report an issue. As a workaround, you can try to compile HLS from source (the extension should pick it up) via ghcup, see [https://haskell-language-server.readthedocs.io/en/stable/installation.html#ghcup](https://haskell-language-server.readthedocs.io/en/stable/installation.html#ghcup).
251+
252+
#### Something else doesn't work
253+
254+
If something just doesn't work, but you recall an old configuration that did, you
255+
may try forcing a particular setting, e.g. by disabling all automatic installations
256+
except HLS:
257+
258+
```json
259+
"haskell.toolchain": {
260+
"hls": "1.6.1.0",
261+
"ghc": null,
262+
"cabal": null,
263+
"stack": null
264+
}
265+
```
266+
267+
Also make sure GHCup is installed and in `PATH`. If you're not starting VSCode from the terminal, you might need to add `$HOME/.ghcup/bin` to PATH like so
268+
269+
```json
270+
"haskell.serverEnvironment": {
271+
"PATH": "${HOME}/.ghcup/bin:$PATH"
272+
}
273+
```
235274

236275
## Contributing
237276

0 commit comments

Comments
 (0)