@@ -1703,14 +1703,39 @@ system-dependent values for these fields.
1703
1703
1704
1704
Deprecated in favor of :pkg-field: `default-extensions `.
1705
1705
1706
+ .. pkg-field :: build-tool-depends: package:executable list
1707
+
1708
+ A list of Haskell programs needed to build this component. Each is specified
1709
+ by the package containing the executable and the name of the executable
1710
+ itself, separated by a colon. It is fine for the package to be the current
1711
+ one, in which case this is termed an *internal *, rather than *external *
1712
+ executable dependency.
1713
+
1714
+ External dependencies can (and should) contain a version bound like
1715
+ conventional :pkg-field: `build-depends ` dependenices. Internal deps should
1716
+ not contain a version bound, as they will be always resolved within the same
1717
+ configuration of the package in the build plan. Specifically, version bounds
1718
+ that include the package's version will be warned for being extraneous, and
1719
+ version bounds that exclude the package's version will raise and error for
1720
+ being impossible to follow.
1721
+
1722
+ Cabal can make sure that specified programs are built and on the ``PATH ``
1723
+ before building the component in question. It will always do so for internal
1724
+ dependencies, and also do so for external dependencies when using Nix-style
1725
+ local builds.
1726
+
1706
1727
.. pkg-field :: build-tools: program list
1728
+ :deprecated:
1707
1729
1708
- A list of programs, possibly annotated with versions, needed to
1709
- build this package, e.g. ``c2hs >= 0.15, cpphs ``. If no version
1710
- constraint is specified, any version is assumed to be acceptable.
1711
- :pkg-field: `build-tools ` can refer to locally defined executables, in which
1712
- case Cabal will make sure that executable is built first and add it
1713
- to the PATH upon invocations to the compiler.
1730
+ Deprecated in favor of :pkg-field: `build-tool-depends `.
1731
+
1732
+ Confusingly, programs in the list either refer to other executables in the
1733
+ same package, or one of a hard-coded set of build tools. In the case of the
1734
+ former, the entry can be sugared into a :pkg-field: `build-tool-depends `
1735
+ entry by prefixing with ``$pkg: ``. In the case of the latter, It is
1736
+ desugared by looking up the package and executable name in a hard-coded
1737
+ table. Refer to the documentation for :pkg-field: `build-tool-depends ` to
1738
+ understand the desugared fields meaning.
1714
1739
1715
1740
.. pkg-field :: buildable: boolean
1716
1741
0 commit comments