Skip to content

Commit a260cde

Browse files
authored
Merge pull request #9264 from cabalism/doc/flags-in-constraints
Add back reference from constraints to flags
2 parents 6b2f332 + bff077e commit a260cde

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

doc/cabal-project.rst

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -448,8 +448,17 @@ The following settings control the behavior of the dependency solver:
448448

449449
::
450450

451-
constraints: bar == 2.1,
452-
bar +foo -baz
451+
constraints:
452+
bar == 2.1
453+
, bar +foo -baz
454+
455+
This is equivalent to writing constraints and :cfg-field:`flags` separately:
456+
457+
::
458+
459+
constraints: bar == 2.1
460+
package bar
461+
flags: +foo -baz
453462

454463
Valid constraints take the same form as for the
455464
:option:`runhaskell Setup.hs configure --constraint`
@@ -754,16 +763,15 @@ feature was added.
754763
local packages support the same named flags. If a flag is not
755764
supported by a package, it is ignored.
756765

757-
See also the solver configuration field :cfg-field:`constraints`.
758-
759766
The command line variant of this flag is ``--flags``. There is also
760767
a shortened form ``-ffoo -f-bar``.
761768

762769
A common mistake is to say ``cabal build -fhans``, where
763770
``hans`` is a flag for a transitive dependency that is not in the
764771
local package; in this case, the flag will be silently ignored. If
765772
``haskell-tor`` is the package you want this flag to apply to, try
766-
``--constraint="haskell-tor +hans"`` instead.
773+
``--constraint="haskell-tor +hans"`` instead. Flags can be specified as
774+
package :cfg-field:`constraints`.
767775

768776
.. cfg-field:: with-compiler: PATH
769777
-w PATH or -wPATH, --with-compiler=PATH

0 commit comments

Comments
 (0)