Skip to content

Commit b7ed4f7

Browse files
authored
Merge pull request #10013 from cabalism/doc/hacking-with-latest-9901
Recommend using latest cabal-install
2 parents 0cd512a + de89ffe commit b7ed4f7

File tree

1 file changed

+30
-8
lines changed

1 file changed

+30
-8
lines changed

CONTRIBUTING.md

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,41 @@
33
Building Cabal for hacking
44
--------------------------
55

6-
If you use the latest version of cabal published on Hackage, it is sufficient to run:
6+
If you use the `cabal` executable from the latest version of the
7+
[cabal-install](https://hackage.haskell.org/package/cabal-install) package
8+
published on Hackage, it is sufficient to run:
79

810
```
9-
cabal build cabal
11+
$ cabal build cabal
1012
```
1113

12-
If not, you aren't able to build the testsuite, so you need to disable the default `cabal.project` that implies configuring the testsuite, e.g., with:
14+
If you have trouble building the testsuite for this initial build, try building
15+
with the release project that excludes this testsuite:
1316

1417
```
15-
cabal build --project-file=cabal.release.project cabal
18+
$ cabal build cabal --project-file=cabal.release.project
1619
```
1720

18-
> **Note**
21+
> [!NOTE]
22+
> The default `cabal.project` is picked up implicitly as if the
23+
> `--project-file=cabal.project` explicit option had been given.
24+
25+
For developing, we recommend using the locally built version of `cabal`, the
26+
executable, if only because one of the released versions available may be
27+
lacking a fix. This can be installed:
28+
29+
```
30+
$ cabal install cabal-install:exe:cabal --overwrite-policy=always
31+
```
32+
33+
It can be run without first installing it with `cabal run cabal --` followed by
34+
its own arguments, as shown here for `build --help`:
35+
36+
```
37+
$ cabal run cabal -- build --help
38+
```
39+
40+
> [!NOTE]
1941
> If you're using Nix, you might find it convenient to work within a shell that has all the `Cabal` development dependencies:
2042
> ```
2143
> $ nix-shell -p cabal-install ghc ghcid haskellPackages.fourmolu_0_12_0_0 pkgconfig zlib.dev
@@ -30,9 +52,9 @@ to find the binary (or just run `find -type f -executable -name cabal`).
3052
Here are some other useful variations on the commands:
3153
3254
```
33-
cabal build Cabal # build library only
34-
cabal build Cabal-tests:unit-tests # build Cabal's unit test suite
35-
cabal build cabal-tests # etc...
55+
$ cabal build Cabal # build library only
56+
$ cabal build Cabal-tests:unit-tests # build Cabal's unit test suite
57+
$ cabal build cabal-tests # etc...
3658
```
3759
3860
Running tests

0 commit comments

Comments
 (0)