Skip to content

Commit

Permalink
Move target forms to its own section, add a warning about install all,
Browse files Browse the repository at this point in the history
  • Loading branch information
philderbeast committed Aug 9, 2021
1 parent a8d47c3 commit fbdcad0
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions doc/cabal-commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,10 @@ Some examples:
$ cabal v2-update # update all remote repos
$ cabal v2-update head.hackage # update only head.hackage

cabal v2-build
---------------

``cabal v2-build`` takes a set of targets and builds them. It
automatically handles building and installing any dependencies of these
targets.
Target Forms
------------

A target can take any of the following forms:
A cabal command target can take any of the following forms:

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

cabal v2-build
---------------

``cabal v2-build`` takes a set of targets and builds them. It
automatically handles building and installing any dependencies of these
targets.

In component targets, ``package:`` and ``ctype:`` (valid component types
are ``lib``, ``flib``, ``exe``, ``test`` and ``bench``) can be used to
disambiguate when multiple packages define the same component, or the
Expand Down Expand Up @@ -287,9 +290,14 @@ invocations and bringing the project's executables into scope.
cabal v2-install
-----------------

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

.. warning::

If not every package has an executable to install, use ``all:exes`` rather
than ``all`` as the target.

For example this command will build the latest ``cabal-install`` and symlink
its ``cabal`` executable:

Expand Down

0 comments on commit fbdcad0

Please sign in to comment.