Skip to content
Snippets Groups Projects
Commit a90c768a authored by Javier Neira's avatar Javier Neira
Browse files

Complete th workarounds

parent a00f17da
No related merge requests found
......@@ -160,18 +160,28 @@ The server log will show which cradle is being chosen.
Using an explicit `hie.yaml` to configure the cradle can resolve the problem, see the [configuration page](./configuration.md#configuring-your-project-build).
### Static binaries
### Static binaries and template haskell support
Static binaries use the GHC linker for dynamically loading dependencies when typechecking TH code, and this can run into issues when loading shared objects linked against mismatching system libraries, or into GHC linker bugs (mainly the Mach linker used in Mac OS, but also potentially the ELF linker).
Dynamically linked binaries (including`ghci`) use the system linker instead of the GHC linker and avoid both issues.
The easiest way to obtain a dynamically linked HLS binary is to build it locally. With `cabal` this can be done as follows:
cabal update && cabal install haskell-language-server --enable-executable-dynamic
```bash
cabal update && cabal install haskell-language-server --enable-executable-dynamic
```
With `stack` you need to manually add the ghc option `-dynamic`.
Note: HLS binaries prior to 1.6.0 were statically linking `glibc` which is not a supported configuration and has been replaced by `musl`.
```bash
stack install haskell-language-server --ghc-options="-dynamic"
```
You also can also leverage `ghcup compile hls`:
```bash
ghcup compile hls -g master --ghc 8.10.7 -- --enable-executable-dynamic
```
### Preprocessors
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment