|
1 |
| -# Troubleshooting |
2 | 1 |
|
3 | 2 | ## Help, I have no idea what these words mean
|
4 | 3 |
|
@@ -165,34 +164,34 @@ Using an explicit `hie.yaml` to configure the cradle can resolve the problem, se
|
165 | 164 | Static binaries use the GHC linker for dynamically loading dependencies when typechecking Template Haskell 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).
|
166 | 165 | Dynamically linked binaries (including`ghci`) use the system linker instead of the GHC linker and avoid both issues.
|
167 | 166 |
|
168 |
| -The easiest way to obtain a dynamically linked HLS binary is to build HLS locally. With `cabal` this can be done as follows: |
| 167 | +The easiest way to obtain a dynamically linked HLS binary is to build it locally. With `cabal` this can be done as follows: |
169 | 168 |
|
170 | 169 | ```bash
|
171 |
| -cabal update && cabal install pkg:haskell-language-server |
| 170 | +cabal update && cabal install pkg:haskell-language-server --ghc-options="-dynamic" |
172 | 171 | ```
|
173 | 172 |
|
174 | 173 | If you are compiling with a ghc version with a specific `cabal-ghc${ghcVersion}.project` in the repo you will have to use it. For example for ghc-9.0.x:
|
175 | 174 |
|
176 | 175 | ```bash
|
177 |
| -cabal update && cabal install pkg:haskell-language-server --project-file=cabal-ghc90.project |
| 176 | +cabal update && cabal install pkg:haskell-language-server --project-file=cabal-ghc90.project --ghc-options="-dynamic" |
178 | 177 | ```
|
179 | 178 |
|
180 |
| -Or with `stack`: |
| 179 | +With `stack` you also need add the ghc option `-dynamic`. |
181 | 180 |
|
182 | 181 | ```bash
|
183 |
| -stack install haskell-language-server --stack-yaml=stack-${ghcVersion}.yaml |
| 182 | +stack install haskell-language-server --stack-yaml=stack-${ghcVersion}.yaml --ghc-options="-dynamic" |
184 | 183 | ```
|
185 | 184 |
|
186 | 185 | You also can leverage `ghcup compile hls`:
|
187 | 186 |
|
188 | 187 | ```bash
|
189 |
| -ghcup compile hls -v 1.6.1.0 --ghc 8.10.7 |
| 188 | +ghcup compile hls -g master --ghc 8.10.7 -- --ghc-options="-dynamic" |
190 | 189 | ```
|
191 | 190 |
|
192 | 191 | as it uses cabal underneath you might need to use a specific cabal.project for some ghc versions:
|
193 | 192 |
|
194 | 193 | ```bash
|
195 |
| -ghcup compile hls -v 1.6.1.0 --ghc 9.0.2 --cabal-project cabal-ghc90.project |
| 194 | +ghcup compile hls -g master --ghc 9.0.2 --project-file cabal-ghc90.project -- --ghc-options="-dynamic" |
196 | 195 | ```
|
197 | 196 |
|
198 | 197 | ### Preprocessors
|
|
0 commit comments