Skip to content

Commit 243d55b

Browse files
committed
Update dependencies and regenerate documentation
1 parent f81e9e2 commit 243d55b

10 files changed

+87
-87
lines changed

README.md

+22-22
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Nix is a package manager we can use not only to build and install HLS, but also
4040

4141
The [Nix expression provided by this project](./default.nix) builds two versions of HLS
4242

43-
- the latest release (1.3.0)
43+
- the latest release (1.4.0)
4444
- a recent commit from the "main" branch of HLS on GitHub.
4545

4646
To use HLS with a Haskell project, you must have an instance of HLS compiled with the same version of GHC used to compile your project. To meet the needs of different users, we build both versions of HLS listed above against all of the following versions of GHC:
@@ -192,8 +192,8 @@ The [Nix expression provided by this project](./default.nix) evaluates to a func
192192

193193
For this project's Nix expression, the following overrides can be done:
194194

195-
- `--argstr ghcVersion ${GHC_VERSION}` sets the GHC version used for the build (the default is otherwise `8.10.6`).
196-
- `--arg hlsUnstable ${BOOLEAN_VALUE}` when set to `true` picks a recent commit from the "main" branch for the HLS packages (defaulting otherwise to `false`, which selects the 1.3.0 release of HLS).
195+
- `--argstr ghcVersion ${GHC_VERSION}` sets the GHC version used for the build (the default is otherwise `8.10.7`).
196+
- `--arg hlsUnstable ${BOOLEAN_VALUE}` when set to `true` picks a recent commit from the "main" branch for the HLS packages (defaulting otherwise to `false`, which selects the 1.4.0 release of HLS).
197197

198198
We can see the package derivations provided with the following `nix` calls:
199199

@@ -214,14 +214,14 @@ nix search --no-cache --file .
214214
* ghc (ghc)
215215
The Glasgow Haskell Compiler
216216

217-
* hls (haskell-language-server-ghc8106)
218-
Haskell Language Server (HLS) for GHC 8.10.6
217+
* hls (haskell-language-server-ghc8107)
218+
Haskell Language Server (HLS) for GHC 8.10.7
219219

220220
* hls-full (haskell-hls-nix-full)
221221
Haskell Language Server (HLS) full/easy installation
222222

223-
* hls-renamed (haskell-language-server-ghc8106-renamed)
224-
Haskell Language Server (HLS) for GHC 8.10.6, renamed binary
223+
* hls-renamed (haskell-language-server-ghc8107-renamed)
224+
Haskell Language Server (HLS) for GHC 8.10.7, renamed binary
225225

226226
* hls-wrapper (haskell-language-server-wrapper)
227227
Haskell Language Server (HLS) wrapper
@@ -243,11 +243,11 @@ nix search --no-cache --file .
243243

244244
Note, when loading a directory with `--file`, a Nix expression is assumed to be in the directory's `default.nix` file. Also, the call of `nix show-derivation` is only needed one time to get search results as discussed in the provided documentation on Nix]].
245245

246-
The search results of `nix search` tell us the *attribute paths* we can use to select out the package derivations from our Nix expression. Above we got the default 1.3.0 version of HLS packages compiled for GHC 8.10.6. We could have explicitly called `nix search` above with `--argstr ghcVersion 8.10.6` and `--arg hlsUnstable false` and have gotten the same default results.
246+
The search results of `nix search` tell us the *attribute paths* we can use to select out the package derivations from our Nix expression. Above we got the default 1.4.0 version of HLS packages compiled for GHC 8.10.7. We could have explicitly called `nix search` above with `--argstr ghcVersion 8.10.7` and `--arg hlsUnstable false` and have gotten the same default results.
247247

248248
The `hls` package is provided for completeness, but its usage is not generally recommended. It provides the unmodified output of the upstream HLS project, specifically a binary named "haskell-language-server". You can only install one of these to your `PATH`. Because the version of GHC we compile HLS against must match the version of GHC for the project we wish to use HLS with, using `hls` would limit all of our projects to just one version of GHC. The `hls-renamed`, `hls-wrapper`, and `hls-wrapper-nix` packages help work around this limitation, and are recommended.
249249

250-
To install multiple instances of HLS to your `PATH`, use the `hls-renamed` attribute path. This suffixes the provided binary's filename with the version of GHC the instance of HLS has been compiled with. For example, when compiled with GHC 8.10.6, the binary is named "haskell-language-server-8.10.6".
250+
To install multiple instances of HLS to your `PATH`, use the `hls-renamed` attribute path. This suffixes the provided binary's filename with the version of GHC the instance of HLS has been compiled with. For example, when compiled with GHC 8.10.7, the binary is named "haskell-language-server-8.10.7".
251251

252252
The `hls-wrapper` attribute path provides the upstream HLS wrapper binary named "haskell-language-server-wrapper". When the wrapper is run in a root directory of a Haskell project, it detects which GHC version is needed by the project, and scans the `PATH` to call the instance of the renamed HLS binary compiled for the version of GHC needed by the project. It doesn't really matter which version of GHC you compile the wrapper itself against (`--argstr ghcVersion`). It's just a thin wrapper that is not GHC-sensitive.
253253

@@ -300,9 +300,9 @@ To install programs into the user-level `PATH` with Nix, we generally use `nix-e
300300
To illustrate installing with `nix-env` let's consider installing the following:
301301

302302
- this project's drop-in replacement for the HLS wrapper
303-
- the latest release of HLS (1.3.0) targeting 8.10.6
303+
- the latest release of HLS (1.4.0) targeting 8.10.7
304304
- useful recent stable versions of Cabal, Stack, `gen-hie`, Direnv, and Lorelei
305-
- GHC 8.10.6
305+
- GHC 8.10.7
306306
- a recent "main" branch version of HLS targeting GHC 8.8.4.
307307

308308
We can install the first four in one step relying on defaults of the Nix expression:
@@ -336,11 +336,11 @@ These packages have been installed in our Nix profile, which we can see by query
336336
nix-env --query
337337
```
338338

339-
cabal-install-3.4.0.0
339+
cabal-install-3.6.0.0
340340
direnv-2.28.0
341341
direnv-nix-lorelei
342-
ghc-8.10.6
343-
haskell-language-server-ghc8106-renamed
342+
ghc-8.10.7
343+
haskell-language-server-ghc8107-renamed
344344
haskell-language-server-ghc884-renamed
345345
hls-wrapper-nix
346346
implicit-hie-0.1.2.6
@@ -352,7 +352,7 @@ If we've set up the `bin` directory of our Nix profile in our `PATH`, we should
352352
ghc --version
353353
```
354354

355-
The Glorious Glasgow Haskell Compilation System, version 8.10.6
355+
The Glorious Glasgow Haskell Compilation System, version 8.10.7
356356

357357
Without using `nix-shell`, Cabal and Stack will both manage Haskell dependencies of projects. In this case, for Cabal you need to at least once call `cabal update` to download the latest index of Haskell packages on Hackage:
358358

@@ -397,7 +397,7 @@ nix-shell --pure --run 'cabal run all'
397397
```
398398

399399
Resolving dependencies...
400-
Build profile: -w ghc-8.10.6 -O1
400+
Build profile: -w ghc-8.10.7 -O1
401401
In order, the following will be built (use -v for more details):
402402
403403
Answer to the Ultimate Question of Life,
@@ -422,12 +422,12 @@ cd examples/example-cabal
422422
nix-shell --pure --run 'haskell-language-server-wrapper' 2>&1
423423
```
424424

425-
trace: WARNING: 8.10.6 is out of date, consider using 8.10.7.
426425
warning: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I), at (string):1:9; will use bash from your environment
427426
Found "/home/tnks/src/shajra/haskell-hls-nix/examples/example-cabal/hie.yaml" for "/home/tnks/src/shajra/haskell-hls-nix/examples/example-cabal/a"
427+
Run entered for haskell-language-server-wrapper(haskell-language-server-wrapper) Version 1.4.0.0 x86_64 ghc-8.10.7
428428
429-
430429
Completed (5 files worked, 0 files failed)
430+
2021-09-21 02:10:17.104257242 [ThreadId 797] INFO hls: finish: GenerateCore (took 0.00s)
431431

432432
The same command can test HLS working with our Stack example project:
433433

@@ -436,12 +436,12 @@ cd examples/example-stack
436436
nix-shell --pure --run 'haskell-language-server-wrapper' 2>&1
437437
```
438438

