Skip to content

Commit

Permalink
Warn about project conditional blocks
Browse files Browse the repository at this point in the history
Fixes #8945
  • Loading branch information
philderbeast committed Dec 12, 2023
1 parent f31f2cd commit ebd83ca
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
2 changes: 2 additions & 0 deletions doc/cabal-package-description-file.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2426,6 +2426,8 @@ Configuration Flags
negated value. However, if the flag is manual, then the default
value (which can be overridden by commandline flags) will be used.

.. _conditional-blocks:

Conditional Blocks
^^^^^^^^^^^^^^^^^^

Expand Down
23 changes: 16 additions & 7 deletions doc/cabal-project-description-file.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,22 @@ directories when there is none in the current directory.
Conditionals and imports
------------------------

As of ``cabal-install`` version 3.8, cabal supports conditional logic
and imports in ``cabal.project`` files. :ref:`conditions` in cabal
may case on operating system, architecture, and
compiler (i.e. there is no support for a notion of custom flags in
project files). Imports may specify local filepaths or remote urls,
and may reference either cabal.project files or v1-style cabal.config
freeze files. As a usage example:
As of ``cabal-install`` version 3.8, cabal supports conditional logic and
imports in ``cabal.project`` files.

.. warning::

While :ref:`conditional blocks<conditional-blocks>` can appear anywhere
within library, executable or common stanzas of a package, their placement
within a project is restricted. Conditions may only be introduced at the
top level of a project.

Fewer :ref:`conditions<conditions>` are available for use in projects
where they may case only on operating system, architecture, and compiler
(i.e. there is no support for a notion of custom flags in project files).

Imports may specify local filepaths or remote urls, and may reference either
cabal.project files or v1-style cabal.config freeze files. As a usage example:

::

Expand Down

0 comments on commit ebd83ca

Please sign in to comment.