Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Commit 726c37e

Browse files
authored
Merge pull request #1092 from fendor/shake-cabal
Build HIE with cabal via `install.hs`
2 parents ba44c58 + 5ad1d72 commit 726c37e

File tree

3 files changed

+426
-108
lines changed

3 files changed

+426
-108
lines changed

README.md

Lines changed: 85 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,50 @@ This project aims to be __the universal interface__ to __a growing number of Has
1818
__We are currently focusing on using the [Language Server Protocol](https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md) as the interface via which
1919
we talk to clients.__
2020

21-
- [Haskell IDE Engine](#haskell-ide-engine)
22-
- [Features](#features)
23-
- [Installation](#installation)
24-
- [stack on Linux](#installation-with-stack-on-linux)
25-
- [stack on Windows](#installation-with-stack-on-windows)
26-
- [macOS](#installation-on-macos)
27-
- [Nix](#installation-with-nix)
28-
- [ArchLinux](#installation-on-archlinux)
29-
- [Shake](#installation-with-shake)
30-
- [Configuration](#configuration)
31-
- [Editor Integration](#editor-integration)
32-
- Using HIE with [VS Code](#using-hie-with-vs-code), [Sublime Text](#using-hie-with-sublime-text), [Vim/Neovim](#using-hie-with-vim-or-neovim), [Atom](#using-hie-with-atom), [Oni](#using-hie-with-oni), [Emacs](#using-hie-with-emacs), [Spacemacs](#using-hie-with-spacemacs) or [Spacemacs+Nix](#using-hie-with-spacemacs-on-nix-based-projects)
33-
- [Docs on hover/completion](#docs-on-hovercompletion)
34-
- [Contributing](#contributing)
35-
- [Planned Features](#planned-features)
36-
- [It's time to join the project!](#its-time-to-join-the-project)
21+
- [Haskell IDE Engine (HIE)](#haskell-ide-engine-hie)
22+
- [Features](#features)
23+
- [Installation](#installation)
24+
- [Installation with Nix](#installation-with-nix)
25+
- [Installation on ArchLinux](#installation-on-archlinux)
26+
- [Installation from source](#installation-from-source)
27+
- [Linux pre-requirements](#linux-pre-requirements)
28+
- [Windows: long paths (optional)](#windows-long-paths-optional)
29+
- [Download the source code](#download-the-source-code)
30+
- [Choose your GHC version](#choose-your-ghc-version)
31+
- [Install a specific GHC version 8.2.1 - 8.6.3](#install-a-specific-ghc-version-821---863)
32+
- [For GHC 8.0.2](#for-ghc-802)
33+
- [Install *all* available GHC versions](#install-all-available-ghc-versions)
34+
- [Installation with Shake](#installation-with-shake)
35+
- [Install specific GHC Version with Shake](#install-specific-ghc-version-with-shake)
36+
- [Install *all* available GHC versions with Shake](#install-all-available-ghc-versions-with-shake)
37+
- [Configuration](#configuration)
38+
- [Editor Integration](#editor-integration)
39+
- [Using HIE with VS Code](#using-hie-with-vs-code)
40+
- [Using VS Code with Nix](#using-vs-code-with-nix)
41+
- [Using HIE with Sublime Text](#using-hie-with-sublime-text)
42+
- [Using HIE with Vim or Neovim](#using-hie-with-vim-or-neovim)
43+
- [vim-plug](#vim-plug)
44+
- [Vim 8.0](#vim-80)
45+
- [Sample `~/.vimrc`](#sample-vimrc)
46+
- [Using HIE with Atom](#using-hie-with-atom)
47+
- [Using HIE with Emacs](#using-hie-with-emacs)
48+
- [Using HIE with Spacemacs](#using-hie-with-spacemacs)
49+
- [Using HIE with Spacemacs on Nix Based Projects](#using-hie-with-spacemacs-on-nix-based-projects)
50+
- [Using HIE with Oni](#using-hie-with-oni)
51+
- [Docs on hover/completion](#docs-on-hovercompletion)
52+
- [Contributing](#contributing)
53+
- [Planned Features](#planned-features)
54+
- [It's time to join the project!](#its-time-to-join-the-project)
55+
- [Documentation](#documentation)
3756
- [Architecture](#architecture)
38-
- [1. BIOS layer](#1-bios-layer)
39-
- [2. Plugin layer](#2-plugin-layer)
40-
- [3. IDE interfacing layer](#3-ide-interfacing-layer)
41-
- [Documentation](#documentation)
42-
- [Troubleshooting](#troubleshooting)
57+
- [Troubleshooting](#troubleshooting)
58+
- [DYLD on macOS](#dyld-on-macos)
59+
- [macOS: Got error while installing GHC 8.6.1 or 8.6.2 - dyld: Library not loaded: /usr/local/opt/gmp/lib/libgmp.10.dylib](#macos-got-error-while-installing-ghc-861-or-862---dyld-library-not-loaded-usrlocaloptgmpliblibgmp10dylib)
60+
- [macOS: Got error while processing diagnostics: unable to load package `integer-gmp-1.0.2.0`](#macos-got-error-while-processing-diagnostics-unable-to-load-package-integer-gmp-1020)
61+
- [cannot satisfy -package-id \<package\>](#cannot-satisfy--package-id-package)
62+
- [Is \<package\> base-x?](#is-package-base-x)
63+
- [Is there a hash (#) after \<package\>?](#is-there-a-hash--after-package)
64+
- [Otherwise](#otherwise)
4365

4466
## Features
4567

@@ -283,6 +305,36 @@ stack ./install.hs hie-8.4.4
283305
stack ./install.hs build-doc-8.4.4
284306
```
285307

308+
The Haskell IDE Engine can also be built with `cabal new-build` instead of `stack build`.
309+
This has the advantage that you can decide how the GHC versions have been installed.
310+
However, this approach does currently not work for windows due to a missing feature upstream.
311+
To see what GHC versions are available, the command `stack install.hs cabal-ghcs` can be used.
312+
It will list all GHC versions that are on the path and their respective installation directory.
313+
If you think, this list is incomplete, you can try to modify the PATH variable, such that the executables can be found.
314+
Note, that the targets `cabal-build`, `cabal-build-docs` and `cabal-build-all` depend on the found GHC versions.
315+
They install Haskell IDE Engine only for the found GHC versions.
316+
317+
An example output is:
318+
319+
```bash
320+
> stack install.hs cabal-ghcs
321+
******************************************************************
322+
Found the following GHC paths:
323+
ghc-8.4.4: /opt/bin/ghc-8.4.4
324+
ghc-8.6.2: /opt/bin/ghc-8.6.2
325+
326+
******************************************************************
327+
```
328+
329+
If your desired ghc has been found, you use it to install Haskell IDE Engine.
330+
331+
```bash
332+
stack install.hs cabal-hie-8.4.4
333+
stack install.hs cabal-build-doc-8.4.4
334+
```
335+
336+
In general, targets that use `cabal` instead of `stack` are prefixed with `cabal-*` and are identical to their counterpart, except they do not install a GHC if it is missing but fail.
337+
286338
#### Install *all* available GHC versions with Shake
287339

288340
*Warning*: Requires 20+ GB of space and potentially more than 2 hours to install, so please be patient!
@@ -306,6 +358,18 @@ Then add
306358

307359
to VS Code user settings.
308360

361+
To install HIE only for those GHC versions that are present on your system, you use:
362+
363+
```bash
364+
stack ./install.hs cabal-build-all
365+
```
366+
367+
This will:
368+
369+
- install Haskell Ide Engine for GHC versions that have been found on your path
370+
- name them as expected by the VS Code plugin
371+
- build local hoogle docs for each version
372+
309373
## Configuration
310374
There are some settings that can be configured via a `settings.json` file:
311375

0 commit comments

Comments
 (0)