Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add back reference from constraints to flags #9264

Merged
merged 1 commit into from
Oct 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading