Skip to content

Commit 241aa26

Browse files
committed
Add the -dynamic flag and update build instructions
1 parent df21896 commit 241aa26

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

docs/troubleshooting.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,31 +168,31 @@ Dynamically linked binaries (including`ghci`) use the system linker instead of t
168168
The easiest way to obtain a dynamically linked HLS binary is to build it locally. With `cabal` this can be done as follows:
169169

170170
```bash
171-
cabal update && cabal install pkg:haskell-language-server --ghc-options="-dynamic"
171+
cabal update && cabal install pkg:haskell-language-server"
172172
```
173173
174174
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:
175175
176176
```bash
177-
cabal update && cabal install pkg:haskell-language-server --project-file=cabal-ghc90.project --ghc-options="-dynamic"
177+
cabal update && cabal install pkg:haskell-language-server --project-file=cabal-ghc90.project"
178178
```
179179

180-
With `stack` you also need add the ghc option `-dynamic`.
180+
Or with `stack`:
181181

182182
```bash
183-
stack install haskell-language-server --stack-yaml=stack-${ghcVersion}.yaml --ghc-options="-dynamic"
183+
stack install haskell-language-server --stack-yaml=stack-${ghcVersion}.yaml"
184184
```
185185
186186
You also can leverage `ghcup compile hls`:
187187
188188
```bash
189-
ghcup compile hls -g master --ghc 8.10.7 -- --ghc-options="-dynamic"
189+
ghcup compile hls -v 1.6.1.0 --ghc 8.10.7
190190
```
191191
192192
as it uses cabal underneath you might need to use a specific cabal.project for some ghc versions:
193193
194194
```bash
195-
ghcup compile hls -g master --ghc 9.0.2 --project-file cabal-ghc90.project -- --ghc-options="-dynamic"
195+
ghcup compile hls -v 1.6.1.0 --ghc 9.0.2 --cabal-project cabal-ghc90.project
196196
```
197197
198198
### Preprocessors

haskell-language-server.cabal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@ executable haskell-language-server
354354
other-modules: Plugins
355355

356356
ghc-options:
357+
-dynamic
357358
-threaded
358359
-- allow user RTS overrides
359360
-rtsopts

0 commit comments

Comments
 (0)