439-
trace: WARNING: 8.10.6 is out of date, consider using 8.10.7.
440439
warning: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I), at (string):1:9; will use bash from your environment
441440
No 'hie.yaml' found. Try to discover the project type!
441+
Run entered for haskell-language-server-wrapper(haskell-language-server-wrapper) Version 1.4.0.0 x86_64 ghc-8.10.7
442442
443443
Completed (3 files worked, 0 files failed)
444-
2021-09-08 14:05:20.373964008 [ThreadId 642] INFO hls: finish: GenerateCore (took 0.00s)
444+
2021-09-21 02:10:27.765832277 [ThreadId 463] INFO hls: finish: GenerateCore (took 0.00s)
445445

446446
# Editor integration with Nix shells<a id="sec-9"></a>
447447

@@ -491,7 +491,7 @@ cd examples/example-cabal
491491
nix-shell --pure --run 'ghc-pkg list text-icu'
492492
```
493493

494-
/nix/store/rsyvws8dwv47h87mgm57spzvj4gnfq5n-ghc-8.10.6-with-packages/lib/ghc-8.10.6/package.conf.d
494+
/nix/store/fl24y73y0v5hcvcw2afish8pb6bmiqzp-ghc-8.10.7-with-packages/lib/ghc-8.10.7/package.conf.d
495495
text-icu-0.7.1.0
496496

497497
We can similarly look at the GHC instance for the Stack example project to see that it doesn't provide third-party Haskell dependencies:
@@ -501,7 +501,7 @@ cd examples/example-stack
501501
nix-shell --pure --run 'ghc-pkg list text-icu'
502502
```
503503

504-
/nix/store/xygkar338ssrwqjcpmmbv1pkkpqc1yfy-ghc-8.10.6/lib/ghc-8.10.6/package.conf.d
504+
/nix/store/3w79n0p8qwkqycdyac90jp51b4jsw68i-ghc-8.10.7/lib/ghc-8.10.7/package.conf.d
505505
(no packages)
506506

507507
This leads to a complication with Cabal projects when using Nix. Changing the dependencies of a Cabal file mean we need to rebuild the package database that our project's Nix shell provides.

README.org

+16-16
Original file line numberDiff line numberDiff line change
@@ -327,14 +327,14 @@ nix search --no-cache --file . | ansifilter
327327
,* ghc (ghc)
328328
The Glasgow Haskell Compiler
329329

330-
,* hls (haskell-language-server-ghc8106)
331-
Haskell Language Server (HLS) for GHC 8.10.6
330+
,* hls (haskell-language-server-ghc8107)
331+
Haskell Language Server (HLS) for GHC 8.10.7
332332

333333
,* hls-full (haskell-hls-nix-full)
334334
Haskell Language Server (HLS) full/easy installation
335335

336-
,* hls-renamed (haskell-language-server-ghc8106-renamed)
337-
Haskell Language Server (HLS) for GHC 8.10.6, renamed binary
336+
,* hls-renamed (haskell-language-server-ghc8107-renamed)
337+
Haskell Language Server (HLS) for GHC 8.10.7, renamed binary
338338

339339
,* hls-wrapper (haskell-language-server-wrapper)
340340
Haskell Language Server (HLS) wrapper
@@ -525,11 +525,11 @@ nix-env --query
525525
#+end_src
526526

