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

Commit f1280dd

Browse files
authored
Merge pull request #998 from ianchanning/patch-1
Updated README installation instructions
2 parents 5b8cfbc + 5fb51f5 commit f1280dd

File tree

1 file changed

+111
-45
lines changed

1 file changed

+111
-45
lines changed

README.md

Lines changed: 111 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Haskell IDE Engine
1+
# Haskell IDE Engine (HIE)
22
<img src="https://github.com/haskell/haskell-ide-engine/raw/master/logos/HIE_logo_512.png" width="256" style="margin:25px;" align="right"/>
33

44
[![License BSD3][badge-license]][license]
@@ -21,8 +21,11 @@ we talk to clients.__
2121
- [Haskell IDE Engine](#haskell-ide-engine)
2222
- [Features](#features)
2323
- [Installation](#installation)
24-
- Installation with [stack](#installation-with-stack) or [Nix](#installation-with-nix)
25-
- [ArchLinux](#archlinux)
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)
2629
- [Configuration](#configuration)
2730
- [Editor Integration](#editor-integration)
2831
- 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)
@@ -95,52 +98,109 @@ we talk to clients.__
9598

9699
## Installation
97100

98-
Note: The version on branch `hie-0.1.0.0` supports GHC 8.0.2. This is
99-
not supported in master.
101+
### Installation with stack on Linux
100102

101-
On linux derivatives you will need to do the equivalent of before building
103+
To install HIE, you need stack version >= 1.7.1.
104+
105+
HIE builds from source code, so there's a couple of extra steps.
106+
107+
#### Linux pre-requirements
108+
109+
On Linux you will need install a couple of extra libraries (for Unicode ([ICU](http://site.icu-project.org/)) and [NCURSES](https://www.gnu.org/software/ncurses/)):
110+
111+
**Debian/Ubuntu**:
102112

103113
```bash
104114
sudo apt install libicu-dev libtinfo-dev
105115
```
116+
**Fedora**:
106117

118+
```bash
119+
sudo dnf install libicu-devel ncurses-devel
120+
```
121+
**ArchLinux**: see [below](#installation-on-archlinux).
107122

108-
### Getting the source for GHC 8.2.1 to 8.6.2
123+
#### Download the source code
109124

110-
HIE builds from source code, so first,
125+
```bash
126+
git clone https://github.com/haskell/haskell-ide-engine --recursive
127+
cd haskell-ide-engine
128+
```
129+
130+
In order to support both stack and cabal, HIE requires `cabal-install`
131+
as well. If it is not already installed, install it and update its package list:
111132

112133
```bash
113-
$ git clone https://github.com/haskell/haskell-ide-engine --recursive
114-
$ cd haskell-ide-engine
134+
stack install cabal-install
135+
cabal update
115136
```
116-
### Getting the source for GHC 8.0.2
117137

118-
HIE builds from source code, so first,
138+
#### Choose your GHC version
139+
140+
The GHC version you are going to install HIE for depends on which version of GHC you are using for your project. If you don't have a current project there are two potential options:
141+
142+
1. The Nightly GHC version ([currently](https://www.stackage.org/nightly) 8.6.2)
143+
2. The LTS GHC version (which is [currently](https://www.stackage.org/lts) 8.4.4)
144+
145+
By default in a stack project you will get the LTS version.
146+
147+
You can check which version of ghc you are using in your project by running the following at the root of your project:
119148

120149
```bash
121-
$ git clone https://github.com/haskell/haskell-ide-engine
122-
$ cd haskell-ide-engine
123-
$ git checkout hie-0.1.0.0
124-
$ git submodule update --init
150+
stack ghc -- --version
125151
```
126152

127-
### Installation with stack
153+
You can install an specific version or [all available GHC versions](#install-all-available-ghc-versions).
128154

129-
To install HIE, you need Stack version >= 1.7.1
155+
#### Install a specific GHC version 8.2.1 - 8.6.2
130156

131-
In order to support both stack and cabal, `hie` requires `cabal-install`
132-
as well.
157+
We will use the `make` tools here to wrap `stack install`. The preferred installation mechanism is via `make`, as it makes sure the repo is synced, installs the required cabal libraries if missing, and makes copies of the executables with suffixes to be able to tell them apart.
133158

134-
If it is not already installed, install it and update its package list. One of the ways is:
159+
Install **Nightly** (and hoogle docs):
135160

136161
```bash
137-
stack install cabal-install
138-
cabal update
162+
make hie-8.6.2
163+
make build-doc-8.6.2
164+
```
165+
166+
Install **LTS** (and hoogle docs):
167+
168+
```bash
169+
make hie-8.4.4
170+
make build-doc-8.4.4
171+
```
172+
173+
This step can take more than 30 minutes, so grab a coffee and please be patient!
174+
175+
The available versions depend on the `stack-*.yaml` config files in the `haskell-ide-engine` directory.
176+
177+
#### For GHC 8.0.2
178+
179+
This is no longer supported on the HIE `master` branch, so you must switch to the `hie-0.1.0.0` branch:
180+
181+
```bash
182+
git checkout hie-0.1.0.0
183+
git submodule update --init
184+
```
185+
Then you can run `stack install`:
186+
187+
```bash
188+
stack --stack-yaml=stack-8.0.2.yaml install
139189
```
140190

141-
To install all supported GHC versions, name them as expected by the VS Code
142-
plugin, and also build a local hoogle database, you need the `make` tool (on
143-
Windows, see the further advice below). Use the command:
191+
#### Install *all* available GHC versions
192+
193+
This is the simplest approach as it will install all GHC versions to match against any project versions you might have.
194+
195+
*Warning*: Requires 20+ GB of space and potentially more than 2 hours to install, so please be patient!
196+
197+
This will:
198+
199+
* install all supported GHC versions (8.2.1 - 8.6.2)
200+
* name them as expected by the VS Code plugin
201+
* build local hoogle docs for each version
202+
203+
For this you need the `make` tool (on Windows, see the further advice below). Use the command:
144204

145205
```bash
146206
make build-all
@@ -155,41 +215,47 @@ Then add
155215

156216
to VS Code user settings.
157217

158-
Otherwise, do one of the following.
218+
### Installation with stack on Windows
159219

160-
#### For GHC 8.6.2
220+
To install HIE, you need stack version >= 1.7.1.
161221

162-
Using master
222+
#### Download the source code
163223

164224
```bash
165-
stack install
225+
git clone https://github.com/haskell/haskell-ide-engine --recursive
226+
cd haskell-ide-engine
166227
```
167228

168-
#### For Other Versions of GHC
169-
170-
Using master
229+
In order to support both stack and cabal, HIE requires `cabal-install`
230+
as well. If it is not already installed, install it and update its package list:
171231

172232
```bash
173-
stack --stack-yaml=stack-<VERSION>.yaml install
233+
stack install cabal-install
234+
cabal update
174235
```
175236

176-
where `<VERSION>` correlates to one of the yaml files in the hie directory.
237+
#### Install *all* available GHC versions
238+
239+
*Warning*: Requires 20+ GB of space and potentially more than 2 hours to install, so please be patient!
177240

178-
Note that GHC 8.0.2 is only available via branch `hie-0.1.0.0` and not
179-
`master`, but otherwise the instructions above are the same.
241+
This will:
180242

181-
### Installation on Windows
243+
* install all supported GHC versions (8.2.1 - 8.6.2)
244+
* name them as expected by the VS Code plugin
245+
* build local hoogle docs for each version
182246

183-
The `Makefile` doesn't work on Windows due to several UNIX-specific things, such
247+
`make` doesn't work on Windows due to several UNIX-specific things, such
184248
as the `cp` command or extensionless executable names. Instead, a PowerShell
185249
script is provided specifically for this purpose:
186250

187-
**Under PowerShell run:**
251+
**PowerShell:**
252+
188253
```
189254
./build-all.ps1
190255
```
191256

192-
**Under cmd.exe run:**
257+
**cmd.exe:**
258+
193259
```
194260
powershell -ExecutionPolicy RemoteSigned -c ./build-all.ps1
195261
```
@@ -198,11 +264,11 @@ powershell -ExecutionPolicy RemoteSigned -c ./build-all.ps1
198264

199265
In order to avoid problems with long paths on Windows you can do the following:
200266

201-
1. Edit the group policy: set "Enable Win32 long paths" to "Enabled". Works
202-
only for Windows 10
267+
1. Edit the group policy: set "Enable Win32 long paths" to "Enabled" (Works
268+
only for Windows 10).
203269

204270
2. Clone the `haskell-ide-engine` to the root of your logical drive (e.g. to
205-
`E:\hie`)
271+
`C:\hie`)
206272

207273
### Installation on macOS
208274

@@ -219,7 +285,7 @@ Alternatively, you can install from source with `make build`.
219285
Follow the instructions at https://github.com/domenkozar/hie-nix
220286

221287

222-
### ArchLinux
288+
### Installation on ArchLinux
223289

224290
An [haskell-ide-engine-git](https://aur.archlinux.org/packages/haskell-ide-engine-git/) package is available on the AUR.
225291

0 commit comments

Comments
 (0)