You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 7, 2020. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+8-20Lines changed: 8 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -226,47 +226,35 @@ or using the existing alias script
226
226
227
227
Running the script with cabal on windows requires a cabal version greater or equal to `3.0.0.0`.
228
228
229
-
Unfortunately, it is still required to have `stack` installed so that the install-script can locate the `local-bin` directory (on Linux `~/.local/bin`) and copy the `hie` binaries to `hie-x.y.z`, which is required for the `hie-wrapper` to function as expected. There are plans to remove this requirement and let users build hie only with one build tool or another.
230
-
231
229
For brevity, only the `stack`-based commands are presented in the following sections.
232
230
233
-
##### Install cabal using stack
234
-
235
-
Although you can use hie for stack based projects (those which have a `stack.yaml` in the project base directory) without having cabal installed, you will need it for cabal based projects (with only a `<projectName>.cabal` file or a `cabal.project` one in the project base directory).
236
-
237
-
You can install an appropriate cabal version using stack by running:
238
-
239
-
```bash
240
-
stack ./install.hs stack-install-cabal
241
-
```
242
-
243
231
##### Install specific GHC Version
244
232
245
233
Install hie for the latest available and supported GHC version (and hoogle docs):
246
234
247
235
```bash
248
-
stack ./install.hs build
236
+
stack ./install.hs hie
249
237
```
250
238
251
239
Install hie for a specific GHC version (and hoogle docs):
252
240
253
241
```bash
254
242
stack ./install.hs hie-8.6.5
255
-
stack ./install.hs build-data
243
+
stack ./install.hs data
256
244
```
257
245
258
246
The Haskell IDE Engine can also be built with `cabal v2-build` instead of `stack build`.
259
247
This has the advantage that you can decide how the GHC versions have been installed.
260
-
To see what GHC versions are available, the command `stack install.hs cabal-ghcs` can be used.
248
+
To see what GHC versions are available, the command `cabal-hie-install ghcs` can be used.
261
249
It will list all GHC versions that are on the path and their respective installation directory.
262
250
If you think, this list is incomplete, you can try to modify the PATH variable, such that the executables can be found.
263
-
Note, that the targets `cabal-build` and `cabal-build-data` depend on the found GHC versions.
251
+
Note, that the targets `hie` and `data` depend on the found GHC versions.
264
252
They install Haskell IDE Engine only for the found GHC versions.
If your desired ghc has been found, you use it to install Haskell IDE Engine.
279
267
280
268
```bash
281
-
stack install.hs cabal-hie-8.4.4
282
-
stack install.hs cabal-build-data
269
+
cabal-hie-install hie-8.4.4
270
+
cabal-hie-install data
283
271
```
284
272
285
-
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.
273
+
In general, executing targets with `cabal` instead of `stack`have the same behaviour, except they do not install a GHC if it is missing but fail.
Copy file name to clipboardExpand all lines: docs/Build.md
+15-11Lines changed: 15 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,18 +27,17 @@ See the project's `README` for detailed information about installing `hie`.
27
27
The build script `install.hs` defines several targets using the `shake` build system. The targets are roughly:
28
28
29
29
*`hie-*`: builds and installs the `hie` binaries. Also renames the binaries to contain the correct version-number.
30
-
*`build-latest`: builds and installs `hie` for the latest available and supported `ghc` version.
31
-
*`build-data`: builds the hoogle-db required by `hie`
32
-
*`build`: builds and installs `hie` for the latest supported `ghc` version (like `build-latest`) and the hoogle-db (like `build-data`)
33
-
*`cabal-*`: execute the same task as the original target, but with `cabal` instead of `stack`
30
+
*`latest`: builds and installs `hie` for the latest available and supported `ghc` version.
31
+
*`data`: builds the hoogle-db required by `hie`
32
+
*`hie`: builds and installs `hie` for the latest supported `ghc` version (like `latest`) and the hoogle-db (like `data`)
34
33
35
-
Each `stack-*.yaml` contains references to packages in the submodules. Calling `stack` with one of those causes the build to fail if the submodules have not been initialized already. The file `shake.yaml` solves this issue invoking the `git` binary itself to update the submodules. Moreover, it specifies the correct version of `shake` and is used for installing all run-time dependencies such as `cabal` and `hoogle` if necessary.
34
+
Each `stack-*.yaml` contains references to packages in the submodules. Calling `stack` with one of those causes the build to fail if the submodules have not been initialized already. The file `shake.yaml` solves this issue invoking the `git` binary itself to update the submodules. Moreover, it specifies the correct version of `shake` and is used for installing all run-time dependencies such as `hoogle` if necessary.
36
35
37
36
### Run-time dependencies
38
37
39
38
`hie` depends on a correct environment in order to function properly:
40
39
41
-
*`cabal-install`: This dependency is required by `hie` to handle correctly projects that are not `stack` based. You can install an appropriate version using `stack` with the `stack-install-cabal` target.
40
+
*`cabal-install`: This dependency is required by `hie` to handle correctly projects that are not `stack` based. You can install it using one of the methods listed here: https://www.haskell.org/cabal/#install-upgrade
42
41
* The `hoogle` database: `hoogle generate` needs to be called with the most-recent `hoogle` version.
43
42
44
43
### Steps to build `hie`
@@ -68,12 +67,21 @@ EOF
68
67
69
68
Then `hie` can be compiled for a specific GHC version:
* For windows you will need cabal 3.0.0.0 and add the argument `--install-method=copy`
77
85
78
86
The final step is to configure the `hie` client to use a custom `hie-wrapper` script that enables the runtime options for profiling. Such a script could look like this:
79
87
@@ -88,17 +96,13 @@ The final step is to configure the `hie` client to use a custom `hie-wrapper` sc
88
96
89
97
The `install.hs` script performs some checks to ensure that a correct installation is possible and provide meaningful error messages for known issues.
90
98
91
-
*`stack` needs to be up-to-date. Version `1.9.3` is required
99
+
*`stack` needs to be up-to-date. Version `2.1.1` is required
92
100
*`cabal` needs to be up-to-date. Version `3.0.0.0` is required for windows systems and `2.4.1.0` for other ones.
93
101
*`ghc-8.6.3` is broken on windows. Trying to install `hie-8.6.3` on windows is not possible.
94
102
* When the build fails, an error message, that suggests to remove `.stack-work` directory, is displayed.
95
103
96
104
### Tradeoffs
97
105
98
-
#### `stack` is a build dependency
99
-
100
-
Currently, `stack` is needed even if you run the script with `cabal` to get the path where install the binaries but there are plans to remove that dependency (see #1380).
101
-
102
106
#### run `install.hs` with `stack` installs a GHC before running
103
107
104
108
Before the code in `install.hs` can be executed, `stack` installs a `GHC`, depending on the `resolver` field in `shake.yaml`. This is necessary if `install.hs` should be completely functional right after a fresh `git clone` without further configuration.
0 commit comments