Skip to content

Commit

Permalink
Merge pull request #9264 from cabalism/doc/flags-in-constraints
Browse files Browse the repository at this point in the history
Add back reference from constraints to flags
  • Loading branch information
mergify[bot] authored Oct 20, 2023
2 parents 6b2f332 + bff077e commit a260cde
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions doc/cabal-project.rst
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,17 @@ The following settings control the behavior of the dependency solver:

::

constraints: bar == 2.1,
bar +foo -baz
constraints:
bar == 2.1
, bar +foo -baz

This is equivalent to writing constraints and :cfg-field:`flags` separately:

::

constraints: bar == 2.1
package bar
flags: +foo -baz

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

See also the solver configuration field :cfg-field:`constraints`.

The command line variant of this flag is ``--flags``. There is also
a shortened form ``-ffoo -f-bar``.

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

.. cfg-field:: with-compiler: PATH
-w PATH or -wPATH, --with-compiler=PATH
Expand Down

0 comments on commit a260cde

Please sign in to comment.