This repository has been archived by the owner on Oct 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 208
Document design decision of build script install.hs
#1073
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
## Build system | ||
|
||
`haskell-ide-engine` is built using the library `shake`. The build descriptions are defined in the file `install.hs`. | ||
|
||
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. | ||
|
||
### Design goals | ||
|
||
The design of the build system has the following main goals: | ||
|
||
* works identically on every platform | ||
* has minimal run-time dependencies: | ||
- a working installation of `stack` | ||
- `git` | ||
* is completely functional right after simple `git clone` | ||
* one-stop-shop for building all executables required for using `hie` in IDEs. | ||
|
||
See the project's `README` for detailed information about installing `hie`. | ||
|
||
### Tradeoffs | ||
|
||
#### `shake.yaml` | ||
|
||
A `shake.yaml` is required for executing the `install.hs` file. | ||
|
||
* It contains the required version of `shake`. | ||
* In contrast to the other `*.yaml` it does not contain the submodules, which is necessary for `stack` to work even before the submodules have been initialized. | ||
|
||
It is necessary to update the `resolver` field of the `shake.yaml` if the script should run with a different `GHC`. | ||
|
||
#### `install.hs` installs a GHC | ||
|
||
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. | ||
|
||
This may lead to an extra `GHC` to be installed by `stack` if not all versions of `haskell-ide-engine` are installed. | ||
|
||
#### `stack` is a build dependency | ||
|
||
Currently, it is not possible to build all `hie-*` executables automatically without `stack`, since the `install.hs` script is executed by `stack`. | ||
|
||
Other parts of the script also depend on `stack`: | ||
|
||
* finding the local install-dir `stack path --local-bin` | ||
* finding and installing different `ghc` versions | ||
|
||
#### `install.hs` executes `cabal install Cabal` | ||
|
||
`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. | ||
|
||
Hopefully, this behaviour can be removed in the future. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/contains/specifies?