Skip to content

Commit fbdcad0

Browse files
committed
Move target forms to its own section, add a warning about install all, #6769.
1 parent a8d47c3 commit fbdcad0

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

doc/cabal-commands.rst

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,10 @@ Some examples:
6565
$ cabal v2-update # update all remote repos
6666
$ cabal v2-update head.hackage # update only head.hackage
6767

68-
cabal v2-build
69-
---------------
70-
71-
``cabal v2-build`` takes a set of targets and builds them. It
72-
automatically handles building and installing any dependencies of these
73-
targets.
68+
Target Forms
69+
------------
7470

75-
A target can take any of the following forms:
71+
A cabal command target can take any of the following forms:
7672

7773
- A package target: ``package``, which specifies that all enabled
7874
components of a package to be built. By default, test suites and
@@ -101,6 +97,13 @@ A target can take any of the following forms:
10197
- A filepath target: ``[package:][ctype:]filepath``, which specifies that the
10298
component of which the given filepath is a part of will be built.
10399

100+
cabal v2-build
101+
---------------
102+
103+
``cabal v2-build`` takes a set of targets and builds them. It
104+
automatically handles building and installing any dependencies of these
105+
targets.
106+
104107
In component targets, ``package:`` and ``ctype:`` (valid component types
105108
are ``lib``, ``flib``, ``exe``, ``test`` and ``bench``) can be used to
106109
disambiguate when multiple packages define the same component, or the
@@ -287,9 +290,14 @@ invocations and bringing the project's executables into scope.
287290
cabal v2-install
288291
-----------------
289292

290-
``cabal v2-install [FLAGS] PACKAGES`` builds the specified packages and
293+
``cabal v2-install [FLAGS] [TARGETS]`` builds the specified target packages and
291294
symlinks/copies their executables in ``installdir`` (usually ``~/.cabal/bin``).
292295

296+
.. warning::
297+
298+
If not every package has an executable to install, use ``all:exes`` rather
299+
than ``all`` as the target.
300+
293301
For example this command will build the latest ``cabal-install`` and symlink
294302
its ``cabal`` executable:
295303

0 commit comments

Comments
 (0)