527527
#+results: nix-env-query
528-
: cabal-install-3.4.0.0
528+
: cabal-install-3.6.0.0
529529
: direnv-2.28.0
530530
: direnv-nix-lorelei
531-
: ghc-8.10.6
532-
: haskell-language-server-ghc8106-renamed
531+
: ghc-8.10.7
532+
: haskell-language-server-ghc8107-renamed
533533
: haskell-language-server-ghc884-renamed
534534
: hls-wrapper-nix
535535
: implicit-hie-0.1.2.6
@@ -545,7 +545,7 @@ ghc --version
545545
#+end_src
546546

547547
#+results: nix-env-versions
548-
: The Glorious Glasgow Haskell Compilation System, version 8.10.6
548+
: The Glorious Glasgow Haskell Compilation System, version 8.10.7
549549

550550
Without using =nix-shell=, Cabal and Stack will both manage Haskell dependencies
551551
of projects. In this case, for Cabal you need to at least once call ~cabal
@@ -622,7 +622,7 @@ nix-shell --pure --run 'cabal run all'
622622

623623
#+results: shell-build-cabal
624624
: Resolving dependencies...
625-
: Build profile: -w ghc-8.10.6 -O1
625+
: Build profile: -w ghc-8.10.7 -O1
626626
: In order, the following will be built (use -v for more details):
627627
: …
628628
: Answer to the Ultimate Question of Life,
@@ -657,12 +657,12 @@ nix-shell --pure --run 'haskell-language-server-wrapper' 2>&1
657657
#+end_src
658658

659659
#+results: shell-hls-cabal
660-
: trace: WARNING: 8.10.6 is out of date, consider using 8.10.7.
661660
: warning: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I), at (string):1:9; will use bash from your environment
662661
: Found "/home/tnks/src/shajra/haskell-hls-nix/examples/example-cabal/hie.yaml" for "/home/tnks/src/shajra/haskell-hls-nix/examples/example-cabal/a"
662+
: Run entered for haskell-language-server-wrapper(haskell-language-server-wrapper) Version 1.4.0.0 x86_64 ghc-8.10.7
663663
: …
664-
:
665664
: Completed (5 files worked, 0 files failed)
665+
: 2021-09-21 02:10:17.104257242 [ThreadId 797] INFO hls: finish: GenerateCore (took 0.00s)
666666

667667
The same command can test HLS working with our Stack example project:
668668

@@ -673,12 +673,12 @@ nix-shell --pure --run 'haskell-language-server-wrapper' 2>&1
673673
#+end_src
674674

675675
#+results: shell-hls-stack
676-
: trace: WARNING: 8.10.6 is out of date, consider using 8.10.7.
677676
: warning: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I), at (string):1:9; will use bash from your environment
678677
: No 'hie.yaml' found. Try to discover the project type!
678+
: Run entered for haskell-language-server-wrapper(haskell-language-server-wrapper) Version 1.4.0.0 x86_64 ghc-8.10.7
679679
: …
680680
: Completed (3 files worked, 0 files failed)
681-
: 2021-09-08 14:05:20.373964008 [ThreadId 642] INFO hls: finish: GenerateCore (took 0.00s)
681+
: 2021-09-21 02:10:27.765832277 [ThreadId 463] INFO hls: finish: GenerateCore (took 0.00s)
682682

683683
* Editor integration with Nix shells
684684

@@ -765,9 +765,9 @@ nix-shell --pure --run 'ghc-pkg list text-icu'
765765
#+end_src
766766

767767
#+results: example-cabal-pkg-list
768-
: /nix/store/rsyvws8dwv47h87mgm57spzvj4gnfq5n-ghc-8.10.6-with-packages/lib/ghc-8.10.6/package.conf.d
768+
: /nix/store/fl24y73y0v5hcvcw2afish8pb6bmiqzp-ghc-8.10.7-with-packages/lib/ghc-8.10.7/package.conf.d
769769
: text-icu-0.7.1.0
770-
:
770+
:
771771

772772
We can similarly look at the GHC instance for the Stack example project to see
773773
that it doesn't provide third-party Haskell dependencies:
@@ -779,7 +779,7 @@ nix-shell --pure --run 'ghc-pkg list text-icu'
779779
#+end_src
780780

