From 38c62342dbed499b3d7352c271fcd350017ecb11 Mon Sep 17 00:00:00 2001 From: Anrock Date: Thu, 7 Mar 2019 18:17:06 +0300 Subject: [PATCH 1/6] Remove superfluous link to arch linux installation --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 3f41707de..5caee6e2d 100644 --- a/README.md +++ b/README.md @@ -156,7 +156,6 @@ sudo apt install libicu-dev libtinfo-dev libgmp-dev ```bash sudo dnf install libicu-devel ncurses-devel ``` -**ArchLinux**: see [below](#installation-on-archlinux). #### Windows: long paths (optional) From e7b8f4ca671fb1349417970a79c899a7295efed5 Mon Sep 17 00:00:00 2001 From: Anrock Date: Thu, 7 Mar 2019 18:19:40 +0300 Subject: [PATCH 2/6] Remove section about makefile from README --- README.md | 97 ------------------------------------------------------- 1 file changed, 97 deletions(-) diff --git a/README.md b/README.md index 5caee6e2d..048023090 100644 --- a/README.md +++ b/README.md @@ -174,103 +174,6 @@ git clone https://github.com/haskell/haskell-ide-engine --recurse-submodules cd haskell-ide-engine ``` -#### Choose your GHC version - -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: - -1. The Nightly GHC version ([currently](https://www.stackage.org/nightly) 8.6.3) -2. The LTS GHC version (which is [currently](https://www.stackage.org/lts) 8.4.4) - -By default in a stack project you will get the LTS version. - -You can check which version of ghc you are using in your project by running the following at the root of your project: - -```bash -stack ghc -- --version -``` - -You can install an specific version or [all available GHC versions](#install-all-available-ghc-versions). - -#### Install a specific GHC version 8.2.1 - 8.6.3 - -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. - -Install **Nightly** (and hoogle docs): - -```bash -make hie-8.6.3 -make build-doc-8.6.3 -``` - -Install **LTS** (and hoogle docs): - -```bash -make hie-8.4.4 -make build-doc-8.4.4 -``` - -This step can take more than 30 minutes, so grab a coffee and please be patient! - -The available versions depend on the `stack-*.yaml` config files in the `haskell-ide-engine` directory. - -#### For GHC 8.0.2 - -This is no longer supported on the HIE `master` branch, so you must switch to the `hie-0.1.0.0` branch: - -```bash -git checkout hie-0.1.0.0 -git submodule update --init -``` -Then you can run `stack install`: - -```bash -stack --stack-yaml=stack-8.0.2.yaml install -``` - -#### Install *all* available GHC versions - -This is the simplest approach as it will install all GHC versions to match against any project versions you might have. - -*Warning*: Requires 20+ GB of space and potentially more than 2 hours to install, so please be patient! - -This will: - -* install all supported GHC versions (8.2.1 - 8.6.3) -* name them as expected by the VS Code plugin -* build local hoogle docs for each version - -On non-Windows platforms use the command: - -```bash -make build-all -``` - -On Windows use: -**PowerShell:** - -``` -./build-all.ps1 -``` - -or - -**cmd.exe:** - -``` -powershell -ExecutionPolicy RemoteSigned -c ./build-all.ps1 -``` - - -Then add - -```json -"languageServerHaskell.useCustomHieWrapper": true, -"languageServerHaskell.useCustomHieWrapperPath": "hie-wrapper", -``` - -to VS Code user settings. - - ### Installation with Shake Experimental build script for HIE. Feedback is appreciated. From e22c323ba54bc051af2c5ba55d3d2c7f61e84906 Mon Sep 17 00:00:00 2001 From: Anrock Date: Thu, 7 Mar 2019 18:22:59 +0300 Subject: [PATCH 3/6] Remove unneeded clarifications about built tool --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 048023090..b1d8d197b 100644 --- a/README.md +++ b/README.md @@ -174,11 +174,10 @@ git clone https://github.com/haskell/haskell-ide-engine --recurse-submodules cd haskell-ide-engine ``` -### Installation with Shake +### Installation -Experimental build script for HIE. Feedback is appreciated. Uses the [shake](https://shakebuild.com/) build system for predictable builds. -The build script is platform independent and the only prerequisites are that `git` and `stack` are installed. The dependency on `make` and other linux specific commands has been dropped. +The build script is platform independent and the only prerequisites are that `git` and `stack` are installed. It is also required, that the directory output of `stack path --local-bin` is on the path before installation, otherwise the installation of `cabal` will fail and `hie` executables may not be found. The installation path is usually `~/.local/bin` on UNIX systems and `C:\Users\User\AppData\Roaming\local\bin` on windows. @@ -193,7 +192,7 @@ stack ./install.hs help Remember, this will take time to download a Stackage-LTS and an appropriate GHC. However, afterwards all commands should work as expected. -#### Install specific GHC Version with Shake +#### Install specific GHC Version Install **Nightly** (and hoogle docs): @@ -239,7 +238,7 @@ stack install.hs cabal-build-doc-8.4.4 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. -#### Install *all* available GHC versions with Shake +#### Install *all* available GHC versions *Warning*: Requires 20+ GB of space and potentially more than 2 hours to install, so please be patient! From d2d60c84957b884f51d09515b6223d36fc563eee Mon Sep 17 00:00:00 2001 From: Anrock Date: Fri, 8 Mar 2019 13:17:12 +0300 Subject: [PATCH 4/6] Extract all pre-requirements to one section --- README.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b1d8d197b..4b5576ece 100644 --- a/README.md +++ b/README.md @@ -142,7 +142,13 @@ To install HIE, you need stack version >= 1.7.1. HIE builds from source code, so there's a couple of extra steps. -#### Linux pre-requirements +#### Common pre-requirements + +* `stack` must be in your PATH +* `git` must be in your PATH +* Stack local bin directory must be in your PATH. Get it with `stack path --local-bin` + +#### Linux-specific pre-requirements 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/)): @@ -157,7 +163,7 @@ sudo apt install libicu-dev libtinfo-dev libgmp-dev sudo dnf install libicu-devel ncurses-devel ``` -#### Windows: long paths (optional) +#### Windows-specific pre-requirements (optional) In order to avoid problems with long paths on Windows you can do the following: @@ -177,9 +183,6 @@ cd haskell-ide-engine ### Installation Uses the [shake](https://shakebuild.com/) build system for predictable builds. -The build script is platform independent and the only prerequisites are that `git` and `stack` are installed. -It is also required, that the directory output of `stack path --local-bin` is on the path before installation, otherwise the installation of `cabal` will fail and `hie` executables may not be found. -The installation path is usually `~/.local/bin` on UNIX systems and `C:\Users\User\AppData\Roaming\local\bin` on windows. Note, on first invocation of the build script, a GHC is being installed for execution. However, if you build HIE for every GHC, no GHC is downloaded twice. The GHC used for the `install.hs` can be adjusted in `shake.yaml` by using a different resolver. From 5d0891e057cb6cca41bbaec42f2f76e9d0892d12 Mon Sep 17 00:00:00 2001 From: Anrock Date: Fri, 8 Mar 2019 13:40:34 +0300 Subject: [PATCH 5/6] Remove install-all section, shuffle other text a bit --- README.md | 38 ++++++++++---------------------------- 1 file changed, 10 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 4b5576ece..92de83479 100644 --- a/README.md +++ b/README.md @@ -184,7 +184,7 @@ cd haskell-ide-engine Uses the [shake](https://shakebuild.com/) build system for predictable builds. -Note, on first invocation of the build script, a GHC is being installed for execution. However, if you build HIE for every GHC, no GHC is downloaded twice. +Note, on first invocation of the build script, a GHC is being installed for execution. The GHC used for the `install.hs` can be adjusted in `shake.yaml` by using a different resolver. Available commands can be seen with: @@ -239,43 +239,25 @@ stack install.hs cabal-hie-8.4.4 stack install.hs cabal-build-doc-8.4.4 ``` -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. - -#### Install *all* available GHC versions - -*Warning*: Requires 20+ GB of space and potentially more than 2 hours to install, so please be patient! - -This will: - -* install all supported GHC versions (8.2.1 - 8.6.3) -* name them as expected by the VS Code plugin -* build local hoogle docs for each version +To install HIE for all GHC versions that are present on your system, use: ```bash -stack ./install.hs build-all +stack ./install.hs cabal-build-all ``` -Then add +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. + +#### Multiple versions of HIE (optional) + +If you installed multiple versions of HIE then you will need to use a wrapper script. +Wrapper script will analyze your project, find suitable version of HIE and launch it. +Enable it by editing VS Code settings like that: ```json "languageServerHaskell.useCustomHieWrapper": true, "languageServerHaskell.useCustomHieWrapperPath": "hie-wrapper", ``` -to VS Code user settings. - -To install HIE only for those GHC versions that are present on your system, you use: - -```bash -stack ./install.hs cabal-build-all -``` - -This will: - -- install Haskell Ide Engine for GHC versions that have been found on your path -- name them as expected by the VS Code plugin -- build local hoogle docs for each version - ## Configuration There are some settings that can be configured via a `settings.json` file: From e5ed4c995bdc9cf8da38fa60d977e77abf4cb5ab Mon Sep 17 00:00:00 2001 From: Anrock Date: Fri, 8 Mar 2019 17:35:11 +0300 Subject: [PATCH 6/6] Add small tip for commands in PATH --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 92de83479..caeec89fa 100644 --- a/README.md +++ b/README.md @@ -148,6 +148,10 @@ HIE builds from source code, so there's a couple of extra steps. * `git` must be in your PATH * Stack local bin directory must be in your PATH. Get it with `stack path --local-bin` +Tip: you can quickly check if some command is in your path by running the command. +If you receive some meaningful output instead of "command not found"-like message +then it means you have the command in PATH. + #### Linux-specific pre-requirements 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/)):