You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+22-22
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ Nix is a package manager we can use not only to build and install HLS, but also
40
40
41
41
The [Nix expression provided by this project](./default.nix) builds two versions of HLS
42
42
43
-
- the latest release (1.3.0)
43
+
- the latest release (1.4.0)
44
44
- a recent commit from the "main" branch of HLS on GitHub.
45
45
46
46
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
192
192
193
193
For this project's Nix expression, the following overrides can be done:
194
194
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).
197
197
198
198
We can see the package derivations provided with the following `nix` calls:
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]].
245
245
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.
247
247
248
248
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.
249
249
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".
251
251
252
252
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.
253
253
@@ -300,9 +300,9 @@ To install programs into the user-level `PATH` with Nix, we generally use `nix-e
300
300
To illustrate installing with `nix-env` let's consider installing the following:
301
301
302
302
- 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
304
304
- useful recent stable versions of Cabal, Stack, `gen-hie`, Direnv, and Lorelei
305
-
- GHC 8.10.6
305
+
- GHC 8.10.7
306
306
- a recent "main" branch version of HLS targeting GHC 8.8.4.
307
307
308
308
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
336
336
nix-env --query
337
337
```
338
338
339
-
cabal-install-3.4.0.0
339
+
cabal-install-3.6.0.0
340
340
direnv-2.28.0
341
341
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
344
344
haskell-language-server-ghc884-renamed
345
345
hls-wrapper-nix
346
346
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
352
352
ghc --version
353
353
```
354
354
355
-
The Glorious Glasgow Haskell Compilation System, version 8.10.6
355
+
The Glorious Glasgow Haskell Compilation System, version 8.10.7
356
356
357
357
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:
358
358
@@ -397,7 +397,7 @@ nix-shell --pure --run 'cabal run all'
397
397
```
398
398
399
399
Resolving dependencies...
400
-
Build profile: -w ghc-8.10.6 -O1
400
+
Build profile: -w ghc-8.10.7 -O1
401
401
In order, the following will be built (use -v for more details):
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.
0 commit comments