-
-
Notifications
You must be signed in to change notification settings - Fork 347
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit restores a working behavior for `nix-shell` or `nix develop`, for all supported GHC versions. When entering a `nix-shell`, or `nix develop .#haskell-language-server-ghcXxX-dev` you will get an environment with all the dependencies needed to run `cabal build`. This commit simplifies the mechanism. Before, the shell was populated with multiples GHC packages built by nix. These packages are the dependencies which are used by `nix build` to build haskell-language-server. However, cabal may ignore theses dependencies according to its build plan, so this approach had the following limitations: - It was building dependencies which were not used during the build - The nix shell may fail to start if an (possibly unneeded) dependency was failing to build. This new approach does not try to build Haskell dependencies with nix and use cabal for that. This changes the following: - cabal is responsible for the dependencies in the shell. As a developer using nix, you'll have the same workflow / dependencies as what will be used by a developer using another build environment (i.e. `cabal` or `stack` without nix). - nix won't try to build haskell dependencies and hence won't fail if dependencies cannot be built. - A bit of the code has been simplified, because we do not try to load Haskell dependencies in the nix-shell, we can remove all the logic used to detect dependencies (and take into account broken plugins). It however means that the dependencies used by `nix build` won't be tried until we effectively call `nix build` (or someone try to build haskell-language-server using a nix flake). Entering nix-shell also generates an alias command `cabal_project` which runs cabal with the correct project file if needed (e.g. for GHC 9.0 and 9.2). Users are
- Loading branch information
Showing
3 changed files
with
52 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters