3
3
Building Cabal for hacking
4
4
--------------------------
5
5
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:
7
9
8
10
```
9
- cabal build cabal
11
+ $ cabal build cabal
10
12
```
11
13
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:
13
16
14
17
```
15
- cabal build --project-file=cabal.release.project cabal
18
+ $ cabal build cabal --project-file=cabal.release.project
16
19
```
17
20
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]
19
41
> If you're using Nix, you might find it convenient to work within a shell that has all the ` Cabal ` development dependencies:
20
42
> ```
21
43
> $ 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`).
30
52
Here are some other useful variations on the commands:
31
53
32
54
```
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...
36
58
```
37
59
38
60
Running tests
0 commit comments