Skip to content

Commit 0863c2b

Browse files
authored
Merge pull request #9905 from haskell/fix8141
Fix #8141 Don't refer to 'custom-setup' as 'optional'
2 parents 774ff04 + cbc8456 commit 0863c2b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Diff for: doc/cabal-package-description-file.rst

+8-6
Original file line numberDiff line numberDiff line change
@@ -2869,9 +2869,10 @@ Declaring a ``custom-setup`` stanza also enables the generation of
28692869
:synopsis: Build information for ``Custom`` and ``Hooks`` build types
28702870
:since: 1.24
28712871

2872-
The :pkg-section:`custom-setup` stanza contains information needed
2873-
for the compilation of custom ``Setup.hs`` scripts as well as for
2874-
``SetupHooks.hs`` hooks modules.
2872+
A :pkg-section:`custom-setup` stanza is required for
2873+
:pkg-field:`build-type` ``Custom`` and will be ignored (with a warning) for
2874+
other build types. The stanza contains information needed for the compilation
2875+
of custom ``Setup.hs`` scripts or ``SetupHooks.hs`` hooks modules. For example:
28752876

28762877
::
28772878

@@ -2904,7 +2905,7 @@ Backward compatibility and ``custom-setup``
29042905

29052906
Versions prior to Cabal 1.24 don't recognise ``custom-setup`` stanzas,
29062907
and will behave agnostic to them (except for warning about an unknown
2907-
section). Consequently, versions prior to Cabal 1.24 can't ensure the
2908+
'section'). Consequently, versions prior to Cabal 1.24 can't ensure the
29082909
declared dependencies ``setup-depends`` are in scope, and instead
29092910
whatever is registered in the current package database environment
29102911
will become eligible (and resolved by the compiler) for the
@@ -2914,8 +2915,9 @@ The availability of the
29142915
``MIN_VERSION_package_(A,B,C)`` CPP macros
29152916
inside ``Setup.hs`` scripts depends on the condition that either
29162917

2917-
- a ``custom-setup`` section has been declared (or ``cabal build`` is being
2918-
used which injects an implicit hard-coded ``custom-setup`` stanza if it's missing), or
2918+
- a ``custom-setup`` stanza has been declared (or ``cabal build`` is being used
2919+
which injects an implicit hard-coded ``custom-setup`` stanza if it's missing),
2920+
or
29192921
- GHC 8.0 or later is used (which natively injects package version CPP macros)
29202922

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

0 commit comments

Comments
 (0)