3 We have these projects, all in the root:
6 $ tree -P '*.project' --prune -L 1
8 ├── cabal.bootstrap.project
11 ├── cabal.release.project
12 ├── cabal.validate-libonly.project
13 └── cabal.validate.project
16 Projects are expected to pass a `build --dry-run` standalone test,
17 substituting the actual project filename for `cabal.project` in
18 `--project-file=cabal.project`:
21 $ cabal build all --enable-tests --enable-benchmarks --dry-run \
22 --project-file=cabal.project
25 The `release` project might fail to resolve dependencies with the latest GHC
26 compiler with its `index-state` pinned but it should build if unpinned, by
27 removing `index-state` from the project or setting it to `HEAD`:
30 $ cabal build all --enable-tests --enable-benchmarks \
31 --project-file=cabal.project.release \
32 --index-state="hackage.haskell.org HEAD"
37 Any project configuration that is not itself a project should use a `.config`
38 extension and be put into the `project-cabal` folder:
41 $ tree -P '*.config' project-cabal
43 ├── constraints.config
45 ├── ghc-options.config
47 │ ├── benchmarks.config
48 │ ├── buildinfo.config
51 │ ├── integration-tests.config
55 2 directories, 10 files
60 We have one `project-cabal/pkgs.config` that includes all package groups.
63 $ cat project-cabal/pkgs.config
64 import: pkgs/cabal.config
65 import: pkgs/install.config
66 import: pkgs/buildinfo.config
67 import: pkgs/tests.config
68 import: pkgs/integration-tests.config
69 import: pkgs/benchmarks.config
72 The default and `validate` projects get their packages this way. The `libonly`,
73 and `validate.libonly` projects import packages from `cabal` and `tests` package
74 groups. The `release` project also does this but also imports the `install`
77 | Project | pkgs | cabal | tests | install |
78 |------------------|:---: |:---: |:---: |:---: |
80 | libonly | | ✓ | ✓ | |
81 | release | | ✓ | ✓ | ✓ |
82 | validate | ✓ | | | |
83 | validate.libonly | | ✓ | ✓ | |
85 The `meta` project is a one-liner:
88 $ cat cabal.meta.project
89 packages: cabal-dev-scripts
94 Additional configuration is imported:
96 | Project | ghc-options | ghc-latest | constraints |
97 |------------------|:---: |:---: |:---: |
98 | default | ✓ | ✓ | ✓ |
101 | validate | ✓ | ✓ | ✓ |
102 | validate.libonly | ✓ | | ✓ |