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

Commit b34dd3c

Browse files
committed
Document design decision of build script install.hs
1 parent 8e9258c commit b34dd3c

File tree

1 file changed

+26
-7
lines changed

1 file changed

+26
-7
lines changed

docs/Build.md

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,20 @@
22

33
`haskell-ide-engine` is built using the library `shake`. The build descriptions are defined in the file `install.hs`.
44

5-
### Design decisions
5+
Previously, `haskell-ide-engine` was built using a `Makefile` on Unix systems and a `PowerShell` script on Windows. By replacing both scripts by a Haskell-based solution, the build process is unified.
66

7-
The design of the build system follows 2 main goals:
7+
### Design goals
88

9-
* works same on every platform
10-
* has minimal run-time dependencies: `stack` and `git`
9+
The design of the build system has the following main goals:
10+
11+
* works identically on every platform
12+
* has minimal run-time dependencies:
13+
- a working installation of `stack`
14+
- `git`
1115
* is completely functional right after simple `git clone`
12-
* one-stop-shop for all building
16+
* one-stop-shop for building everything
1317

14-
Previously, `haskell-ide-engine` was built using a `Makefile` on Unix systems and a `PowerShell` script on Windows. By replacing both scripts by a Haskell-based solution, the scripts can be can be replaced by a single script.
18+
See the project's `README` for detailed information about installing `hie`.
1519

1620
### Tradeoffs
1721

@@ -26,6 +30,21 @@ It is necessary to update the `resolver` field of the `shake.yaml` if the .
2630

2731
#### `install.hs` installs a GHC
2832

29-
Before the code in `install.hs` can be executed, `stack` installs a `GHC`, depending on the `resolver` field in `shake.yaml`. This is a necessary if the `install.hs` should be totally functional right after a fresh `git clone` without further configuration.
33+
Before the code in `install.hs` can be executed, `stack` installs a `GHC`, depending on the `resolver` field in `shake.yaml`. This is a necessary if the `install.hs` should be completely functional right after a fresh `git clone` without further configuration.
3034

3135
This may lead to an extra `GHC` to be installed by `stack` if not all versions of `haskell-ide-engine` are installed.
36+
37+
#### `stack` is a build dependency
38+
39+
Currently, it is not possible to build all `hie-*` executables automatically without `stack`, since the `install.hs` script is executed by `stack`.
40+
41+
Other parts of the script also depend on `stack`:
42+
43+
* finding the local install-dir `stack path --local-bin`
44+
* finding and installing different `ghc` versions
45+
46+
#### `install.hs` executes `cabal install Cabal`
47+
48+
`ghc-mod` installs `cabal-helper` at runtime depending on the `ghc` used by the project, which can take a long time upon startup of `hie`. The `install.hs` script speeds up this process by calling `cabal install Cabal` upon build.
49+
50+
Hopefully, this behaviour can be removed in the future.

0 commit comments

Comments
 (0)