781781
#+results: example-stack-pkg-list
782-
: /nix/store/xygkar338ssrwqjcpmmbv1pkkpqc1yfy-ghc-8.10.6/lib/ghc-8.10.6/package.conf.d
782+
: /nix/store/3w79n0p8qwkqycdyac90jp51b4jsw68i-ghc-8.10.7/lib/ghc-8.10.7/package.conf.d
783783
: (no packages)
784784

785785
This leads to a complication with Cabal projects when using Nix. Changing the

doc/direnv.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ direnv exec examples/example-cabal \
120120
direnv: not modified: application/example-haskell-app.cabal
121121
122122
Completed (5 files worked, 0 files failed)
123-
2021-09-08 14:05:47.000143329 [ThreadId 520] INFO hls: finish: GenerateCore (took 0.00s)
123+
2021-09-21 02:10:55.284087938 [ThreadId 511] INFO hls: finish: GenerateCore (took 0.00s)
124124

125125
Before we can use Direnv with the example, we have to run `direnv allow` on it to permit running code from the `.envrc` file.
126126

@@ -140,7 +140,7 @@ direnv exec examples/example-stack \
140140
direnv: not modified: application/example-haskell-app.cabal
141141
142142
Completed (3 files worked, 0 files failed)
143-
2021-09-08 14:05:52.930797704 [ThreadId 635] INFO hls: finish: GenerateCore (took 0.00s)
143+
2021-09-21 02:11:02.018902816 [ThreadId 473] INFO hls: finish: GenerateCore (took 0.00s)
144144

145145
# Suggested advanced configuration<a id="sec-7"></a>
146146

doc/direnv.org

+2-2
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ direnv exec examples/example-cabal \
246246
: direnv: not modified: application/example-haskell-app.cabal
247247
: …
248248
: Completed (5 files worked, 0 files failed)
249-
: 2021-09-08 14:05:47.000143329 [ThreadId 520] INFO hls: finish: GenerateCore (took 0.00s)
249+
: 2021-09-21 02:10:55.284087938 [ThreadId 511] INFO hls: finish: GenerateCore (took 0.00s)
250250

251251
Before we can use Direnv with the example, we have to run =direnv allow= on it
252252
to permit running code from the =.envrc= file.
@@ -275,7 +275,7 @@ direnv exec examples/example-stack \
275275
: direnv: not modified: application/example-haskell-app.cabal
276276
: …
277277
: Completed (3 files worked, 0 files failed)
278-
: 2021-09-08 14:05:52.930797704 [ThreadId 635] INFO hls: finish: GenerateCore (took 0.00s)
278+
: 2021-09-21 02:11:02.018902816 [ThreadId 473] INFO hls: finish: GenerateCore (took 0.00s)
279279

280280
* Suggested advanced configuration
281281

doc/hls-wrapper-nix.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ nix-env --install --file . --attr hls-wrapper-nix
3232
```
3333

3434
installing 'hls-wrapper-nix'
35-
trace: WARNING: 8.10.6 is out of date, consider using 8.10.7.
3635

3736
# Editor configuration<a id="sec-3"></a>
3837

@@ -91,12 +90,12 @@ hls-wrapper-nix --cwd examples/example-cabal
9190
```
9291

9392
INFO: Entering pure Nix shell
94-
trace: WARNING: 8.10.6 is out of date, consider using 8.10.7.
9593
Found "/home/tnks/src/shajra/haskell-hls-nix/examples/example-cabal/hie.yaml" for "/home/tnks/src/shajra/haskell-hls-nix/examples/example-cabal/a"
94+
Run entered for haskell-language-server-wrapper(haskell-language-server-wrapper) Version 1.4.0.0 x86_64 ghc-8.10.7
9695
9796

9897
Completed (5 files worked, 0 files failed)
99-
2021-09-08 14:06:10.507326695 [ThreadId 692] INFO hls: finish: GenerateCore (took 0.00s)
98+
2021-09-21 02:11:20.16832857 [ThreadId 383] INFO hls: finish: GenerateCore (took 0.00s)
10099

