4 ``cabal help`` groups commands into :ref:`global<command-group-global>`,
5 :ref:`database<command-group-database>`, :ref:`init<command-group-init>`,
6 :ref:`configure<command-group-config>`, :ref:`build<command-group-build>`,
7 :ref:`run<command-group-run>` and :ref:`ship<command-group-ship>` sections.
12 Command line interface to the Haskell Cabal infrastructure.
14 See http://www.haskell.org/cabal/ for more information.
16 Usage: cabal [GLOBAL FLAGS] [COMMAND [FLAGS]]
20 user-config Display and update the user's global cabal configuration.
21 help Help about commands.
22 path Display paths used by cabal.
25 update Updates list of known packages.
26 list List packages matching a search string.
27 info Display detailed information about a particular package.
29 [initialization and download]
30 init Create a new cabal package.
31 fetch Downloads packages for later installation.
32 get Download/Extract a package's source code (repository).
34 [project configuration]
35 configure Add extra project configuration.
36 freeze Freeze dependencies.
37 gen-bounds Generate dependency bounds.
38 outdated Check for outdated dependencies.
40 [project building and installing]
41 build Compile targets within the project.
42 install Install packages.
43 haddock Build Haddock documentation.
44 haddock-project Generate Haddocks HTML documentation for the cabal project.
45 clean Clean the package store and remove temporary files.
48 list-bin List the path to a single executable.
49 repl Open an interactive session for the given component.
50 run Run an executable.
53 exec Give a command access to the store.
55 [sanity checks and shipping]
56 check Check the package for common mistakes.
57 sdist Generate a source distribution file (.tar.gz).
58 upload Uploads source packages or documentation to Hackage.
59 report Upload build reports to a remote server.
62 unpack Deprecated alias for 'get'.
63 hscolour Generate HsColour colourised code, in HTML format.
65 [new-style projects (forwards-compatible aliases)]
66 Since cabal-install-3.0.0.0, all 'v2-' prefixed names of commands are just
67 aliases for the simple unprefixed names. So v2-build is an alias for
68 build, v2-install for install and so on.
70 [legacy command aliases]
71 No legacy commands are described.
73 Common Arguments and Flags
74 --------------------------
76 Arguments and flags common to some or all commands are:
79 .. option:: --default-user-config=file
81 Allows a "default" ``cabal.config`` freeze file to be passed in
82 manually. This file will only be used if one does not exist in the
83 project directory already. Typically, this can be set from the
84 global cabal ``config`` file so as to provide a default set of
85 partial constraints to be used by projects, providing a way for
86 users to peg themselves to stable package collections.
89 .. option:: --allow-newer[=DEPS], --allow-older[=DEPS]
91 Selectively relax upper or lower bounds in dependencies without
92 editing the package description respectively.
94 The following description focuses on upper bounds and the
95 :option:`--allow-newer` flag, but applies analogously to
96 :option:`--allow-older` and lower bounds. :option:`--allow-newer`
97 and :option:`--allow-older` can be used at the same time.
99 If you want to install a package A that depends on B >= 1.0 && <
100 2.0, but you have the version 2.0 of B installed, you can compile A
101 against B 2.0 by using ``cabal install --allow-newer=B A``. This
102 works for the whole package index: if A also depends on C that in
103 turn depends on B < 2.0, C's dependency on B will be also relaxed.
111 Resolving dependencies...
112 cabal: Could not resolve dependencies:
114 $ cabal configure --allow-newer
115 Resolving dependencies...
122 # Relax upper bounds in all dependencies.
123 $ cabal install --allow-newer foo
125 # Relax upper bounds only in dependencies on bar, baz and quux.
126 $ cabal install --allow-newer=bar,baz,quux foo
128 # Relax the upper bound on bar and force bar==2.1.
129 $ cabal install --allow-newer=bar --constraint="bar==2.1" foo
131 It's also possible to limit the scope of :option:`--allow-newer` to single
132 packages with the ``--allow-newer=scope:dep`` syntax. This means
133 that the dependency on ``dep`` will be relaxed only for the package
140 # Relax upper bound in foo's dependency on base; also relax upper bound in
141 # every package's dependency on lens.
142 $ cabal install --allow-newer=foo:base,lens
144 # Relax upper bounds in foo's dependency on base and bar's dependency
145 # on time; also relax the upper bound in the dependency on lens specified by
147 $ cabal install --allow-newer=foo:base,lens --allow-newer=bar:time
149 Finally, one can enable :option:`--allow-newer` permanently by setting
150 ``allow-newer: True`` in the :ref:`config file <config-file-discovery>`. Enabling
151 'allow-newer' selectively is also supported in the config file
152 (``allow-newer: foo, bar, baz:base``).
154 .. option:: --preference=CONSTRAINT
156 Specify a soft constraint on versions of a package. The solver will
157 attempt to satisfy these preferences on a "best-effort" basis.
159 .. option:: --enable-build-info
161 Generate accurate build information for build components.
163 Information contains meta information, such as component type, compiler type, and
164 Cabal library version used during the build, but also fine grained information,
165 such as dependencies, what modules are part of the component, etc...
167 On build, a file ``build-info.json`` (in the ``json`` format) will be written to
168 the root of the build directory.
171 The format and fields of the generated build information is currently
172 experimental. In the future we might add or remove fields, depending
173 on the needs of other tooling.
178 "cabal-lib-version": "<cabal lib version>",
180 "flavour": "<compiler name>",
181 "compiler-id": "<compiler id>",
182 "path": "<absolute path of the compiler>"
186 "type": "<component type, e.g. lib | bench | exe | flib | test>",
187 "name": "<component name>",
188 "unit-id": "<unitid>",
190 "<compiler args necessary for compilation>"
193 "<modules in this component>"
196 "<source files relative to hs-src-dirs>"
199 "<source directories of this component>"
201 "src-dir": "<root directory of this component>",
202 "cabal-file": "<cabal file location>"
207 .. jsonschema:: ./json-schemas/build-info.schema.json
209 .. option:: --disable-build-info
211 (default) Do not generate detailed build information for built components.
213 Already generated `build-info.json` files will be removed since they would be stale otherwise.
218 A cabal command target can take any of the following forms:
220 - A package target: ``[pkg:]package``, which specifies that all enabled
221 components of a package to be built. By default, test suites and
222 benchmarks are *not* enabled, unless they are explicitly requested
223 (e.g., via ``--enable-tests``.)
225 - A component target: ``[package:][ctype:]component``, which specifies
226 a specific component (e.g., a library, executable, test suite or
227 benchmark) to be built.
229 - All packages: ``all``, which specifies all packages within the project.
231 - Components of a particular type: ``package:ctypes``, ``all:ctypes``:
232 which specifies all components of the given type. Where valid
235 - ``libs``, ``libraries``,
236 - ``flibs``, ``foreign-libraries``,
237 - ``exes``, ``executables``,
239 - ``benches``, ``benchmarks``.
241 - A module target: ``[package:][ctype:]module``, which specifies that the
242 component of which the given module is a part of will be built.
244 - A filepath target: ``[package:][ctype:]filepath``, which specifies that the
245 component of which the given filepath is a part of will be built.
247 - A script target: ``path/to/script``, which specifies the path to a script
248 file. This is supported by ``build``, ``repl``, ``run``, and ``clean``.
249 Script targets are not part of a package.
251 .. _command-group-global:
259 ``cabal user-config [init|diff|update]`` prints and updates user's global
260 cabal preferences. It is very useful when you are e.g. first configuring
261 ``cabal`` on a new machine.
263 - ``cabal user-config init`` creates a new configuration file.
265 .. option:: --config-file=PATH
267 Specify config file path. (default: ``~/.cabal/config``).
269 .. option:: -f, --force
271 Force configuration file overwriting if already exists.
273 - ``cabal user-config diff`` prints a diff of the user's config file and the
276 - ``cabal user-config update`` updates the user's config file with additional
279 .. option:: -a CONFIGLINE or -aCONFIGLINE, --augment=CONFIGLINE
281 Pass additional configuration lines to be incorporated in the
283 ``cabal user-config update --augment="offline: True"``.
285 Note how ``--augment`` syntax follows ``cabal user-config diff``
291 ``cabal path`` allows to query for paths used by ``cabal``.
292 For example, it allows to query for the directories of the cache, store,
293 installed binaries, and so on.
301 compiler-flavour: ghc
302 compiler-id: ghc-9.8.2
303 compiler-path: /home/alice/.ghcup/bin/ghc
304 cache-home: /home/alice/.cabal
305 remote-repo-cache: /home/alice/.cabal/packages
306 logs-dir: /home/alice/.cabal/logs
307 store-dir: /home/alice/.cabal/store
308 config-file: /home/alice/.cabal/config
309 installdir: /home/alice/.cabal/bin
311 Or using the json output:
315 $ cabal path --output-format=json | jq
320 "cabal-version": "3.13.0.0",
324 "path": "/home/alice/.ghcup/bin/ghc"
326 "cache-home": "/home/alice/.cabal",
327 "remote-repo-cache": "/home/alice/.cabal/packages",
328 "logs-dir": "/home/alice/.cabal/logs",
329 "store-dir": "/home/alice/.cabal/store",
330 "config-file": "/home/alice/.cabal/config",
331 "installdir": "/home/alice/.cabal/bin"
334 If ``cabal path`` is passed a single option naming a path, then that
335 path will be printed *without* any label:
339 $ cabal path --installdir
340 /home/alice/.cabal/bin
342 While this interface is intended to be used for scripting, it is an experimental command.
346 $ ls $(cabal path --installdir)
349 .. _command-group-database:
351 Package database commands
352 -------------------------
357 ``cabal update`` updates the state of the package index. If the
358 project contains multiple remote package repositories it will update
359 the index of all of them (e.g. when using overlays).
365 $ cabal update # update all remote repos
366 $ cabal update head.hackage # update only head.hackage
371 ``cabal list [FLAGS] STRINGS`` lists all packages matching a search string.
373 .. option:: --installed
375 Only output installed packages.
377 .. option:: --simple-output
379 Print matching packages in a one-package-one-line format.
381 .. option:: -i, --ignore-case
383 .. option:: -I, --strict-case
385 .. option:: --package-db=DB
387 Append the given package database to the list of used package
388 databases. See `cabal info`_ for a thorough explanation.
390 .. option:: -w PATH or -wPATH, --with-compiler=PATH
392 Path to specific compiler.
397 ``cabal info [FLAGS] PACKAGES`` displays useful informations about remote
400 .. option:: --package-db=DB
402 Append the given package database to the list of package databases
403 used (to satisfy dependencies and register into). May be a specific
404 file, ``global`` or ``user``. The initial list is ``['global'], ['global',
405 'user']``, depending on context. Use ``clear`` to reset the list to empty.
407 .. _command-group-init:
409 Initialization and download
410 ---------------------------
415 ``cabal init [FLAGS]`` initialises a Cabal package, picking
416 reasonable defaults. Run it in your project folder.
418 .. option:: -i, --interactive
420 Enable interactive mode.
422 .. option:: -m, --minimal
424 Generate a short .cabal file, without extra empty fields or
425 explanatory comments.
427 See :ref:`init quickstart` for an overview on the command, and
428 ``cabal init --help`` for the complete list of options.
433 *☞ N.B.:* ``cabal fetch`` only works for legacy ``v1-`` commands and only
434 for single package projects. If you are not maintaining an old project,
435 `cabal build`_ with ``--only-download`` has similar effects to ``fetch``
436 and benefits from compatibility with newer build methods.
438 ``cabal fetch [FLAGS] PACKAGES`` downloads packages for later installation.
439 It fetches the project plus its dependencies, very useful when
440 e.g. you plan to work on a project with unreliable or no internet access.
442 .. option:: --no-dependencies
446 .. option:: --disable-tests
448 Disable dependency checking and compilation
449 for test suites listed in the package
452 .. option:: --disable-benchmarks
454 Disable dependency checking and compilation
455 for benchmarks listed in the package
458 Check ``cabal fetch --help`` for a complete list of options.
465 ``cabal get [FLAGS] [PACKAGES]`` (synonym: ``cabal unpack``) downloads and unpacks
466 the source code of ``PACKAGES`` locally. By default the content of the
467 packages is unpacked in the current working directory, in named subfolders
468 (e.g. ``./filepath-1.2.0.8/``), use ``--destdir=PATH`` to specify another
469 folder. By default the latest version of the package is downloaded, you can
470 ask for a spefic one by adding version numbers
471 (``cabal get random-1.0.0.1``).
473 The ``cabal get`` command supports the following options:
475 .. option:: -s[[head|this|...]], --source-repository[=[head|this|...]]
477 Clone the package's source repository (Darcs, Git, etc.)
478 instead of downloading the tarball. Only works if the
479 package specifies a ``source-repository``.
481 .. option:: --index-state=STATE
483 Pin your request to a specific Hackage index state. Available
484 ``STATE`` formats: Unix timestamps (e.g. ``@1474732068``),
485 ISO8601 UTC timestamps (e.g. ``2016-09-24T17:47:48Z``), or ``HEAD``
487 This determines which package versions are available as well as which
488 ``.cabal`` file revision is selected (unless ``--pristine`` is used).
490 .. option:: --pristine
492 Unpacks the pristine tarball, i.e. disregarding any Hackage revision.
494 .. option:: -d, --destdir=PATH
496 Where to place the package source, defaults to (a subdirectory of)
497 the current directory.
499 .. option:: --only-package-description, --package-description-only
501 Unpack the original pristine tarball, rather than updating the
502 ``.cabal`` file with the latest revision from the package archive.
505 .. _command-group-config:
507 Project configuration
508 ---------------------
513 ``cabal configure`` takes a set of arguments and writes a
514 ``cabal.project.local`` file based on the flags passed to this command.
515 ``cabal configure FLAGS; cabal build`` is roughly equivalent to
516 ``cabal build FLAGS``, except that with ``configure`` the flags
517 are persisted to all subsequent calls to ``build``.
519 ``cabal configure`` is intended to be a convenient way to write out
520 a ``cabal.project.local`` for simple configurations; e.g.,
521 ``cabal configure -w ghc-7.8`` would ensure that all subsequent
522 builds with ``cabal build`` are performed with the compiler
523 ``ghc-7.8``. For more complex configuration, we recommend writing the
524 ``cabal.project.local`` file directly (or placing it in
527 ``cabal configure`` inherits options from ``Cabal``. semantics:
529 - Any flag accepted by ``./Setup configure``.
531 - Any flag accepted by ``cabal configure`` beyond
532 ``./Setup configure``, namely ``--cabal-lib-version``,
533 ``--constraint``, ``--preference`` and ``--solver.``
535 - Any flag accepted by ``cabal install`` beyond ``./Setup configure``.
537 - Any flag accepted by ``./Setup haddock``.
539 The options of all of these flags apply only to *local* packages in a
540 project; this behavior is different than that of ``cabal install``,
541 which applies flags to every package that would be built. The motivation
542 for this is to avoid an innocuous addition to the flags of a package
543 resulting in a rebuild of every package in the store (which might need
544 to happen if a flag actually applied to every transitive dependency). To
545 apply options to an external package, use a ``package`` stanza in a
546 ``cabal.project`` file.
548 There are two ways of modifying the ``cabal.project.local`` file through
549 ``cabal configure``, either by appending new configurations to it, or
550 by simply overwriting it all. Overwriting is the default behaviour, as
551 such, there's a flag ``--enable-append`` to append the new configurations
552 instead. Since overwriting is rather destructive in nature, a backup system
553 is in place, which moves the old configuration to a ``cabal.project.local~``
554 file, this feature can also be disabled by using the ``--disable-backup``
560 If a package is built in several different environments, such as a
561 development environment, a staging environment and a production
562 environment, it may be necessary or desirable to ensure that the same
563 dependency versions are selected in each environment. This can be done
564 with the ``freeze`` command:
566 ``cabal freeze`` writes out a **freeze file** which records all of
567 the versions and flags that are picked by the solver under the
568 current index and flags. Default name of this file is
569 ``cabal.project.freeze`` but in combination with a
570 ``--project-file=my.project`` flag (see :ref:`project-file
571 <cmdoption-project-file>`)
572 the name will be ``my.project.freeze``.
573 A freeze file has the same syntax as ``cabal.project`` and looks
580 constraints: HTTP ==4000.3.3,
581 HTTP +warp-tests -warn-as-error -network23 +network-uri -mtl1 -conduit10,
583 QuickCheck +templatehaskell,
587 For end-user executables, it is recommended that you distribute the
588 ``cabal.project.freeze`` file in your source repository so that all
589 users see a consistent set of dependencies. For libraries, this is not
590 recommended: users often need to build against different versions of
591 libraries than what you developed against.
596 ``cabal gen-bounds [FLAGS]`` generates bounds for all dependencies that do not
597 currently have them. Generated bounds are printed to stdout. You can then
598 paste them into your .cabal file.
599 The generated bounds conform to the `Package Versioning Policy`_, which is
600 a recommended versioning system for publicly released Cabal packages.
602 .. code-block:: console
606 For example, given the following dependencies without bounds specified in
607 :pkg-field:`build-depends`:
616 ``gen-bounds`` might suggest changing them to the following:
621 base >= 4.15.0 && < 4.16,
622 mtl >= 2.2.2 && < 2.3,
623 transformers >= 0.5.6 && < 0.6,
629 ``cabal outdated [FLAGS]`` checks for outdated dependencies in the package
630 description file or freeze file.
632 Manually updating dependency version bounds in a ``.cabal`` file or a
633 freeze file can be tedious, especially when there's a lot of
634 dependencies. The ``cabal outdated`` command is designed to help with
635 that. It will print a list of packages for which there is a new
636 version on Hackage that is outside the version bound specified in the
637 ``build-depends`` field. The ``outdated`` command can also be
638 configured to act on the freeze file and
639 ignore major (or all) version bumps on Hackage for a subset of
644 .. code-block:: console
648 Outdated dependencies:
649 haskell-src-exts <1.17 (latest: 1.19.1)
650 language-javascript <0.6 (latest: 0.6.0.9)
651 unix ==2.7.2.0 (latest: 2.7.2.1)
653 $ cabal outdated --simple-output
658 $ cabal outdated --ignore=haskell-src-exts
659 Outdated dependencies:
660 language-javascript <0.6 (latest: 0.6.0.9)
661 unix ==2.7.2.0 (latest: 2.7.2.1)
663 $ cabal outdated --ignore=haskell-src-exts,language-javascript,unix
664 All dependencies are up to date.
666 $ cabal outdated --ignore=haskell-src-exts,language-javascript,unix -q
670 $ cd /some/other/package
671 $ cabal outdated --freeze-file
672 Outdated dependencies:
673 HTTP ==4000.3.3 (latest: 4000.3.4)
674 HUnit ==1.3.1.1 (latest: 1.5.0.0)
676 $ cabal outdated --freeze-file --ignore=HTTP --minor=HUnit
677 Outdated dependencies:
678 HUnit ==1.3.1.1 (latest: 1.3.1.2)
681 ``cabal outdated`` supports the following flags:
683 .. option:: --freeze-file
685 Read dependency version bounds from the freeze file.
687 (``cabal.config``) instead of the package description file
688 (``$PACKAGENAME.cabal``).
690 .. option:: --v2-freeze-file
694 Read dependency version bounds from the v2-style freeze file
695 (by default, ``cabal.project.freeze``) instead of the package
696 description file. ``--new-freeze-file`` is an alias for this flag
697 that can be used with pre-2.4 ``cabal``.
699 .. option:: --project-file=FILE
703 Read dependency version bounds from the v2-style freeze file
704 related to the named project file (i.e., ``$PROJECTFILE.freeze``)
705 instead of the package description file. If multiple ``--project-file``
706 flags are provided, only the final one is considered. This flag
707 must only be passed in when ``--new-freeze-file`` is present.
709 .. option:: --simple-output
711 Print only the names of outdated dependencies, one per line.
713 .. option:: --exit-code
715 Exit with a non-zero exit code when there are outdated dependencies.
717 .. option:: -q, --quiet
719 Don't print any output. Implies ``-v0`` and ``--exit-code``.
721 .. option:: --ignore=PKGS
723 Don't warn about outdated dependency version bounds for the packages in this list.
725 .. option:: --minor[PKGS]
727 Ignore major version bumps for these packages.
729 E.g. if there's a version 2.0 of a package ``pkg`` on Hackage and the freeze
730 file specifies the constraint ``pkg == 1.9``, ``cabal outdated --freeze
731 --minor=pkg`` will only consider the ``pkg`` outdated when there's a version
732 of ``pkg`` on Hackage satisfying ``pkg > 1.9 && < 2.0``. ``--minor`` can also
733 be used without arguments, in that case major version bumps are ignored for
736 .. _command-group-build:
738 Project building and installing
739 -------------------------------
744 ``cabal build`` takes a set of targets and builds them. It
745 automatically handles building and installing any dependencies of these
748 In component targets, ``package:`` and ``ctype:`` (valid component types
749 are ``lib``, ``flib``, ``exe``, ``test`` and ``bench``) can be used to
750 disambiguate when multiple packages define the same component, or the
751 same component name is used in a package (e.g., a package ``foo``
752 defines both an executable and library named ``foo``). We always prefer
753 interpreting a target as a package name rather than as a component name.
755 Some example targets:
759 $ cabal build lib:foo-pkg # build the library named foo-pkg
760 $ cabal build foo-pkg:foo-tests # build foo-tests in foo-pkg
761 $ cabal build src/Lib.s # build the library component to
762 # which "src/Lib.hs" belongs
763 $ cabal build app/Main.hs # build the executable component of
765 $ cabal build Lib # build the library component to
766 # which the module "Lib" belongs
767 $ cabal build path/to/script # build the script as an executable
769 Beyond a list of targets, ``cabal build`` accepts all the flags that
770 ``cabal configure`` takes. Most of these flags are only taken into
771 consideration when building local packages; however, some flags may
772 cause extra store packages to be built (for example,
773 ``--enable-profiling`` will automatically make sure profiling libraries
774 for all transitive dependencies are built and installed.)
776 When building a script, the executable is cached under the cabal directory.
777 See ``cabal run`` for more information on scripts.
779 In addition ``cabal build`` accepts these flags:
781 .. option:: --only-configure
783 When given we will forego performing a full build and abort after running
784 the configure phase of each target package.
789 ``cabal install [FLAGS] [TARGETS]`` builds the specified target packages and
790 symlinks/copies their executables in ``installdir`` (usually ``~/.local/bin``).
794 If not every package has an executable to install, use ``all:exes`` rather
795 than ``all`` as the target. To overwrite an installation, use
796 ``--overwrite-policy=always`` as the default policy is ``never``.
798 For example this command will build the latest ``cabal-install`` and symlink
799 its ``cabal`` executable:
803 $ cabal install cabal-install
805 In addition, it's possible to use ``cabal install`` to install components
806 of a local project. For example, with an up-to-date Git clone of the Cabal
807 repository, this command will build cabal-install HEAD and symlink the
808 ``cabal`` executable:
812 $ cabal install exe:cabal
814 Where symlinking is not possible (eg. on some Windows versions) the ``copy``
815 method is used by default. You can specify the install method
816 by using ``--install-method`` flag:
820 $ cabal install exe:cabal --install-method=copy --installdir=$HOME/bin
822 Note that copied executables are not self-contained, since they might use
823 data-files from the store.
825 .. _adding-libraries:
827 Adding libraries to GHC package environments
828 """"""""""""""""""""""""""""""""""""""""""""
830 It is also possible to "install" libraries using the ``--lib`` flag. For
831 example, this command will build the latest Cabal library and install it:
835 $ cabal install --lib Cabal
837 This works by managing GHC package environment files. By default, it is writing
838 to the global environment in ``~/.ghc/$ARCH-$OS-$GHCVER/environments/default``.
839 ``install`` provides the ``--package-env`` flag to control which of these
840 environments is modified.
842 This command will modify the environment file in the current directory:
846 $ cabal install --lib Cabal --package-env .
848 This command will modify the environment file in the ``~/foo`` directory:
852 $ cabal install --lib Cabal --package-env foo/
854 Do note that the results of the previous two commands will be overwritten by
855 the use of other style commands, so it is not recommended to use them inside
858 This command will modify the environment in the ``local.env`` file in the
863 $ cabal install --lib Cabal --package-env local.env
865 This command will modify the ``myenv`` named global environment:
869 $ cabal install --lib Cabal --package-env myenv
871 If you wish to create a named environment file in the current directory where
872 the name does not contain an extension, you must reference it as ``./myenv``.
874 You can learn more about how to use these environments in `this section of the
875 GHC manual <https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/packages.html#package-environments>`_.
880 ``cabal haddock [FLAGS] [TARGET]`` builds Haddock documentation for
881 the specified packages within the project.
883 If a target is not a library :cfg-field:`haddock-benchmarks`,
884 :cfg-field:`haddock-executables`, :cfg-field:`haddock-internal`,
885 :cfg-field:`haddock-tests` will be implied as necessary.
887 cabal haddock-project
888 ^^^^^^^^^^^^^^^^^^^^^
890 ``cabal haddock-project [FLAGS]`` builds Haddock documentation for all local
891 packages specified in the project.
893 By default the documentation will be put in ``./haddocks`` folder, this can be
894 modified with the ``--output`` flag.
896 This command supports two primary modes: building a self contained directory
897 (which is the default mode) or documentation that links to Hackage (with
900 In both cases the html index as well as quickjump index will include all terms
901 and types defined in any of the local packages, but not ones that are included
902 in any of the dependencies. But note that if you navigate to a dependency,
903 you will have access to its quickjump index.
905 The generated landing page will contain one tree of all modules per local
911 ``cabal clean [FLAGS]`` cleans up the temporary files and build artifacts
912 stored in the ``dist-newstyle`` folder.
914 By default, it removes the entire folder, but it can also spare the configuration
915 and caches if the ``--save-config`` option is given, in which case it only removes
916 the build artefacts (``.hi``, ``.o`` along with any other temporary files generated
917 by the compiler, along with the build output).
919 ``cabal clean [FLAGS] path/to/script`` cleans up the temporary files and build
920 artifacts for the script, which are stored under the .cabal/script-builds directory.
922 In addition when clean is invoked it will remove all script build artifacts for
923 which the corresponding script no longer exists.
925 .. _command-group-run:
933 ``cabal list-bin`` will either (a) display the path for a single executable or (b)
934 complain that the target doesn't resolve to a single binary. In the latter case,
935 it will name the binary products contained in the package. These products can
936 be used to narrow the search and get an actual path to a particular executable.
938 Example showing a failure to resolve to a single executable.
942 $ cabal list-bin cabal-install
943 cabal: The list-bin command is for finding a single binary at once. The
944 target 'cabal-install' refers to the package cabal-install-#.#.#.# which
945 includes the executable 'cabal', the test suite 'unit-tests', the test suite
946 'mem-use-tests', the test suite 'long-tests' and the test suite
947 'integration-tests2'.
949 For a scope that results in only one item we'll get a path.
953 $ cabal list-bin cabal-install:exes
954 /.../dist-newstyle/build/.../cabal/cabal
956 $ cabal list-bin cabal-install:cabal
957 /.../dist-newstyle/build/.../cabal/cabal
959 We can also scope to test suite targets as they produce binaries.
963 $ cabal list-bin cabal-install:tests
964 cabal: The list-bin command is for finding a single binary at once. The
965 target 'cabal-install:tests' refers to the test suites in the package
966 cabal-install-#.#.#.# which includes the test suite 'unit-tests', the test
967 suite 'mem-use-tests', the test suite 'long-tests' and the test suite
968 'integration-tests2'.
970 $ cabal list-bin cabal-install:unit-tests
971 /.../dist-newstyle/.../unit-tests/unit-tests
973 Note that ``cabal list-bin`` will print the executables' location, but
974 will not make sure that these executables actually exist (i.e., have
975 been successfully built). In order to determine the correct location,
976 it may invoke the configuration step (see ``cabal configure``).
981 ``cabal repl TARGET [FLAGS]``
982 opens an interactive session for the target component within the project and
983 loads all of the modules of the target into GHCi as interpreted bytecode.
984 The available targets are the same as for the ``build`` command: individual components
985 within packages in the project, including libraries, executables, test-suites
986 and benchmarks (see `the build section <#cabal-build>`__ for the target syntax).
987 Local packages can also be specified, in which case the library
988 component in the package will be used, or the (first listed) executable in the
989 package if there is no library. Dependencies are built or rebuilt as necessary.
995 $ cabal repl # default component in the package in the current directory
996 $ cabal repl pkgname # default component in the package named 'pkgname'
997 $ cabal repl ./pkgfoo # default component in the package in the ./pkgfoo directory
998 $ cabal repl cname # component named 'cname'
999 $ cabal repl pkgname:cname # component 'cname' in the package 'pkgname'
1001 Configuration flags can be specified on the command line and these extend the project
1002 configuration from the 'cabal.project', 'cabal.project.local' and other files.
1004 .. option:: --repl-options=FLAG
1006 To avoid ``ghci``-specific flags from triggering unneeded global rebuilds, these
1007 flags are stripped from the internal configuration. As a result,
1008 ``--ghc-options`` will no longer (reliably) work to pass flags to ``ghci`` (or
1009 other REPLs). Instead, you should use the ``--repl-options`` flag to
1010 specify these options to the invoked REPL.
1012 .. option:: --repl-no-load
1014 Disables the loading of target modules at startup.
1016 .. option:: -b DEPENDENCIES or -bDEPENDENCIES, --build-depends=DEPENDENCIES
1018 A way to experiment with libraries without needing to download
1019 them manually or to install them globally.
1021 This command opens a REPL with the current default target loaded, and a version
1022 of the ``vector`` package matching that specification exposed.
1026 $ cabal repl --build-depends="vector >= 0.12 && < 0.13"
1028 Both of these commands do the same thing as the above, but only expose ``base``,
1029 ``vector``, and the ``vector`` package's transitive dependencies even if the user
1030 is in a project context.
1034 $ cabal repl --ignore-project --build-depends="vector >= 0.12 && < 0.13"
1035 $ cabal repl --project='' --build-depends="vector >= 0.12 && < 0.13"
1037 This command would add ``vector``, but not (for example) ``primitive``, because
1038 it only includes the packages specified on the command line (and ``base``, which
1039 cannot be excluded for technical reasons).
1043 $ cabal repl --build-depends=vector --no-transitive-deps
1045 ``cabal repl`` can open scripts by passing the path to the script as the target.
1049 $ cabal repl path/to/script
1051 The configuration information for the script is cached under the cabal directory
1052 and can be pre-built with ``cabal build path/to/script``.
1053 See ``cabal run`` for more information on scripts.
1055 .. option:: --enable-multi-repl
1057 Allow starting GHCi with multiple targets.
1058 This requires GHC with multiple home unit support (GHC-9.4+)
1060 The closure of required components will be loaded.
1062 .. option:: --disable-multi-repl
1064 Disallow starting GHCi with multiple targets. This reverts back to the behaviour
1065 in version 3.10 and earlier where only a single component can be loaded at
1073 ``cabal run [TARGET] [FLAGS] [-- EXECUTABLE_FLAGS]`` runs the executable
1074 specified by the target, which can be a component, a package or can be left
1075 blank, as long as it can uniquely identify an executable within the project.
1076 Tests and benchmarks are also treated as executables.
1078 See `the build section <#cabal-build>`__ for the target syntax.
1080 When ``TARGET`` is one of the following:
1082 - A component target: execute the specified executable, benchmark or test suite.
1085 1. If the package has exactly one executable component, it will be selected.
1086 2. If the package has multiple executable components, an error is raised.
1087 3. If the package has exactly one test or benchmark component, it will be selected.
1088 4. Otherwise an issue is raised.
1090 - The path to a script: execute the script at the path.
1092 - Empty target: Same as package target, implicitly using the package from the current
1095 Except in the case of the empty target, the strings after it will be
1096 passed to the executable as arguments.
1098 If one of the arguments starts with ``-`` it will be interpreted as
1099 a cabal flag, so if you need to pass flags to the executable you
1100 have to separate them with ``--``.
1104 $ cabal run target -- -a -bcd --argument
1106 ``run`` supports running script files that use a certain format.
1111 #!/usr/bin/env cabal
1113 build-depends: base ^>= 4.14
1117 with-compiler: ghc-8.10.7
1124 Where there cabal metadata block is mandatory and contains fields from a
1125 package executable block, and the project metadata block is optional and
1126 contains fields that would be in the cabal.project file in a regular project.
1128 Only some fields are supported in the metadata blocks, and these fields are
1129 currently not validated. See
1130 `#8024 <https://github.com/haskell/cabal/issues/8024>`__ for details.
1132 A script can either be executed directly using `cabal` as an interpreter or
1137 $ cabal run path/to/script
1139 The executable is cached under the cabal directory, and can be pre-built with
1140 ``cabal build path/to/script`` and the cache can be removed with
1141 ``cabal clean path/to/script``.
1143 A note on targets: Whenever a command takes a script target and it matches the
1144 name of another target, the other target is preferred. To load the script
1145 instead pass it as an explicit path: ./script
1147 By default, scripts are run at silent verbosity (``--verbose=0``). To show the
1148 build output for a script either use the command
1152 $ cabal run --verbose=n path/to/script
1154 or the interpreter line
1158 #!/usr/bin/env -S cabal run --verbose=n
1160 For more information see :cfg-field:`verbose`
1165 ``cabal bench [TARGETS] [FLAGS]`` runs the specified benchmarks
1166 (all the benchmarks in the current package by default), first ensuring
1167 they are up to date.
1169 ``cabal bench`` inherits flags of the ``bench`` subcommand of ``Setup.hs``,
1170 :ref:`see the corresponding section <setup-bench>`.
1175 ``cabal test [TARGETS] [FLAGS]`` tests test suites specified as targets
1176 after ensuring they are up to date and building them, if necessary.
1180 For a test suite, there's a difference between testing it with ``cabal
1181 test`` and running it with ``cabal run`` to do with the working directory.
1182 The former tests the test suite; that is to say that it "runs" the test suite
1183 from the package directory (from the directory of the package that has the
1184 test suite as a component), while the latter runs the test suite from
1185 whatever directory is current when the ``cabal run`` command is issued.
1186 This is important because the test suite may depend on files in the package
1187 directory, and so may not work correctly if run from another directory.
1191 Even though ``[TARGETS]`` are optional, ``cabal test`` will only test test
1192 suites without specifying a target if in the directory of a package,
1193 alongside a ``.cabal`` file. Being in the directory of a package implicitly
1194 selects that package for the test command.
1196 Taking the cabal project as an example that has a ``Cabal-tests`` package
1197 with multiple test suites, the following two commands are effectively the
1198 same and will test the test suites of the ``Cabal-tests`` package:
1202 $ cabal test Cabal-tests
1203 $ cd Cabal-tests && cabal test && cd ..
1205 If you want to test all of the test suites in a project then from the
1206 project directory ``cabal build`` with no target will fail:
1208 .. code-block:: text
1212 No targets given and there is no package in the current directory. Use
1213 the target 'all' for all packages in the project or specify packages or
1214 components by name or location. See 'cabal build --help' for more
1215 details on target options.
1217 Both ``cabal test all:tests`` and ``cabal test all`` use explicit targets
1218 for testing all test suites of a project; the former's ``all:tests`` target
1219 will select all test suites of the project, while the latter's ``all``
1220 target will select all packages of the project and, from those, test all
1223 ``cabal test`` inherits flags of the ``test`` subcommand of ``Setup.hs``
1224 (:ref:`see the corresponding section <setup-test>`) with one caveat: every
1225 ``Setup.hs test`` flag receives the ``test-`` prefix if it already does
1226 not have one; e.g. ``--show-details`` becomes ``--test-show-details`` but
1227 ``--test-wrapper`` remains the same.
1232 ``cabal exec [FLAGS] [--] COMMAND [--] [ARGS]`` runs the specified command
1233 using the project's environment. That is, passing the right flags to compiler
1234 invocations and bringing the project's executables into scope.
1236 .. _command-group-ship:
1238 Sanity checks and shipping
1239 --------------------------
1244 ``cabal check [FLAGS]`` checks the package for common mistakes (e.g.: if
1245 it is missing important fields like ``synopsis``, if it is using
1246 tricky GHC options, etc.).
1248 Run ``cabal check`` in the folder where your ``.cabal`` package file is.
1250 .. option:: -i, --ignore=WARNING
1252 Ignore a specific type of warning (e.g. ``--ignore=missing-upper-bounds``).
1253 Check the list of warnings for which constructor to use.
1255 .. option:: -v[n], --verbose[=n]
1257 Control verbosity (n is 0--3, default verbosity level is 1).
1259 Issues are classified as ``Warning``\s and ``Error``\s. The latter correspond
1260 to Hackage requirements for uploaded packages: if no error is reported,
1261 Hackage should accept your package. If errors are present ``cabal check``
1262 exits with ``1`` and Hackage will refuse the package.
1264 A list of all warnings with their constructor:
1266 - ``parser-warning``: inherited from parser.
1267 - ``no-name-field``: missing ``name`` field.
1268 - ``no-version-field``: missing ``version`` field.
1269 - ``no-target``: missing target in ``.cabal``.
1270 - ``unnamed-internal-library``: unnamed internal library.
1271 - ``duplicate-sections``: duplicate name in target.
1272 - ``illegal-library-name``: internal library with same name as package.
1273 - ``no-modules-exposed``: no module exposed in library.
1274 - ``signatures``: ``signatures`` used with ``cabal-version`` < 2.0.
1275 - ``autogen-not-exposed``: ``autogen-module`` neither in ``exposed-modules`` nor ``other-modules``.
1276 - ``autogen-not-included``: ``autogen-include`` neither in ``include`` nor ``install-includes``.
1277 - ``no-main-is``: missing ``main-is``.
1278 - ``unknown-extension-main``: ``main-is`` is not ``.hs`` nor ``.lhs``.
1279 - ``c-like-main``: C-like source file in ``main-is`` with ``cabal-version`` < 1.18.
1280 - ``autogen-other-modules``: ``autogen-module`` not in ``other-modules``.
1281 - ``autogen-exe``: ``autogen-include`` not in ``includes``.
1282 - ``unknown-testsuite-type``: unknown test-suite type.
1283 - ``unsupported-testsuite``: unsupported test-suite type.
1284 - ``unknown-bench``: unknown benchmark type.
1285 - ``unsupported-bench``: unsupported benchmark type.
1286 - ``bench-unknown-extension``: ``main-is`` for benchmark is neither ``.hs`` nor ``.lhs``.
1287 - ``invalid-name-win``: invalid package name on Windows.
1288 - ``reserved-z-prefix``: package with ``z-`` prexif (reseved for Cabal.
1289 - ``no-build-type``: missing ``build-type``.
1290 - ``undeclared-custom-setup``: ``custom-setup`` section without ``build-type: Custom``
1291 - ``unknown-compiler-tested``: unknown compiler in ``tested-with``.
1292 - ``unknown-languages``: unknown languages.
1293 - ``unknown-extension``: unknown extensions.
1294 - ``languages-as-extensions``: languages listed as extensions.
1295 - ``deprecated-extensions``: deprecated extensions.
1296 - ``no-category``: missing ``category`` field.
1297 - ``no-maintainer``: missing ``maintainer`` field.
1298 - ``no-synopsis``: missing ``synopsis`` field.
1299 - ``no-description``: missing ``description`` field.
1300 - ``no-syn-desc``: missing ``synopsis`` or ``description`` field.
1301 - ``long-synopsis``: ``synopsis`` longer than 80 characters.
1302 - ``short-description``: ``description`` shorter than ``synopsis``.
1303 - ``invalid-range-tested``: invalid ``tested-with`` version range.
1304 - ``impossible-dep``: impossible internal library version range dependency.
1305 - ``impossible-dep-exe``: impossible internal executable version range dependency.
1306 - ``no-internal-exe``: missing internal executable.
1307 - ``license-none``: ``NONE`` in ``license`` field.
1308 - ``no-license``: no ``license`` field.
1309 - ``all-rights-reserved``: “All rights reserved” license.
1310 - ``license-parse``: license not to be used with ``cabal-version`` < 1.4.
1311 - ``unknown-license``: unknown license.
1312 - ``bsd4-license``: uncommon BSD (BSD4) license.
1313 - ``unknown-license-version``: unknown license version.
1314 - ``no-license-file``: missing license file.
1315 - ``unrecognised-repo-type``: unrecognised kind of source-repository.
1316 - ``repo-no-type``: missing ``type`` in ``source-repository``.
1317 - ``repo-no-location``: missing ``location`` in ``source-repository``.
1318 - ``repo-no-module``: missing ``module`` in ``source-repository``.
1319 - ``repo-no-tag``: missing ``tag`` in ``source-repository``.
1320 - ``repo-relative-dir``: ``subdir`` in ``source-repository`` must be relative.
1321 - ``repo-malformed-subdir``: malformed ``subdir`` in ``source-repository``.
1322 - ``option-fasm``: unnecessary ``-fasm``.
1323 - ``option-fhpc``: unnecessary ``-fhpc``.
1324 - ``option-prof``: unnecessary ``-prof``.
1325 - ``option-o``: unnecessary ``-o``.
1326 - ``option-hide-package``: unnecessary ``-hide-package``.
1327 - ``option-make``: unnecessary ``--make``.
1328 - ``option-optimize``: unnecessary disable optimization flag.
1329 - ``option-o1``: unnecessary optimisation flag (``-O1``).
1330 - ``option-o2``: unnecessary optimisation flag (``-O2``).
1331 - ``option-split-section``: unnecessary ``-split-section``.
1332 - ``option-split-objs``: unnecessary ``-split-objs``.
1333 - ``option-optl-wl``:unnecessary ``-optl-Wl,-s``.
1334 - ``use-extension``: use ``extension`` field instead of ``-fglasgow-exts``.
1335 - ``option-rtsopts``: unnecessary ``-rtsopts``.
1336 - ``option-with-rtsopts``: unnecessary ``-with-rtsopts``.
1337 - ``option-opt-c``: unnecessary ``-O[n]`` in C code.
1338 - ``cpp-options``: unportable ``-cpp-options`` flag.
1339 - ``misplaced-c-opt``: C-like options in wrong cabal field.
1340 - ``relative-path-outside``: relative path outside of source tree.
1341 - ``absolute-path``: absolute path where not allowed.
1342 - ``malformed-relative-path``: malformed relative path.
1343 - ``unreliable-dist-path``: unreliable path pointing inside ``dist``.
1344 - ``glob-syntax-error``: glob syntax error.
1345 - ``recursive-glob``: recursive glob including source control folders.
1346 - ``invalid-path-win``: invalid path on Windows.
1347 - ``long-path``: path too long (POSIX, 255 ASCII chars).
1348 - ``long-name``: path *name* too long (POSIX, 100 ASCII chars).
1349 - ``name-not-portable``: path non portable (POSIX, split requirements).
1350 - ``empty-path``: empty path.
1351 - ``test-cabal-ver``: ``test-suite`` used with ``cabal-version`` < 1.10.
1352 - ``default-language``: ``default-language`` used with ``cabal-version`` < 1.10.
1353 - ``no-default-language``: missing ``default-language``.
1354 - ``add-default-language``: suggested ``default-language``.
1355 - ``extra-doc-files``: ``extra-doc-files`` used with ``cabal-version`` < 1.18.
1356 - ``multilib``: multiple ``library`` sections with ``cabal-version`` < 2.0.
1357 - ``reexported-modules``: ``reexported-modules`` with ``cabal-version`` < 1.22.
1358 - ``mixins``: ``mixins`` with ``cabal-version`` < 2.0.
1359 - ``extra-framework-dirs``: ``extra-framework-dirs`` with ``cabal-version`` < 1.24.
1360 - ``default-extensions``: ``default-extensions`` with ``cabal-version`` < 1.10.
1361 - ``extensions-field``: deprecated ``extensions`` field used with ``cabal-version`` ≥ 1.10
1362 - ``unsupported-sources``: ``asm-sources``, ``cmm-sources``, ``extra-bundled-libraries`` or ``extra-library-flavours`` used with ``cabal-version`` < 3.0.
1363 - ``extra-dynamic``: ``extra-dynamic-library-flavours`` used with cabal-version < 3.0.
1364 - ``virtual-modules``: ``virtual-modules`` used with cabal-version < 2.2.
1365 - ``source-repository``: ``source-repository`` used with ``cabal-version`` 1.6.
1366 - ``incompatible-extension``: incompatible language extension with ``cabal-version``.
1367 - ``no-setup-depends``: missing ``setup-depends`` field in ``custom-setup`` with ``cabal-version`` ≥ 1.24.
1368 - ``dependencies-setup``: missing dependencies in ``custom-setup`` with ``cabal-version`` ≥ 1.24.
1369 - ``no-autogen-paths``: missing autogen ``Paths_*`` modules in ``autogen-modules`` (``cabal-version`` ≥ 2.0).
1370 - ``no-autogen-pinfo``: missing autogen ``PackageInfo_*`` modules in ``autogen-modules`` *and* ``exposed-modules``/``other-modules`` (``cabal-version`` ≥ 2.0).
1371 - ``no-glob-match``: glob pattern not matching any file.
1372 - ``glob-no-extension``: glob pattern not matching any file becuase of lack of extension matching (`cabal-version` < 2.4).
1373 - ``glob-missing-dir``: glob pattern trying to match a missing directory.
1374 - ``unknown-os``: unknown operating system name in condition.
1375 - ``unknown-arch``: unknown architecture in condition.
1376 - ``unknown-compiler``: unknown compiler in condition.
1377 - ``missing-bounds-important``: missing upper bounds for important dependencies (``base``, and for ``custom-setup`` ``Cabal`` too).
1378 - ``missing-upper-bounds``: missing upper bound in dependency (excluding test-suites and benchmarks).
1379 - ``suspicious-flag``: troublesome flag name (e.g. starting with a dash).
1380 - ``unused-flag``: unused user flags.
1381 - ``non-ascii``: non-ASCII characters in custom field.
1382 - ``rebindable-clash-paths``: ``Rebindable Syntax`` with ``OverloadedStrings``/``OverloadedStrings`` plus autogenerated ``Paths_*`` modules with ``cabal-version`` < 2.2.
1383 - ``rebindable-clash-info``: ``Rebindable Syntax`` with ``OverloadedStrings``/``OverloadedStrings`` plus autogenerated ``PackageInfo_*`` modules with ``cabal-version`` < 2.2.
1384 - ``werror``: ``-WError`` not under a user flag.
1385 - ``unneeded-j``: suspicious ``-j[n]`` usage.
1386 - ``fdefer-type-errors``: suspicious ``-fdefer-type-errors``.
1387 - ``debug-flag``: suspicious ``-d*`` debug flag for distributed package.
1388 - ``fprof-flag``: suspicious ``-fprof-*`` flag.
1389 - ``missing-bounds-setup``: missing upper bounds in ``setup-depends``.
1390 - ``duplicate-modules``: duplicate modules in target.
1391 - ``maybe-duplicate-modules``: potential duplicate module in target (subject to conditionals).
1392 - ``bom``: unicode byte order mark (BOM) character at start of file.
1393 - ``name-no-match``: filename not matching ``name``.
1394 - ``no-cabal-file``: no ``.cabal`` file found in folder.
1395 - ``multiple-cabal-file``: multiple ``.cabal`` files found in folder.
1396 - ``unknown-file``: path refers to a file which does not exist.
1397 - ``missing-setup``: missing ``Setup.hs`` or ``Setup.lsh``.
1398 - ``missing-conf-script``: missing ``configure`` script with ``build-type: Configure``.
1399 - ``unknown-directory``: paths refer to a directory which does not exist.
1400 - ``no-repository``: missing ``source-repository`` section.
1401 - ``no-docs``: missing expected documentation files (changelog).
1402 - ``doc-place``: documentation files listed in ``extra-source-files`` instead of ``extra-doc-files``.
1409 ``cabal sdist [FLAGS] [PACKAGES]`` takes the crucial files needed to build ``PACKAGES``
1410 and puts them into an archive format ready for upload to Hackage. These archives are stable
1411 and two archives of the same format built from the same source will hash to the same value.
1413 ``cabal sdist`` takes the following flags:
1415 .. option:: -l, --list-only
1417 Rather than creating an archive, lists files that would be included.
1419 Output is to ``stdout`` by default. The file paths are relative to the project's root
1422 .. option:: -o PATH or -oPATH, --output-directory=PATH
1424 Sets the output dir, if a non-default one is desired. The default is
1425 ``dist-newstyle/sdist/``. ``--output-directory -`` will send output to ``stdout``
1426 unless multiple archives are being created.
1428 .. option:: --null-sep
1430 Only used with ``--list-only``. Separates filenames with a NUL
1431 byte instead of newlines.
1433 ``sdist`` is inherently incompatible with sdist hooks (which were removed in `Cabal-3.0`),
1434 not due to implementation but due to fundamental core invariants
1435 (same source code should result in the same tarball, byte for byte)
1436 that must be satisfied for it to function correctly in the larger build ecosystem.
1437 ``autogen-modules`` is able to replace uses of the hooks to add generated modules, along with
1438 the custom publishing of Haddock documentation to Hackage.
1443 ``cabal upload [FLAGS] TARFILES`` uploads source packages or documentation
1446 .. option:: --publish
1448 Publish the package immediately instead of uploading it as a
1449 `package candidate <https://hackage.haskell.org/upload#candidates>`__
1450 (make sure everything is fine, you cannot delete published packages
1453 .. option:: -d, --documentation
1455 Upload documentation instead of a source package. To upload
1456 documentation for a published package (and not a candidate), add
1459 .. option:: -t TOKEN or -tTOKEN, --token=TOKEN
1461 Your Hackage authentication token. You can create and delete
1462 authentication tokens on Hackage's `account management page
1463 <https://hackage.haskell.org/users/account-management>`__.
1465 .. option:: -u USERNAME or -uUSERNAME, --username=USERNAME
1467 Your Hackage username.
1469 .. option:: -p PASSWORD or -pPASSWORD, --password=PASSWORD
1471 Your Hackage password.
1473 .. option:: -P COMMAND or -PCOMMAND, --password-command=COMMAND
1475 Command to get your Hackage password. Arguments with whitespace
1476 must be quoted (double-quotes only). For example:
1480 --password-command='sh -c "grep hackage ~/secrets | cut -d : -f 2"'
1482 Or in the config file:
1486 password-command: sh -c "grep hackage ~/secrets | cut -d : -f 2"
1492 ``cabal report [FLAGS]`` uploads build reports to Hackage.
1494 .. option:: -t TOKEN or -tTOKEN, --token=TOKEN
1496 Your Hackage authentication token. You can create and delete
1497 authentication tokens on Hackage's `account management page
1498 <https://hackage.haskell.org/users/account-management>`__.
1500 .. option:: -u USERNAME or -uUSERNAME, --username=USERNAME
1502 Your Hackage username.
1504 .. option:: -p PASSWORD or -pPASSWORD, --password=PASSWORD
1506 Your Hackage password.
1508 .. include:: references.inc