Skip to content

Commit a0aa627

Browse files
committed
Fix #6825 Add documentation on Cabal flags and manual: false
1 parent f2a9f7d commit a0aa627

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

doc/tutorial/cabal_flags_and_ghc_options.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,35 @@ flags and with GHC options.
77

88
## Cabal flags
99

10+
A package description may specify one or more Cabal flags:
11+
12+
=== "Cabal file"
13+
14+
~~~text
15+
flag my-flag-name
16+
description: My (optional) description of my flag.
17+
default: false -- Optional: the default value is true
18+
manual: true -- Optional: the default value is false
19+
~~~
20+
21+
=== "`package.yaml` (Hpack)"
22+
23+
~~~yaml
24+
flags:
25+
my-flag-name:
26+
description: My (optional) description of my flag.
27+
default: true # Required
28+
manual: false # Required
29+
~~~
30+
31+
??? question "How does `manual: false` affect Stack's builds?"
32+
33+
`manual: false` has different implications for Cabal and Stack. Cabal tries
34+
to 'solve' dependencies using the flag’s default value and, if it can't,
35+
tries again with the negated default value. Stack emphasises reproducible
36+
builds. It only tries to build with the flag's default value and, if it
37+
can't, reports that it can't.
38+
1039
Cabal flags can be set or unset at the command line or as a project-specific
1140
Stack option.
1241

0 commit comments

Comments
 (0)