From ee9bf3c02b8ce59cd5252b9b53e73c5a9e16dfa8 Mon Sep 17 00:00:00 2001 From: Anrock Date: Tue, 8 Jan 2019 01:28:49 +0300 Subject: [PATCH 01/11] Remove mention of cabal-install from README Build scripts take care of it --- README.md | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/README.md b/README.md index b323723f5..e490b1324 100644 --- a/README.md +++ b/README.md @@ -128,14 +128,6 @@ git clone https://github.com/haskell/haskell-ide-engine --recursive cd haskell-ide-engine ``` -In order to support both stack and cabal, HIE requires `cabal-install` -as well. If it is not already installed, install it and update its package list: - -```bash -stack install cabal-install -cabal update -``` - #### 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: @@ -227,14 +219,6 @@ git clone https://github.com/haskell/haskell-ide-engine --recursive cd haskell-ide-engine ``` -In order to support both stack and cabal, HIE requires `cabal-install` -as well. If it is not already installed, install it and update its package list: - -```bash -stack install cabal-install -cabal update -``` - #### Install *all* available GHC versions *Warning*: Requires 20+ GB of space and potentially more than 2 hours to install, so please be patient! From 8427f5c97467305e0e427b1a91e99e1765d1213b Mon Sep 17 00:00:00 2001 From: Anrock Date: Tue, 8 Jan 2019 02:05:17 +0300 Subject: [PATCH 02/11] Remove duplicate piece about stack and source checkout in README --- README.md | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index e490b1324..5e5083a64 100644 --- a/README.md +++ b/README.md @@ -99,11 +99,11 @@ we talk to clients.__ ## Installation -### Installation with stack on Linux +### Installation with stack To install HIE, you need stack version >= 1.7.1. -HIE builds from source code, so there's a couple of extra steps. +HIE builds from source code, so there's a couple of extra steps. #### Linux pre-requirements @@ -208,17 +208,6 @@ Then add to VS Code user settings. -### Installation with stack on Windows - -To install HIE, you need stack version >= 1.7.1. - -#### Download the source code - -```bash -git clone https://github.com/haskell/haskell-ide-engine --recursive -cd haskell-ide-engine -``` - #### Install *all* available GHC versions *Warning*: Requires 20+ GB of space and potentially more than 2 hours to install, so please be patient! From 731f376679e5a512f84d2bcc475ed7da872baf58 Mon Sep 17 00:00:00 2001 From: Anrock Date: Tue, 8 Jan 2019 02:06:39 +0300 Subject: [PATCH 03/11] Move Windows long path section up to requirements section --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 5e5083a64..f0db25589 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,16 @@ sudo dnf install libicu-devel ncurses-devel ``` **ArchLinux**: see [below](#installation-on-archlinux). +#### Windows: long paths (optional) + +In order to avoid problems with long paths on Windows you can do the following: + +1. Edit the group policy: set "Enable Win32 long paths" to "Enabled" (Works + only for Windows 10). + +2. Clone the `haskell-ide-engine` to the root of your logical drive (e.g. to + `C:\hie`) + #### Download the source code ```bash @@ -234,16 +244,6 @@ script is provided specifically for this purpose: powershell -ExecutionPolicy RemoteSigned -c ./build-all.ps1 ``` -#### Long paths - -In order to avoid problems with long paths on Windows you can do the following: - -1. Edit the group policy: set "Enable Win32 long paths" to "Enabled" (Works - only for Windows 10). - -2. Clone the `haskell-ide-engine` to the root of your logical drive (e.g. to - `C:\hie`) - ### Installation on macOS Download the pre-built binaries from the [releases page](https://github.com/haskell/haskell-ide-engine/releases), and copy/symlink them into `/usr/local/bin` (or somewhere else in your $PATH): From 49f855155f405066a74bcf5165535d05ec3e553a Mon Sep 17 00:00:00 2001 From: Anrock Date: Tue, 8 Jan 2019 02:13:05 +0300 Subject: [PATCH 04/11] Merge Window-specific build-all section to common one --- README.md | 39 +++++++++++++++------------------------ 1 file changed, 15 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index f0db25589..6f7d73cad 100644 --- a/README.md +++ b/README.md @@ -203,47 +203,38 @@ This will: * name them as expected by the VS Code plugin * build local hoogle docs for each version -For this you need the `make` tool (on Windows, see the further advice below). Use the command: +On non-Windows platforms use the command: ```bash make build-all ``` -Then add - -```json -"languageServerHaskell.useCustomHieWrapper": true, -"languageServerHaskell.useCustomHieWrapperPath": "hie-wrapper", -``` - -to VS Code user settings. - -#### 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 - -`make` doesn't work on Windows due to several UNIX-specific things, such -as the `cp` command or extensionless executable names. Instead, a PowerShell -script is provided specifically for this purpose: - +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 on macOS Download the pre-built binaries from the [releases page](https://github.com/haskell/haskell-ide-engine/releases), and copy/symlink them into `/usr/local/bin` (or somewhere else in your $PATH): From 231958c54c9e006aca889b7284b6970c4434c0ec Mon Sep 17 00:00:00 2001 From: Anrock Date: Tue, 8 Jan 2019 02:17:02 +0300 Subject: [PATCH 05/11] Move OSX DYLD section to troubleshooting --- README.md | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 6f7d73cad..5b6a7968f 100644 --- a/README.md +++ b/README.md @@ -245,24 +245,6 @@ ln -s hie-bin-dir/hie* /usr/local/bin/ Alternatively, you can install from source with `make build` or `make build-all`. -#### DYLD on macOS - -If you hit a problem that looks like ```can't load .so/.DLL for: libiconv.dylib (dlopen(libiconv.dylib, 5): image not found)```, it means that libraries cannot be found in the library path. We can hint where to look for them and append more paths to `DYLD_LIBRARY_PATH`. - -``` -export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:/usr/lib:/usr/local/lib" -``` - -On practice `/usr/local/lib` is full of dylibs linked by `brew`. After you amend `DYLD_LIBRARY_PATH`, some of the previously compiled application might not work and yell about incorrect linking, for example, `dyld: Symbol not found: __cg_jpeg_resync_to_restart`. You may need to look up where it comes from and remove clashing links, in this case it were clashing images libs: - -```sh -$ brew unlink libjpeg -$ brew unlink libtiff -$ brew unlink libpng -``` - -Recompile. - ### Installation with Nix Follow the instructions at https://github.com/domenkozar/hie-nix @@ -651,6 +633,24 @@ All the documentation is in [the docs folder](/docs) at the root of this project ## Troubleshooting +### DYLD on macOS + +If you hit a problem that looks like ```can't load .so/.DLL for: libiconv.dylib (dlopen(libiconv.dylib, 5): image not found)```, it means that libraries cannot be found in the library path. We can hint where to look for them and append more paths to `DYLD_LIBRARY_PATH`. + +``` +export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:/usr/lib:/usr/local/lib" +``` + +On practice `/usr/local/lib` is full of dylibs linked by `brew`. After you amend `DYLD_LIBRARY_PATH`, some of the previously compiled application might not work and yell about incorrect linking, for example, `dyld: Symbol not found: __cg_jpeg_resync_to_restart`. You may need to look up where it comes from and remove clashing links, in this case it were clashing images libs: + +```sh +$ brew unlink libjpeg +$ brew unlink libtiff +$ brew unlink libpng +``` + +Recompile. + ### 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 These builds have a dependency on [homebrew](https://brew.sh)'s `gmp` library. Install with brew: `brew install gmp`. From 29c4816be4ea1d18ee832b665c0dfb33923dba0d Mon Sep 17 00:00:00 2001 From: Anrock Date: Tue, 8 Jan 2019 02:27:52 +0300 Subject: [PATCH 06/11] Move platform-specific installation instruction above source install --- README.md | 53 +++++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 5b6a7968f..4607a5495 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,33 @@ we talk to clients.__ ## Installation -### Installation with stack +### Installation on macOS + +Download the pre-built binaries from the [releases page](https://github.com/haskell/haskell-ide-engine/releases), and copy/symlink them into `/usr/local/bin` (or somewhere else in your $PATH): + +```bash +ln -s hie-bin-dir/hie* /usr/local/bin/ +``` + +Alternatively, you can install from source. See instructions below + +### Installation with Nix + +Follow the instructions at https://github.com/domenkozar/hie-nix + + +### Installation on ArchLinux + +An [haskell-ide-engine-git](https://aur.archlinux.org/packages/haskell-ide-engine-git/) package is available on the AUR. + +Using [Aura](https://github.com/aurapm/aura): + +``` +# aura -A haskell-ide-engine-git +``` + + +### Installation from source To install HIE, you need stack version >= 1.7.1. @@ -235,31 +261,6 @@ Then add to VS Code user settings. -### Installation on macOS - -Download the pre-built binaries from the [releases page](https://github.com/haskell/haskell-ide-engine/releases), and copy/symlink them into `/usr/local/bin` (or somewhere else in your $PATH): - -```bash -ln -s hie-bin-dir/hie* /usr/local/bin/ -``` - -Alternatively, you can install from source with `make build` or `make build-all`. - -### Installation with Nix - -Follow the instructions at https://github.com/domenkozar/hie-nix - - -### Installation on ArchLinux - -An [haskell-ide-engine-git](https://aur.archlinux.org/packages/haskell-ide-engine-git/) package is available on the AUR. - -Using [Aura](https://github.com/aurapm/aura): - -``` -# aura -A haskell-ide-engine-git -``` - ### Installation with Shake Experimental build script for HIE. Feedback is appreciated. From cee7b4fb1336273e683c44448717aa3c4ed52bab Mon Sep 17 00:00:00 2001 From: Anrock Date: Tue, 8 Jan 2019 02:41:19 +0300 Subject: [PATCH 07/11] Remove Makefile and build-all.ps1 instructions from README --- README.md | 111 ++++++++---------------------------------------------- 1 file changed, 16 insertions(+), 95 deletions(-) diff --git a/README.md b/README.md index 4607a5495..53238d36b 100644 --- a/README.md +++ b/README.md @@ -181,46 +181,28 @@ 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 +#### Install HIE for projects with GHC >= 8.2.1 -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): +Uses the [shake](https://shakebuild.com/) build system for predictable builds. +The build script itself is platform independent and the only prerequisites are that `git` and `stack` are installed. -```bash -make hie-8.6.3 -make build-doc-8.6.3 -``` +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 `Shakefile.hs` can be adjusted in `shake.yaml` by using a different resolver. -Install **LTS** (and hoogle docs): +To build and install HIE for chosen GHC X.Y.Z version use command: ```bash -make hie-8.4.4 -make build-doc-8.4.4 +stack ./Shakefile.hs hie-X.Y.Z ``` -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: +All available commands can be seen with: ```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 +stack ./Shakefile.hs help ``` #### 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: @@ -229,28 +211,10 @@ This will: * 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 +stack ./Shakefile.hs build-all ``` - Then add ```json @@ -260,63 +224,20 @@ Then add to VS Code user settings. +#### For GHC 8.0.2 -### Installation with Shake - -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. - -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 `Shakefile.hs` can be adjusted in `shake.yaml` by using a different resolver. - -Available commands can be seen with: - -```bash -stack ./Shakefile.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 **Nightly** (and hoogle docs): - -```bash -stack ./Shakefile.hs hie-8.6.3 -stack ./Shakefile.hs build-doc-8.6.3 -``` - -Install **LTS** (and hoogle docs): +This is no longer supported on the HIE `master` branch, so you must switch to the `hie-0.1.0.0` branch: ```bash -stack ./Shakefile.hs hie-8.4.4 -stack ./Shakefile.hs build-doc-8.4.4 +git checkout hie-0.1.0.0 +git submodule update --init ``` - -#### Install *all* available GHC versions with Shake - -*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 +Then you can run `stack install`: ```bash -stack ./Shakefile.hs build-all -``` - -Then add - -```json -"languageServerHaskell.useCustomHieWrapper": true, -"languageServerHaskell.useCustomHieWrapperPath": "hie-wrapper", +stack --stack-yaml=stack-8.0.2.yaml install ``` -to VS Code user settings. - ## Configuration There are some settings that can be configured via a `settings.json` file: From 636bdc02de648cfd96cae632b762b3eba0f10221 Mon Sep 17 00:00:00 2001 From: Luke Lau Date: Wed, 9 Jan 2019 15:33:10 -0500 Subject: [PATCH 08/11] Try adding a shakefile job to circleCI --- .circleci/config.yml | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b32e7f3b4..659aed321 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -89,6 +89,12 @@ defaults: &defaults key: stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "stack-build.txt" }}-{{ checksum "all-cabal.txt" }} paths: *cache_paths + - persist_to_workspace: + root: .stack-work + paths: + - install + - dist + version: 2 jobs: ghc-8.0.2: @@ -144,8 +150,7 @@ jobs: cabal: working_directory: ~/build docker: - # - image: quay.io/haskell_works/ghc-8.4.3 - - image: quay.io/haskell_works/ghc-8.6.1 + - image: alanz/haskell-hie-ci steps: - checkout - run: @@ -174,6 +179,15 @@ jobs: paths: - ~/.cabal + shakefile: + docker: + - image: fpco/stack-build + steps: + - checkout # don't checkout submodules: Shakefile.hs should take care of that + - attach_workspace: + at: .stack-work + - run: ./Shakefile.hs build-8.6.3 + workflows: version: 2 @@ -189,3 +203,6 @@ workflows: - ghc-8.6.3 - ghc-nightly - cabal + - shakefile: + requires: + - ghc-8.6.3 From 76e22453de91757458a9bdbc88a490a7df5452cb Mon Sep 17 00:00:00 2001 From: Luke Lau Date: Wed, 9 Jan 2019 16:36:33 -0500 Subject: [PATCH 09/11] Try build-all in shakefile test --- .circleci/config.yml | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 659aed321..1bc69d5a4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -92,8 +92,7 @@ defaults: &defaults - persist_to_workspace: root: .stack-work paths: - - install - - dist + - install/*/*/ version: 2 jobs: @@ -186,7 +185,16 @@ jobs: - checkout # don't checkout submodules: Shakefile.hs should take care of that - attach_workspace: at: .stack-work - - run: ./Shakefile.hs build-8.6.3 + - run: ./Shakefile.hs build-all + - run: hie-wrapper --version + - run: hie-8.6.3 --version + - run: hie-8.6.2 --version + - run: hie-8.6.1 --version + - run: hie-8.4.4 --version + - run: hie-8.4.3 --version + - run: hie-8.4.2 --version + - run: hie-8.2.3 --version + - run: hie-8.2.2 --version workflows: @@ -205,4 +213,11 @@ workflows: - cabal - shakefile: requires: + - ghc-8.2.1 + - ghc-8.2.2 + - ghc-8.4.2 + - ghc-8.4.3 + - ghc-8.4.4 + - ghc-8.6.1 + - ghc-8.6.2 - ghc-8.6.3 From f6f9ddde1b5c0b784461b53b50162e88e5d4135c Mon Sep 17 00:00:00 2001 From: Luke Lau Date: Wed, 9 Jan 2019 16:36:33 -0500 Subject: [PATCH 10/11] Try build-all in shakefile test --- .circleci/config.yml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 659aed321..691fcbbee 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -92,8 +92,7 @@ defaults: &defaults - persist_to_workspace: root: .stack-work paths: - - install - - dist + - install/*/*/ version: 2 jobs: @@ -185,8 +184,17 @@ jobs: steps: - checkout # don't checkout submodules: Shakefile.hs should take care of that - attach_workspace: - at: .stack-work - - run: ./Shakefile.hs build-8.6.3 + at: .stack-work + - run: ./Shakefile.hs build-all + - run: hie-wrapper --version + - run: hie-8.6.3 --version + - run: hie-8.6.2 --version + - run: hie-8.6.1 --version + - run: hie-8.4.4 --version + - run: hie-8.4.3 --version + - run: hie-8.4.2 --version + - run: hie-8.2.3 --version + - run: hie-8.2.2 --version workflows: @@ -205,4 +213,11 @@ workflows: - cabal - shakefile: requires: + - ghc-8.2.1 + - ghc-8.2.2 + - ghc-8.4.2 + - ghc-8.4.3 + - ghc-8.4.4 + - ghc-8.6.1 + - ghc-8.6.2 - ghc-8.6.3 From 067488fba6767a2fd99ae30eb8175f28e1facfb3 Mon Sep 17 00:00:00 2001 From: Luke Lau Date: Wed, 9 Jan 2019 20:27:44 -0500 Subject: [PATCH 11/11] Manually specify paths to persist --- .circleci/config.yml | 42 ++++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 691fcbbee..93236bfb0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -89,56 +89,78 @@ defaults: &defaults key: stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "stack-build.txt" }}-{{ checksum "all-cabal.txt" }} paths: *cache_paths - - persist_to_workspace: - root: .stack-work - paths: - - install/*/*/ - version: 2 jobs: - ghc-8.0.2: - environment: - - STACK_FILE: "stack-8.0.2.yaml" - <<: *defaults - ghc-8.2.1: environment: - STACK_FILE: "stack-8.2.1.yaml" + - persist_to_workspace: + root: .stack-work + paths: + - install/*/*/8.2.1 <<: *defaults ghc-8.2.2: environment: - STACK_FILE: "stack-8.2.2.yaml" + - persist_to_workspace: + root: .stack-work + paths: + - install/*/*/8.2.2 <<: *defaults ghc-8.4.2: environment: - STACK_FILE: "stack-8.4.2.yaml" + - persist_to_workspace: + root: .stack-work + paths: + - install/*/*/8.4.2 <<: *defaults ghc-8.4.3: environment: - STACK_FILE: "stack-8.4.3.yaml" + - persist_to_workspace: + root: .stack-work + paths: + - install/*/*/8.4.3 <<: *defaults ghc-8.4.4: environment: - STACK_FILE: "stack-8.4.4.yaml" + - persist_to_workspace: + root: .stack-work + paths: + - install/*/*/8.4.4 <<: *defaults ghc-8.6.1: environment: - STACK_FILE: "stack-8.6.1.yaml" + - persist_to_workspace: + root: .stack-work + paths: + - install/*/*/8.6.1 <<: *defaults ghc-8.6.2: environment: - STACK_FILE: "stack-8.6.2.yaml" + - persist_to_workspace: + root: .stack-work + paths: + - install/*/*/8.6.2 <<: *defaults ghc-8.6.3: environment: - STACK_FILE: "stack-8.6.3.yaml" + - persist_to_workspace: + root: .stack-work + paths: + - install/*/*/8.6.3 <<: *defaults ghc-nightly: