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

Commit 4afdce5

Browse files
authored
Merge pull request #1225 from skress/master
Add documentation about building hie with profiling enabled.
2 parents 01807e6 + 70ab82c commit 4afdce5

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

docs/Build.md

+31
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,37 @@ Installing `hie` is a multi-step process:
5454

5555
This ensures that a complete install is always possible after each `git pull` or a `git clone`.
5656

57+
#### Building `hie` with profiling support
58+
59+
To build `hie` with profiling enabled `cabal new-install` needs to be used instead of `stack`.
60+
61+
Configure `cabal` to enable profiling by setting `profiling: True` in `cabal.project.local` for all packages. If that file does not already exist, create it as follows:
62+
63+
```bash
64+
cat << EOF > cabal.project.local
65+
package *
66+
profiling: True
67+
EOF
68+
```
69+
70+
Then `hie` can be compiled for a specific GHC version:
71+
72+
```bash
73+
export GHCP=<path-to-ghc-binary>
74+
cabal new-install exe:hie -w $GHCP \
75+
--write-ghc-environment-files=never --symlink-bindir=$HOME/.local/bin \
76+
--overwrite-policy=always --reinstall
77+
```
78+
79+
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:
80+
81+
```bash
82+
#!/bin/sh
83+
~/.local/bin/hie-wrapper "$@" +RTS -xc
84+
```
85+
86+
(Note: If no profiling information is shown when using `hie` with a certain project, it may help to build that project itself with profiling support, e.g. `stack build --profile`.)
87+
5788
### Safety checks
5889

5990
The `install.hs` script performs some checks to ensure that a correct installation is possible and provide meaningful error messages for known issues.

0 commit comments

Comments
 (0)