Skip to content

Commit fc9de61

Browse files
mergify[bot]mpilgrem
andauthoredJun 6, 2024··
Fix #8141 Don't refer to 'custom-setup' as 'optional' (#10073)
Also uses 'stanza' consistently in that context. (cherry picked from commit 2e8d728) Co-authored-by: Mike Pilgrem <mpilgrem@users.noreply.github.com>

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed
 

‎doc/cabal-package-description-file.rst

+8-5
Original file line numberDiff line numberDiff line change
@@ -2804,8 +2804,10 @@ Declaring a ``custom-setup`` stanza also enables the generation of
28042804
:synopsis: Custom Setup.hs build information.
28052805
:since: 1.24
28062806

2807-
The optional :pkg-section:`custom-setup` stanza contains information needed
2808-
for the compilation of custom ``Setup.hs`` scripts,
2807+
A :pkg-section:`custom-setup` stanza is required for
2808+
:pkg-field:`build-type` ``Custom`` and will be ignored (with a warning) for
2809+
other build types. The stanza contains information needed for the compilation
2810+
of custom ``Setup.hs`` scripts. For example:
28092811

28102812
::
28112813

@@ -2838,7 +2840,7 @@ Backward compatibility and ``custom-setup``
28382840

28392841
Versions prior to Cabal 1.24 don't recognise ``custom-setup`` stanzas,
28402842
and will behave agnostic to them (except for warning about an unknown
2841-
section). Consequently, versions prior to Cabal 1.24 can't ensure the
2843+
'section'). Consequently, versions prior to Cabal 1.24 can't ensure the
28422844
declared dependencies ``setup-depends`` are in scope, and instead
28432845
whatever is registered in the current package database environment
28442846
will become eligible (and resolved by the compiler) for the
@@ -2848,8 +2850,9 @@ The availability of the
28482850
``MIN_VERSION_package_(A,B,C)`` CPP macros
28492851
inside ``Setup.hs`` scripts depends on the condition that either
28502852

2851-
- a ``custom-setup`` section has been declared (or ``cabal build`` is being
2852-
used which injects an implicit hard-coded ``custom-setup`` stanza if it's missing), or
2853+
- a ``custom-setup`` stanza has been declared (or ``cabal build`` is being used
2854+
which injects an implicit hard-coded ``custom-setup`` stanza if it's missing),
2855+
or
28532856
- GHC 8.0 or later is used (which natively injects package version CPP macros)
28542857

28552858
Consequently, if you need to write backward compatible ``Setup.hs``

0 commit comments

Comments
 (0)
Please sign in to comment.