101100
And here we see that the script works for the Stack example project as well:
102101

@@ -105,12 +104,12 @@ hls-wrapper-nix --cwd examples/example-stack
105104
```
106105

107106
INFO: Entering pure Nix shell
108-
trace: WARNING: 8.10.6 is out of date, consider using 8.10.7.
109107
No 'hie.yaml' found. Try to discover the project type!
108+
Run entered for haskell-language-server-wrapper(haskell-language-server-wrapper) Version 1.4.0.0 x86_64 ghc-8.10.7
110109
111110

112111
Completed (3 files worked, 0 files failed)
113-
2021-09-08 14:07:59.619477442 [ThreadId 455] INFO hls: finish: GenerateCore (took 0.00s)
112+
2021-09-21 02:13:13.261875187 [ThreadId 643] INFO hls: finish: GenerateCore (took 0.00s)
114113

115114
# Command-line reference<a id="sec-7"></a>
116115

@@ -149,6 +148,7 @@ For reference, here's the output of running `hls-wrapper-nix --help`:
149148
haskell-language-server-wrapper
150149
--probe-tools Show haskell-language-server-wrapper version and
151150
other tools of interest
151+
--list-plugins List all avaliable plugins
152152
--print-cradle Print the project cradle type
153153
--lsp Start talking to an LSP server
154154
--cwd DIR Change to this directory

doc/hls-wrapper-nix.org

+5-5
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ nix-env --install --file . --attr hls-wrapper-nix
105105

106106
#+results: nix-env-install
107107
: installing 'hls-wrapper-nix'
108-
: trace: WARNING: 8.10.6 is out of date, consider using 8.10.7.
109108

110109
* Editor configuration
111110

@@ -193,12 +192,12 @@ hls-wrapper-nix --cwd examples/example-cabal
193192

194193
#+results: test-cabal
195194
: INFO: Entering pure Nix shell
196-
: trace: WARNING: 8.10.6 is out of date, consider using 8.10.7.
197195
: Found "/home/tnks/src/shajra/haskell-hls-nix/examples/example-cabal/hie.yaml" for "/home/tnks/src/shajra/haskell-hls-nix/examples/example-cabal/a"
196+
: Run entered for haskell-language-server-wrapper(haskell-language-server-wrapper) Version 1.4.0.0 x86_64 ghc-8.10.7
198197
: …
199198
:
200199
: Completed (5 files worked, 0 files failed)
201-
: 2021-09-08 14:06:10.507326695 [ThreadId 692] INFO hls: finish: GenerateCore (took 0.00s)
200+
: 2021-09-21 02:11:20.16832857 [ThreadId 383] INFO hls: finish: GenerateCore (took 0.00s)
202201

203202
And here we see that the script works for the Stack example project as well:
204203

@@ -209,12 +208,12 @@ hls-wrapper-nix --cwd examples/example-stack
209208

210209
#+results: test-stack
211210
: INFO: Entering pure Nix shell
212-
: trace: WARNING: 8.10.6 is out of date, consider using 8.10.7.
213211
: No 'hie.yaml' found. Try to discover the project type!
212+
: Run entered for haskell-language-server-wrapper(haskell-language-server-wrapper) Version 1.4.0.0 x86_64 ghc-8.10.7
214213
: …
215214
:
216215
: Completed (3 files worked, 0 files failed)
217-
: 2021-09-08 14:07:59.619477442 [ThreadId 455] INFO hls: finish: GenerateCore (took 0.00s)
216+
: 2021-09-21 02:13:13.261875187 [ThreadId 643] INFO hls: finish: GenerateCore (took 0.00s)
218217

219218
* Command-line reference
220219

@@ -262,6 +261,7 @@ HLS OPTIONS:
262261
haskell-language-server-wrapper
263262
--probe-tools Show haskell-language-server-wrapper version and
264263
other tools of interest
264+
--list-plugins List all avaliable plugins
265265
--print-cradle Print the project cradle type
266266
--lsp Start talking to an LSP server
267267
--cwd DIR Change to this directory

0 commit comments

Comments
 (0)