1 cabal.project Reference
2 =======================
4 ``cabal.project`` files support a variety of options which configure the
5 details of your build. The general syntax of a ``cabal.project`` file is
6 similar to that of a Cabal file: there are a number of fields, some of
7 which live inside stanzas (groups of fields that apply to only part of a
8 project or can be referenced as a unit):
13 with-compiler: /opt/ghc/8.0.1/bin/ghc
18 In general, the accepted field names coincide with the accepted command
19 line flags that ``cabal install`` and other commands take. For example,
20 ``cabal configure --enable-profiling`` will write out a project
21 file with ``profiling: True``.
23 The full configuration of a project is determined by combining the
24 following sources (later entries override earlier ones, except for appendable
27 1. :ref:`The user-wide global configuration <config-file-discovery>` (default: ``~/.config/cabal/config``)
29 2. ``cabal.project`` (the project configuration)
31 3. ``cabal.project.freeze`` (the output of ``cabal freeze``)
33 4. ``cabal.project.local`` (the output of ``cabal configure``)
35 Any call to ``cabal build`` will consider ``cabal.project*`` files from parent
36 directories when there is none in the current directory.
38 .. _conditionals and imports:
40 Conditionals and imports
41 ------------------------
43 As of ``cabal-install`` version 3.8, cabal supports conditional logic
44 and imports in ``cabal.project`` files. :ref:`conditions` in cabal
45 may case on operating system, architecture, and
46 compiler (i.e. there is no support for a notion of custom flags in
47 project files). Imports may specify local filepaths or remote urls,
48 and may reference either cabal.project files or v1-style cabal.config
49 freeze files. As a usage example:
56 packages: freebsd/*.cabal
60 import: https://some.remote.source/subdir/cabal.config
62 import: relativepath/extra-project.project
64 import: /absolutepath/some-project.project
66 Using conditionals will force cabal to find a ghc to derive
67 architecture and version information from, which will force some
68 commands (update, sdist) to require ghc present where otherwise it
69 would not be necessitated.
71 Specifying the local packages
72 -----------------------------
74 The following top-level options specify what the local packages of a
77 .. cfg-field:: packages: package location list (space or comma separated)
78 :synopsis: Project packages.
80 :default: ``./*.cabal``
84 The default value ``./*.cabal`` only takes effect if there is no explicit
85 ``cabal.project`` file.
86 If you use such explicit file you *must* fill the field.
88 Specifies the list of package locations which contain the local
89 packages to be built by this project. Package locations can take the
92 1. They can specify a Cabal file, or a directory containing a Cabal
93 file, e.g., ``packages: Cabal cabal-install/cabal-install.cabal``.
95 2. They can specify glob-style wildcards, which must match one or
96 more (a) directories containing a (single) Cabal file, (b) Cabal
97 files (extension ``.cabal``), or (c) tarballs which contain Cabal
98 packages (extension ``.tar.gz``).
99 For example, to match all Cabal files in all
100 subdirectories, as well as the Cabal projects in the parent
101 directories ``foo`` and ``bar``, use
102 ``packages: */*.cabal ../{foo,bar}/``
104 3. They can specify an ``http``, ``https`` or ``file``
105 URL, representing the path to a remote tarball to be downloaded
108 There is no command line variant of this field; see :issue:`3585`.
109 Note that the default value is only included if there is no
110 ``cabal.project`` file. The field is appendable which means there would be
111 no way to drop the default value if it was included.
113 .. cfg-field:: optional-packages: package location list (space or comma-separated)
114 :synopsis: Optional project packages.
118 Like :cfg-field:`packages`, specifies a list of package locations
119 containing local packages to be built. Unlike :cfg-field:`packages`,
120 if we glob for a package, it is permissible for the glob to match against
121 zero packages. The intended use-case for :cfg-field:`optional-packages`
122 is to make it so that vendored packages can be automatically picked up if
123 they are placed in a subdirectory, but not error if there aren't any.
125 There is no command line variant of this field.
127 .. cfg-field:: extra-packages: package list with version bounds (comma separated)
128 :synopsis: Adds external packages as local
130 Specifies a list of external packages from Hackage, which
131 should be considered local packages. The motivation for
132 :cfg-field:`extra-packages` is making libraries that are not
133 dependencies of any package in the project available for use in ghci.
135 There is no command line variant of this field.
139 All local packages are *vendored*, in the sense that if other packages
140 (including external ones from Hackage) depend on a package with the name
141 of a local package, the local package is preferentially used.
142 For subdirectories to be considered local packages, the following setting
146 optional-packages: ./*/*.cabal
148 ...then any package can be vendored simply by making a checkout in the
149 top-level project directory, as might be seen in this hypothetical
153 foo-helper/ # local package
154 unix/ # vendored external package
156 All of these options support globs. ``cabal build`` has its own glob
159 - Anywhere in a path, as many times as you like, you can specify an
160 asterisk ``*`` wildcard. E.g., ``*/*.cabal`` matches all ``.cabal``
161 files in all immediate subdirectories. Like in glob(7), asterisks do
162 not match hidden files unless there is an explicit period, e.g.,
163 ``.*/foo.cabal`` will match ``.private/foo.cabal`` (but
164 ``*/foo.cabal`` will not).
166 - You can use braces to specify specific directories; e.g.,
167 ``{vendor,pkgs}/*.cabal`` matches all Cabal files in the ``vendor``
168 and ``pkgs`` subdirectories.
170 Formally, the format is described by the following BNF:
173 convert globbing grammar to proper ABNF_ syntax
177 FilePathGlob ::= FilePathRoot FilePathGlobRel
178 FilePathRoot ::= {- empty -} # relative to cabal.project
180 | [a-zA-Z] ":" [/\\] # Windows root
181 | "~" # home directory
182 FilePathGlobRel ::= Glob "/" FilePathGlobRel # Unix directory
183 | Glob "\\" FilePathGlobRel # Windows directory
185 | {- empty -} # trailing slash
187 GlobPiece ::= "*" # wildcard
188 | [^*{},/\\] * # literal string
189 | "\\" [*{},] # escaped reserved character
190 | "{" Glob "," ... "," Glob "}" # union (match any of these)
193 Specifying Packages from Remote Version Control Locations
194 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
196 Starting with Cabal 2.4, there is now a stanza
197 ``source-repository-package`` for specifying packages from an external
200 .. code-block:: cabal
204 source-repository-package
206 location: https://github.com/hvr/HsYAML.git
207 tag: e70cf0c171c9a586b62b3f75d72f1591e4e6aaa1
209 source-repository-package
211 location: https://github.com/well-typed/cborg
212 tag: 3d274c14ca3077c3a081ba7ad57c5182da65c8c1
215 source-repository-package
217 location: https://github.com/haskell/network.git
218 tag: e76fdc753e660dfa615af6c8b6a2ad9ddf6afe70
219 post-checkout-command: autoreconf -i
221 cabal-install 3.4 sdists the ``source-repository-package`` repositories and uses resulting tarballs as project packages.
222 This allows sharing of packages across different projects.
224 .. cfg-field:: type: VCS kind
226 .. cfg-field:: location: VCS location (usually URL)
228 .. cfg-field:: tag: VCS tag
230 .. cfg-field:: subdir: subdirectory list
232 Use one or more subdirectories of the repository.
234 .. cfg-field:: post-checkout-command: command
236 Run command in the checked out repository, prior sdisting.
238 Global configuration options
239 ----------------------------
241 The following top-level configuration options are not specific to any
242 package, and thus apply globally:
245 .. cfg-field:: verbose: nat
247 :synopsis: Build verbosity level.
251 Control the verbosity of ``cabal`` commands, valid values are from 0
254 The command line variant of this field is ``--verbose=2``; a short
255 form ``-v2`` is also supported.
257 .. cfg-field:: jobs: nat or $ncpus
258 --jobs=n, -jn, --jobs=$ncpus
259 :synopsis: Number of builds running in parallel.
263 Run *nat* jobs simultaneously when building. If ``$ncpus`` is
264 specified, run the number of jobs equal to the number of CPUs.
265 Package building is often quite parallel, so turning on parallelism
266 can speed up build times quite a bit!
268 The command line variant of this field is ``--jobs=2``; a short form
269 ``-j2`` is also supported; a bare ``--jobs`` or ``-j`` is equivalent
270 to ``--jobs=$ncpus``.
272 .. cfg-field:: keep-going: boolean
274 :synopsis: Try to continue building on failure.
278 If true, after a build failure, continue to build other unaffected
281 The command line variant of this field is ``--keep-going``.
283 .. option:: --builddir=DIR
285 Specifies the name of the directory where build products for
286 build will be stored; defaults to ``dist-newstyle``. If a
287 relative name is specified, this directory is resolved relative
288 to the root of the project (i.e., where the ``cabal.project``
291 This option cannot be specified via a ``cabal.project`` file.
293 .. _cmdoption-project-file:
294 .. option:: --project-file=FILE
296 Specifies the name of the project file used to specify the
297 rest of the top-level configuration; defaults to ``cabal.project``.
298 This name not only specifies the name of the main project file,
299 but also the auxiliary project files ``cabal.project.freeze``
300 and ``cabal.project.local``; for example, if you specify
301 ``--project-file=my.project``, then the other files that will
302 be probed are ``my.project.freeze`` and ``my.project.local``.
304 If the specified project file is a relative path, we will
305 look for the file relative to the current working directory,
306 and then for the parent directory, until the project file is
307 found or we have hit the top of the user's home directory.
309 This option cannot be specified via a ``cabal.project`` file.
311 .. option:: --ignore-project
313 Ignores the local ``cabal.project`` file and uses the default
314 configuration with the local ``foo.cabal`` file. Note that
315 if this flag is set while the ``--project-file`` flag is also
316 set then this flag will be ignored.
318 .. option:: --store-dir=DIR
320 Specifies the name of the directory of the global package store.
322 .. cfg-field:: package-dbs: package DB stack (comma separated)
323 --package-db=[clear, global, user, PATH]
324 :synopsis: PackageDB stack manipulation
327 There are three package databases involved with most builds:
330 Compiler installation of rts, base, etc.
332 Nix-style local build cache
334 Project-specific build directory
336 By default, the package stack you will have with v2 commands is:
342 So all remote packages required by your project will be
343 registered in the store package db (because it is last).
345 When cabal starts building your local projects, it appends the in-place db
350 -- [global, store, in-place]
352 So your local packages get put in ``dist-newstyle`` instead of the store.
354 This flag manipulates the default prefix: ``[global, store]`` and accepts
355 paths, the special value ``global`` referring to the global package db, and
356 ``clear`` which removes all prior entries. For example,
360 -- [global, store, foo]
364 package-dbs: clear, foo
367 package-dbs: clear, foo, clear, bar, baz
369 The command line variant of this flag is ``--package-db=DB`` which can be
370 specified multiple times.
375 The following settings apply to commands that result in build actions
376 (``build``, ``run``, ``repl``, ``test``...), and control which phases of the
379 .. option:: --dry-run
381 Do not download, build, or install anything, only print what would happen.
383 .. option:: --only-configure
385 Instead of performing a full build just run the configure step.
386 Only accepted by the ``build`` command.
388 .. option:: --only-download
390 Do not build anything, only fetch the packages.
392 .. option:: --only-dependencies
394 Install only the dependencies necessary to build the given packages.
395 Not accepted by the ``repl`` command.
397 Solver configuration options
398 ----------------------------
400 The following settings control the behavior of the dependency solver:
402 .. cfg-field:: constraints: constraints list (comma separated)
403 --constraint="pkg >= 2.0", -c "pkg >= 2.0"
404 :synopsis: Extra dependencies constraints.
406 Add extra constraints to the version bounds, flag settings,
407 and other properties a solver can pick for a
408 package. For example:
412 constraints: bar == 2.1
414 A package can be specified multiple times in ``constraints``, in
415 which case the specified constraints are intersected. This is
416 useful, since the syntax does not allow you to specify multiple
417 constraints at once. For example, to specify both version bounds and
418 flag assignments, you would write:
422 constraints: bar == 2.1,
425 Valid constraints take the same form as for the
426 :option:`runhaskell Setup.hs configure --constraint`
429 .. cfg-field:: preferences: preference (comma separated)
430 --preference="pkg >= 2.0"
431 :synopsis: Preferred dependency versions.
433 Like :cfg-field:`constraints`, but the solver will attempt to satisfy
434 these preferences on a best-effort basis. The resulting install is locally
435 optimal with respect to preferences; specifically, no single package
436 could be replaced with a more preferred version that still satisfies
437 the hard constraints.
439 Operationally, preferences can cause the solver to attempt certain
440 version choices of a package before others, which can improve
441 dependency solver runtime.
443 One way to use :cfg-field:`preferences` is to take a known working set of
444 constraints (e.g., via ``cabal freeze``) and record them as
445 preferences. In this case, the solver will first attempt to use this
446 configuration, and if this violates hard constraints, it will try to
447 find the minimal number of upgrades to satisfy the hard constraints
450 The command line variant of this field is
451 ``--preference="pkg >= 2.0"``; to specify multiple preferences, pass
452 the flag multiple times.
454 .. cfg-field:: allow-newer: none, all or list of scoped package names (space or comma separated)
455 --allow-newer, --allow-newer=[none,all,[scope:][^]pkg]
456 :synopsis: Lift dependencies upper bound constraints.
460 Allow the solver to pick more recent version of some packages than
461 would normally be permitted by the :pkg-field:`build-depends` bounds
462 of packages in the install plan. This option may be useful if the
463 dependency solver cannot otherwise find a valid install plan.
465 For example, to relax ``pkg``\ s :pkg-field:`build-depends` upper bound on
466 ``dep-pkg``, write a scoped package name of the form:
470 allow-newer: pkg:dep-pkg
472 If the scope shall be limited to specific releases of ``pkg``, the
477 allow-newer: pkg-1.2.3:dep-pkg, pkg-1.1.2:dep-pkg
479 can be used to limit the relaxation of dependencies on
480 ``dep-pkg`` by the ``pkg-1.2.3`` and ``pkg-1.1.2`` releases only.
482 The scoped syntax is recommended, as it is often only a single package
483 whose upper bound is misbehaving. In this case, the upper bounds of
484 other packages should still be respected; indeed, relaxing the bound
485 can break some packages which test the selected version of packages.
487 The syntax also allows to prefix the dependee package with a
488 modifier symbol to modify the scope/semantic of the relaxation
489 transformation in a additional ways. Currently only one modifier
490 symbol is defined, i.e. ``^`` (i.e. caret) which causes the
491 relaxation to be applied only to ``^>=`` operators and leave all other
492 version operators untouched.
494 However, in some situations (e.g., when attempting to build packages
495 on a new version of GHC), it is useful to disregard *all*
496 upper-bounds, with respect to a package or all packages. This can be
497 done by specifying just a package name, or using the keyword ``all``
498 to specify all packages:
502 -- Disregard upper bounds involving the dependencies on
503 -- packages bar, baz. For quux only, relax
504 -- 'quux ^>= ...'-style constraints only.
505 allow-newer: bar, baz, ^quux
507 -- Disregard all upper bounds when dependency solving
510 -- Disregard all `^>=`-style upper bounds when dependency solving
514 For consistency, there is also the explicit wildcard scope syntax
515 ``*`` (or its alphabetic synonym ``all``). Consequently, the
516 examples above are equivalent to the explicitly scoped variants:
520 allow-newer: all:bar, *:baz, *:^quux
526 allow-newer: all:^all
528 In order to ignore all bounds specified by a package ``pkg-1.2.3``
529 you can combine scoping with a right-hand-side wildcard like so
533 -- Disregard any upper bounds specified by pkg-1.2.3
534 allow-newer: pkg-1.2.3:*
536 -- Disregard only `^>=`-style upper bounds in pkg-1.2.3
537 allow-newer: pkg-1.2.3:^*
540 :cfg-field:`allow-newer` is often used in conjunction with a constraint
541 (in the :cfg-field:`constraints` field) forcing the usage of a specific,
542 newer version of a package.
544 The command line variant of this field is e.g. ``--allow-newer=bar``. A
545 bare ``--allow-newer`` is equivalent to ``--allow-newer=all``.
547 .. cfg-field:: allow-older: none, all, list of scoped package names (space or comma separated)
548 --allow-older, --allow-older=[none,all,[scope:][^]pkg]
549 :synopsis: Lift dependency lower bound constraints.
554 Like :cfg-field:`allow-newer`, but applied to lower bounds rather than
557 The command line variant of this field is ``--allow-older=all``. A
558 bare ``--allow-older`` is equivalent to ``--allow-older=all``.
561 .. cfg-field:: index-state: HEAD, unix-timestamp, ISO8601 UTC timestamp.
562 :synopsis: Use source package index state as it existed at a previous time.
567 This allows to change the source package index state the solver uses
568 to compute install-plans. This is particularly useful in
569 combination with freeze-files in order to also freeze the state the
570 package index was in at the time the install-plan was frozen.
574 -- UNIX timestamp format example
575 index-state: @1474739268
577 -- ISO8601 UTC timestamp format example
578 -- This format is used by 'cabal configure'
579 -- for storing `--index-state` values.
580 index-state: 2016-09-24T17:47:48Z
582 -- Specify different index-states per package repository
583 -- Supported since 3.4
585 , hackage.haskell.org 2020-05-06T22:33:27Z
586 , head.hackage 2020-04-29T04:11:05Z
588 .. cfg-field:: active-repositories: reponame1, reponame2
590 :synopsis: Specify active package repositories
595 Specifies which of the package repositories defined in the configuration
596 should be active. It's also useful for specifying the order and the way
597 active repositories are merged.
599 When searching for a certain version of a certain package name, the list of
600 active repositories is searched last-to-first.
602 For example, suppose hackage.haskell.org has versions 1.0 and 2.0 of
603 package X, and my-repository has version 2.0 of a similarly named package.
604 Then, with the following configuration:
608 -- Force my-repository to be the first repository considered
610 , hackage.haskell.org
613 version 2.0 of X will come from my-repository, and version 1.0 will come
614 from hackage.haskell.org.
616 If we want to make a repository the sole provider of certain packages, we
617 can put it last in the active repositories list, and add the :override
620 For example, if we modify the previous example like this:
625 , hackage.haskell.org
626 , my-repository:override
628 then version 1.0 of package X won't be found in any case, because X is
629 present in my-repository only in version 2.0, and the :override forbids
630 searching for other versions of X further up the list.
632 :override has no effect for package names that aren't present in the
633 overriding repository.
635 The special repository reference :rest stands for "all the other repositories"
636 and can be useful to avoid lengthy lists of repository names:
640 -- Force my-repository to be the first repository considered
641 active-repositories: :rest, my-repository
643 The special repository reference :none disables all repositories, effectively
644 putting cabal in "offline" mode:
648 active-repositories: :none
651 .. cfg-field:: reject-unconstrained-dependencies: all, none
652 --reject-unconstrained-dependencies=[all|none]
653 :synopsis: Restrict the solver to packages that have constraints on them.
658 By default, the dependency solver can include any package that it's
659 aware of in a build plan. If you wish to restrict the build plan to
660 a closed set of packages (e.g., from a freeze file), use this flag.
662 When set to `all`, all non-local packages that aren't goals must be
663 explicitly constrained. When set to `none`, the solver will
664 consider all packages.
667 Package configuration options
668 -----------------------------
670 Package options affect the building of specific packages. There are three
671 ways a package option can be specified:
673 - They can be specified at the top-level, in which case they apply only
674 to **local package**, or
676 - They can be specified inside a ``package`` stanza, in which case they
677 apply to the build of the package, whether or not it is local or
680 - They can be specified inside an ``package *`` stanza, in which case they
681 apply to all packages, local ones from the project and also external
685 For example, the following options specify that :cfg-field:`optimization`
686 should be turned off for all local packages, and that ``bytestring`` (possibly
687 an external dependency) should be built with ``-fno-state-hack``::
692 ghc-options: -fno-state-hack
694 ``ghc-options`` is not specifically described in this documentation, but is one
695 of many fields for configuring programs. They take the form
696 ``progname-options`` and ``progname-location``, and can be set for all local
697 packages in a ``program-options`` stanza or under a package stanza.
699 On the command line, these options are applied to all local packages.
700 There is no per-package command line interface.
702 Some flags were added by more recent versions of the Cabal library. This
703 means that they are NOT supported by packages which use Custom setup
704 scripts that require a version of the Cabal library older than when the
707 .. cfg-field:: flags: list of +flagname or -flagname (space separated)
708 --flags="+foo -bar", -ffoo, -f-bar
709 :synopsis: Enable or disable package flags.
711 Force all flags specified as ``+flagname`` to be true, and all flags
712 specified as ``-flagname`` to be false. For example, to enable the
713 flag ``foo`` and disable ``bar``, set:
719 Exactly one of + or - is required before each flag.
721 Flags are *per-package*, so it doesn't make much sense to specify
722 flags at the top-level, unless you happen to know that *all* of your
723 local packages support the same named flags. If a flag is not
724 supported by a package, it is ignored.
726 See also the solver configuration field :cfg-field:`constraints`.
728 The command line variant of this flag is ``--flags``. There is also
729 a shortened form ``-ffoo -f-bar``.
731 A common mistake is to say ``cabal build -fhans``, where
732 ``hans`` is a flag for a transitive dependency that is not in the
733 local package; in this case, the flag will be silently ignored. If
734 ``haskell-tor`` is the package you want this flag to apply to, try
735 ``--constraint="haskell-tor +hans"`` instead.
737 .. cfg-field:: with-compiler: executable
738 --with-compiler=executable
739 :synopsis: Path to compiler executable.
741 Specify the path to a particular compiler to be used. If not an
742 absolute path, it will be resolved according to the ``PATH``
743 environment. The type of the compiler (GHC, GHCJS, etc) must be
744 consistent with the setting of the :cfg-field:`compiler` field.
746 The most common use of this option is to specify a different version
747 of your compiler to be used; e.g., if you have ``ghc-7.8`` in your
748 path, you can specify ``with-compiler: ghc-7.8`` to use it.
750 This flag also sets the default value of :cfg-field:`with-hc-pkg`, using
751 the heuristic that it is named ``ghc-pkg-7.8`` (if your executable name
752 is suffixed with a version number), or is the executable named
753 ``ghc-pkg`` in the same directory as the ``ghc`` directory. If this
754 heuristic does not work, set :cfg-field:`with-hc-pkg` explicitly.
756 For inplace packages, ``cabal build`` maintains a separate build
757 directory for each version of GHC, so you can maintain multiple
758 build trees for different versions of GHC without clobbering each
761 It's not possible to set :cfg-field:`with-compiler` on a
764 The command line variant of this flag is
765 ``--with-compiler=ghc-7.8``; there is also a short version
768 .. cfg-field:: with-hc-pkg: executable
769 --with-hc-pkg=executable
770 :synopsis: Specifies package tool.
772 Specify the path to the package tool, e.g., ``ghc-pkg``. This
773 package tool must be compatible with the compiler specified by
774 :cfg-field:`with-compiler` (generally speaking, it should be precisely
775 the tool that was distributed with the compiler). If this option is
776 omitted, the default value is determined from :cfg-field:`with-compiler`.
778 The command line variant of this flag is
779 ``--with-hc-pkg=ghc-pkg-7.8``.
781 .. cfg-field:: optimization: nat
782 --enable-optimization
783 --disable-optimization
784 :synopsis: Build with optimization.
788 Build with optimization. This is appropriate for production use,
789 taking more time to build faster libraries and programs.
791 The optional *nat* value is the optimisation level. Some compilers
792 support multiple optimisation levels. The range is 0 to 2. Level 0
793 disables optimization, level 1 is the default. Level 2 is higher
794 optimisation if the compiler supports it. Level 2 is likely to lead
795 to longer compile times and bigger generated code. If you are not
796 planning to run code, turning off optimization will lead to better
797 build times and less code to be rebuilt when a module changes.
799 When optimizations are enabled, Cabal passes ``-O2`` to the C compiler.
801 We also accept ``True`` (equivalent to 1) and ``False`` (equivalent
804 Note that as of GHC 8.0, GHC does not recompile when optimization
805 levels change (see :ghc-ticket:`10923`), so if
806 you change the optimization level for a local package you may need
807 to blow away your old build products in order to rebuild with the
808 new optimization level.
810 The command line variant of this flag is ``-O2`` (with ``-O1``
811 equivalent to ``-O``). There are also long-form variants
812 ``--enable-optimization`` and ``--disable-optimization``.
814 .. cfg-field:: configure-options: args (space separated)
815 --configure-option=arg
816 :synopsis: Options to pass to configure script.
818 A list of extra arguments to pass to the external ``./configure``
819 script, if one is used. This is only useful for packages which have
820 the ``Configure`` build type. See also the section on
821 :ref:`system-dependent parameters`.
823 The command line variant of this flag is ``--configure-option=arg``,
824 which can be specified multiple times to pass multiple options.
826 .. cfg-field:: compiler: ghc, ghcjs, jhc, lhc, uhc or haskell-suite
828 :synopsis: Compiler to build with.
832 Specify the compiler toolchain to be used. This is independent of
833 ``with-compiler``, because the choice of toolchain affects Cabal's
836 The command line variant of this flag is ``--compiler=ghc``.
838 It's not possible to set :cfg-field:`compiler` on a
841 .. cfg-field:: tests: boolean
844 :synopsis: Build tests.
848 Force test suites to be enabled. For most users this should not be
849 needed, as we always attempt to solve for test suite dependencies,
850 even when this value is ``False``; furthermore, test suites are
851 automatically enabled if they are requested as a built target.
853 The command line variant of this flag is ``--enable-tests`` and
856 .. cfg-field:: benchmarks: boolean
859 :synopsis: Build benchmarks.
863 Force benchmarks to be enabled. For most users this should not be
864 needed, as we always attempt to solve for benchmark dependencies,
865 even when this value is ``False``; furthermore, benchmarks are
866 automatically enabled if they are requested as a built target.
868 The command line variant of this flag is ``--enable-benchmarks`` and
869 ``--disable-benchmarks``.
871 .. cfg-field:: extra-prog-path: paths (newline or comma separated)
872 --extra-prog-path=PATH
873 :synopsis: Add directories to program search path.
876 A list of directories to search for extra required programs. Most
877 users should not need this, as programs like ``happy`` and ``alex``
878 will automatically be installed and added to the path. This can be
879 useful if a ``Custom`` setup script relies on an exotic extra
882 The command line variant of this flag is ``--extra-prog-path=PATH``,
883 which can be specified multiple times.
885 .. cfg-field:: run-tests: boolean
887 :synopsis: Run package test suite upon installation.
891 Run the package test suite upon installation. This is useful for
892 saying "When this package is installed, check that the test suite
893 passes, terminating the rest of the build if it is broken."
897 One deficiency: the :cfg-field:`run-tests` setting of a package is NOT
898 recorded as part of the hash, so if you install something without
899 :cfg-field:`run-tests` and then turn on ``run-tests``, we won't
900 subsequently test the package. If this is causing you problems, give
903 The command line variant of this flag is ``--run-tests``.
908 .. cfg-field:: debug-info: integer
909 --enable-debug-info=<n>
911 :synopsis: Build with debug info enabled.
916 If the compiler (e.g., GHC 7.10 and later) supports outputing OS
917 native debug info (e.g., DWARF), setting ``debug-info: True`` will
918 instruct it to do so. See the GHC wiki page on :ghc-wiki:`DWARF`
919 for more information about this feature.
921 (This field also accepts numeric syntax, but until GHC 8.2 this didn't
924 The command line variant of this flag is ``--enable-debug-info`` and
925 ``--disable-debug-info``.
927 .. cfg-field:: split-sections: boolean
928 --enable-split-sections
929 --disable-split-sections
930 :synopsis: Use GHC's split sections feature.
935 Use the GHC ``-split-sections`` feature when building the library. This
936 reduces the final size of the executables that use the library by
937 allowing them to link with only the bits that they use rather than
938 the entire library. The downside is that building the library takes
939 longer and uses a bit more memory.
941 This feature is supported by GHC 8.0 and later.
943 The command line variant of this flag is ``--enable-split-sections`` and
944 ``--disable-split-sections``.
946 .. cfg-field:: split-objs: boolean
949 :synopsis: Use GHC's split objects feature.
953 Use the GHC ``-split-objs`` feature when building the library. This
954 reduces the final size of the executables that use the library by
955 allowing them to link with only the bits that they use rather than
956 the entire library. The downside is that building the library takes
957 longer and uses considerably more memory.
959 It is generally recommend that you use ``split-sections`` instead
960 of ``split-objs`` where possible.
962 The command line variant of this flag is ``--enable-split-objs`` and
963 ``--disable-split-objs``.
965 .. cfg-field:: executable-stripping: boolean
966 --enable-executable-stripping
967 --disable-executable-stripping
968 :synopsis: Strip installed programs.
972 When installing binary executable programs, run the ``strip``
973 program on the binary. This can considerably reduce the size of the
974 executable binary file. It does this by removing debugging
975 information and symbols.
977 Not all Haskell implementations generate native binaries. For such
978 implementations this option has no effect.
980 If ``debug-info`` is set explicitly then ``executable-stripping`` is set
981 to ``False`` as otherwise all the debug symbols will be stripped.
983 The command line variant of this flag is
984 ``--enable-executable-stripping`` and
985 ``--disable-executable-stripping``.
987 .. cfg-field:: library-stripping: boolean
988 --enable-library-stripping
989 --disable-library-stripping
990 :synopsis: Strip installed libraries.
993 When installing binary libraries, run the ``strip`` program on the
994 binary, saving space on the file system. See also
995 ``executable-stripping``.
997 If ``debug-info`` is set explicitly then ``library-stripping`` is set
998 to ``False`` as otherwise all the debug symbols will be stripped.
1000 The command line variant of this flag is
1001 ``--enable-library-stripping`` and ``--disable-library-stripping``.
1006 .. cfg-field:: program-prefix: prefix
1007 --program-prefix=prefix
1008 :synopsis: Prepend prefix to program names.
1010 :strike:`Prepend *prefix* to installed program names.` (Currently
1011 implemented in a silly and not useful way. If you need this to work
1014 *prefix* may contain the following path variables: ``$pkgid``,
1015 ``$pkg``, ``$version``, ``$compiler``, ``$os``, ``$arch``, ``$abi``,
1018 The command line variant of this flag is ``--program-prefix=foo-``.
1020 .. cfg-field:: program-suffix: suffix
1021 --program-suffix=suffix
1022 :synopsis: Append refix to program names.
1024 :strike:`Append *suffix* to installed program names.` (Currently
1025 implemented in a silly and not useful way. If you need this to work
1028 The most obvious use for this is to append the program's version
1029 number to make it possible to install several versions of a program
1030 at once: ``program-suffix: $version``.
1032 *suffix* may contain the following path variables: ``$pkgid``,
1033 ``$pkg``, ``$version``, ``$compiler``, ``$os``, ``$arch``, ``$abi``,
1036 The command line variant of this flag is
1037 ``--program-suffix='$version'``.
1039 Dynamic linking options
1040 ^^^^^^^^^^^^^^^^^^^^^^^
1042 .. cfg-field:: shared: boolean
1045 :synopsis: Build shared library.
1049 Build shared library. This implies a separate compiler run to
1050 generate position independent code as required on most platforms.
1052 The command line variant of this flag is ``--enable-shared`` and
1053 ``--disable-shared``.
1055 .. cfg-field:: executable-dynamic: boolean
1056 --enable-executable-dynamic
1057 --disable-executable-dynamic
1058 :synopsis: Link executables dynamically.
1062 Link executables dynamically. The executable's library dependencies
1063 should be built as shared objects. This implies ``shared: True``
1064 unless ``shared: False`` is explicitly specified.
1066 The command line variant of this flag is
1067 ``--enable-executable-dynamic`` and
1068 ``--disable-executable-dynamic``.
1070 .. cfg-field:: library-for-ghci: boolean
1071 --enable-library-for-ghci
1072 --disable-library-for-ghci
1073 :synopsis: Build libraries suitable for use with GHCi.
1077 Build libraries suitable for use with GHCi. This involves an extra
1078 linking step after the build.
1080 Not all platforms support GHCi and indeed on some platforms, trying
1081 to build GHCi libs fails. In such cases, consider setting
1082 ``library-for-ghci: False``.
1084 The command line variant of this flag is
1085 ``--enable-library-for-ghci`` and ``--disable-library-for-ghci``.
1087 .. cfg-field:: relocatable:
1089 :synopsis: Build relocatable package.
1094 :strike:`Build a package which is relocatable.` (TODO: It is not
1095 clear what this actually does, or if it works at all.)
1097 The command line variant of this flag is ``--relocatable``.
1099 Static linking options
1100 ^^^^^^^^^^^^^^^^^^^^^^
1102 .. cfg-field:: static: boolean
1105 :synopsis: Build static library.
1110 Roll this and all dependent libraries into a combined ``.a`` archive.
1111 This uses GHCs ``-staticlib`` flag, which is available for iOS and with
1112 GHC 8.4 and later for other platforms as well.
1114 .. cfg-field:: executable-static: boolean
1115 --enable-executable-static
1116 --disable-executable-static
1117 :synopsis: Build fully static executables.
1122 Build fully static executables.
1123 This links all dependent libraries into executables statically,
1125 This passes ``-static`` and ``-optl=-static`` to GHC.
1127 Foreign function interface options
1128 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1130 .. cfg-field:: extra-include-dirs: directories (comma or newline separated list)
1131 --extra-include-dirs=DIR
1132 :synopsis: Adds C header search path.
1134 An extra directory to search for C header files. You can use this
1135 flag multiple times to get a list of directories.
1137 You might need to use this flag if you have standard system header
1138 files in a non-standard location that is not mentioned in the
1139 package's ``.cabal`` file. Using this option has the same affect as
1140 appending the directory *dir* to the :pkg-field:`include-dirs` field in each
1141 library and executable in the package's ``.cabal`` file. The
1142 advantage of course is that you do not have to modify the package at
1143 all. These extra directories will be used while building the package
1144 and for libraries it is also saved in the package registration
1145 information and used when compiling modules that use the library.
1147 The command line variant of this flag is
1148 ``--extra-include-dirs=DIR``, which can be specified multiple times.
1150 .. cfg-field:: extra-lib-dirs: directories (comma or newline separated list)
1151 --extra-lib-dirs=DIR
1152 :synopsis: Adds library search directory.
1154 An extra directory to search for system libraries files.
1156 The command line variant of this flag is ``--extra-lib-dirs=DIR``,
1157 which can be specified multiple times.
1159 .. cfg-field:: extra-framework-dirs: directories (comma or newline separated list)
1160 --extra-framework-dirs=DIR
1161 :synopsis: Adds framework search directory (OS X only).
1163 An extra directory to search for frameworks (OS X only).
1165 You might need to use this flag if you have standard system
1166 libraries in a non-standard location that is not mentioned in the
1167 package's ``.cabal`` file. Using this option has the same affect as
1168 appending the directory *dir* to the :cfg-field:`extra-lib-dirs` field in
1169 each library and executable in the package's ``.cabal`` file. The
1170 advantage of course is that you do not have to modify the package at
1171 all. These extra directories will be used while building the package
1172 and for libraries it is also saved in the package registration
1173 information and used when compiling modules that use the library.
1175 The command line variant of this flag is
1176 ``--extra-framework-dirs=DIR``, which can be specified multiple
1182 .. cfg-field:: profiling: boolean
1185 :synopsis: Enable profiling builds.
1190 Build libraries and executables with profiling enabled (for
1191 compilers that support profiling as a separate mode). It is only
1192 necessary to specify :cfg-field:`profiling` for the specific package you
1193 want to profile; ``cabal build`` will ensure that all of its
1194 transitive dependencies are built with profiling enabled.
1196 To enable profiling for only libraries or executables, see
1197 :cfg-field:`library-profiling` and :cfg-field:`executable-profiling`.
1199 For useful profiling, it can be important to control precisely what
1200 cost centers are allocated; see :cfg-field:`profiling-detail`.
1202 The command line variant of this flag is ``--enable-profiling`` and
1203 ``--disable-profiling``.
1205 .. cfg-field:: profiling-detail: level
1206 --profiling-detail=level
1207 :synopsis: Profiling detail level.
1210 Some compilers that support profiling, notably GHC, can allocate
1211 costs to different parts of the program and there are different
1212 levels of granularity or detail with which this can be done. In
1213 particular for GHC this concept is called "cost centers", and GHC
1214 can automatically add cost centers, and can do so in different ways.
1216 This flag covers both libraries and executables, but can be
1217 overridden by the ``library-profiling-detail`` field.
1219 Currently this setting is ignored for compilers other than GHC. The
1220 levels that cabal currently supports are:
1223 For GHC this uses ``exported-functions`` for libraries and
1224 ``toplevel-functions`` for executables.
1226 No costs will be assigned to any code within this component.
1228 Costs will be assigned at the granularity of all top level
1229 functions exported from each module. In GHC, this
1230 is for non-inline functions. Corresponds to ``-fprof-auto-exported``.
1232 Costs will be assigned at the granularity of all top level
1233 functions in each module, whether they are exported from the
1234 module or not. In GHC specifically, this is for non-inline
1235 functions. Corresponds to ``-fprof-auto-top``.
1237 Costs will be assigned at the granularity of all functions in
1238 each module, whether top level or local. In GHC specifically,
1239 this is for non-inline toplevel or where-bound functions or
1240 values. Corresponds to ``-fprof-auto``.
1242 The command line variant of this flag is
1243 ``--profiling-detail=none``.
1245 .. cfg-field:: library-profiling-detail: level
1246 --library-profiling-detail=level
1247 :synopsis: Libraries profiling detail level.
1250 Like :cfg-field:`profiling-detail`, but applied only to libraries
1252 The command line variant of this flag is
1253 ``--library-profiling-detail=none``.
1255 .. cfg-field:: library-vanilla: boolean
1256 --enable-library-vanilla
1257 --disable-library-vanilla
1258 :synopsis: Build libraries without profiling.
1262 Build ordinary libraries (as opposed to profiling libraries).
1263 Mostly, you can set this to False to avoid building ordinary
1264 libraries when you are profiling.
1266 The command line variant of this flag is
1267 ``--enable-library-vanilla`` and ``--disable-library-vanilla``.
1269 .. cfg-field:: library-profiling: boolean
1270 --enable-library-profiling
1271 --disable-library-profiling
1272 :synopsis: Build libraries with profiling enabled.
1277 Build libraries with profiling enabled. You probably want
1278 to use :cfg-field:`profiling` instead.
1280 The command line variant of this flag is
1281 ``--enable-library-profiling`` and ``--disable-library-profiling``.
1283 .. cfg-field:: executable-profiling: boolean
1284 --enable-executable-profiling
1285 --disable-executable-profiling
1286 :synopsis: Build executables with profiling enabled.
1291 Build executables with profiling enabled. You probably want
1292 to use :cfg-field:`profiling` instead.
1294 The command line variant of this flag is
1295 ``--enable-executable-profiling`` and
1296 ``--disable-executable-profiling``.
1301 .. cfg-field:: coverage: boolean
1304 :synopsis: Build with coverage enabled.
1309 Build libraries and executables (including test suites) with Haskell
1310 Program Coverage enabled. Running the test suites will automatically
1311 generate coverage reports with HPC.
1313 The command line variant of this flag is ``--enable-coverage`` and
1314 ``--disable-coverage``.
1316 .. cfg-field:: library-coverage: boolean
1317 --enable-library-coverage
1318 --disable-library-coverage
1324 Deprecated, use :cfg-field:`coverage`.
1326 The command line variant of this flag is
1327 ``--enable-library-coverage`` and ``--disable-library-coverage``.
1332 .. cfg-field:: documentation: boolean
1333 --enable-documentation
1334 --disable-documentation
1335 :synopsis: Enable building of documentation.
1339 Enables building of Haddock documentation.
1340 Implied when calling ``cabal haddock``.
1342 The command line variant of this flag is ``--enable-documentation``
1343 and ``--disable-documentation``.
1345 ``documentation: true`` does not imply
1346 :cfg-field:`haddock-all`,
1347 :cfg-field:`haddock-benchmarks`,
1348 :cfg-field:`haddock-executables`,
1349 :cfg-field:`haddock-internal` or
1350 :cfg-field:`haddock-tests`.
1351 These need to be enabled separately if desired.
1353 .. cfg-field:: doc-index-file: templated path
1354 --doc-index-file=TEMPLATE
1355 :synopsis: Path to haddock templates.
1357 A central index of Haddock API documentation (template cannot use
1358 ``$pkgid``), which should be updated as documentation is built.
1360 The following commands are equivalent to ones that would be passed when
1361 running ``setup haddock``.
1363 .. cfg-field:: haddock-hoogle: boolean
1365 :synopsis: Generate Hoogle file.
1369 Generate a text file which can be converted by Hoogle_
1370 into a database for searching.
1371 This is equivalent to running ``haddock`` with the ``--hoogle`` flag.
1373 .. cfg-field:: haddock-html: boolean
1375 :synopsis: Build HTML documentation.
1379 Build HTML documentation.
1381 .. cfg-field:: haddock-quickjump: boolean
1383 :synopsis: Generate Quickjump file.
1387 Generate an index for interactive documentation navigation.
1388 This is equivalent to running ``haddock`` with the ``--quickjump`` flag.
1390 .. cfg-field:: haddock-html-location: templated path
1391 --haddock-html-location=TEMPLATE
1392 :synopsis: Haddock HTML templates location.
1394 Specify a template for the location of HTML documentation for
1395 prerequisite packages. The substitutions are applied to the template
1396 to obtain a location for each package, which will be used by
1397 hyperlinks in the generated documentation. For example, the
1398 following command generates links pointing at Hackage pages:
1402 html-location: http://hackage.haskell.org/packages/archive/$pkg/latest/doc/html
1404 If passed on the command line,
1405 the argument may be quoted to prevent substitution by the shell.
1409 --html-location='http://hackage.haskell.org/packages/archive/$pkg/latest/doc/html'
1411 If this option is omitted, the location for each package is obtained
1412 using the package tool (e.g. ``ghc-pkg``).
1414 .. cfg-field:: haddock-executables: boolean
1415 --haddock-executables
1416 :synopsis: Generate documentation for executables.
1420 Run haddock on all executable programs.
1422 .. cfg-field:: haddock-tests: boolean
1424 :synopsis: Generate documentation for tests.
1428 Run haddock on all test suites.
1430 .. cfg-field:: haddock-benchmarks: boolean
1431 --haddock-benchmarks
1432 :synopsis: Generate documentation for benchmarks.
1436 Run haddock on all benchmarks.
1438 .. cfg-field:: haddock-internal: boolean
1440 :synopsis: Generate documentation for internal modules
1444 Build haddock documentation which includes unexposed modules and
1447 .. cfg-field:: haddock-all: boolean
1449 :synopsis: Generate documentation for everything
1453 Run haddock on all components.
1455 .. cfg-field:: haddock-css: path
1457 :synopsis: Location of Haddock CSS file.
1459 The CSS file that should be used to style the generated
1460 documentation (overriding haddock's default).
1462 .. cfg-field:: haddock-hyperlink-source: boolean
1463 --haddock-hyperlink-source
1464 :synopsis: Generate hyperlinked source code for documentation
1468 Generated hyperlinked source code using `HsColour`_, and have
1469 Haddock documentation link to it.
1470 This is equivalent to running ``haddock`` with the ``--hyperlinked-source`` flag.
1472 .. cfg-field:: haddock-hscolour-css: path
1473 --haddock-hscolour-css=PATH
1474 :synopsis: Location of CSS file for HsColour
1476 The CSS file that should be used to style the generated hyperlinked
1477 source code (from `HsColour`_).
1479 .. cfg-field:: haddock-contents-location: URL
1480 --haddock-contents-location=URL
1481 :synopsis: URL for contents page.
1483 A baked-in URL to be used as the location for the contents page.
1485 .. cfg-field:: haddock-keep-temp-files: boolean
1486 :synopsis: Keep temporary Haddock files.
1488 Keep temporary files.
1490 There is no command line variant of this flag.
1492 .. cfg-field:: open: boolean
1494 :synopsis: Open generated documentation in-browser.
1496 When generating HTML documentation, attempt to open it in a browser
1497 when complete. This will use ``xdg-open`` on Linux and BSD systems,
1498 ``open`` on macOS, and ``start`` on Windows.
1500 Advanced global configuration options
1501 -------------------------------------
1503 .. cfg-field:: write-ghc-environment-files: always, never, or ghc8.4.4+
1504 --write-ghc-environment-files=policy
1505 :synopsis: Whether a ``.ghc.environment`` should be created after a successful build.
1509 Whether a `GHC package environment file <https://downloads.haskell.org/~ghc/master/users-guide/packages.html#package-environments>`_
1510 should be created after a successful build.
1512 Since Cabal 3.0, defaults to ``never``. Before that, defaulted to
1513 creating them only when compiling with GHC 8.4.4 and older (GHC
1514 8.4.4 `is the first version
1515 <https://gitlab.haskell.org/ghc/ghc/-/issues/13753>`_ that supports
1516 the ``-package-env -`` option that allows ignoring the package
1519 .. cfg-field:: build-info: True, False
1521 --disable-build-info
1522 :synopsis: Whether build information for each individual component should be
1523 written in a machine readable format.
1527 Enable generation of build information for Cabal components. Contains very
1528 detailed information on how to build an individual component, such as
1529 compiler version, modules of a component and how to compile the component.
1531 The output format is in json, and the exact location can be discovered from
1532 ``plan.json``, where it is identified by ``build-info`` within the items in
1533 the ``install-plan``.
1534 Note, that this field in ``plan.json`` can be ``null``, if and only if
1535 ``build-type: Custom`` is set, and the ``Cabal`` version is too
1536 old (i.e. ``< 3.7``).
1537 If the field is missing entirely, the component is not a local one, thus,
1538 no ``build-info`` exists for that particular component within the
1542 The format and fields of the generated build information is currently experimental,
1543 in the future we might add or remove fields, depending on the needs of other tooling.
1546 .. cfg-field:: http-transport: curl, wget, powershell, or plain-http
1547 --http-transport=transport
1548 :synopsis: Transport to use with http(s) requests.
1552 Set a transport to be used when making http(s) requests.
1554 The command line variant of this field is ``--http-transport=curl``.
1556 .. cfg-field:: ignore-expiry: boolean
1558 :synopsis: Ignore Hackage expiration dates.
1562 If ``True``, we will ignore expiry dates on metadata from Hackage.
1564 In general, you should not set this to ``True`` as it will leave you
1565 vulnerable to stale cache attacks. However, it may be temporarily
1566 useful if the main Hackage server is down, and we need to rely on
1567 mirrors which have not been updated for longer than the expiry
1568 period on the timestamp.
1570 The command line variant of this field is ``--ignore-expiry``.
1572 .. cfg-field:: remote-repo-cache: directory
1573 --remote-repo-cache=DIR
1574 :synopsis: Location of packages cache.
1576 :default: ``~/.cabal/packages``
1578 :strike:`The location where packages downloaded from remote
1579 repositories will be cached.` Not implemented yet.
1581 The command line variant of this flag is
1582 ``--remote-repo-cache=DIR``.
1584 .. cfg-field:: logs-dir: directory
1586 :synopsis: Directory to store build logs.
1588 :default: ``~/.cabal/logs``
1590 :strike:`The location where build logs for packages are stored.`
1591 Not implemented yet.
1593 The command line variant of this flag is ``--logs-dir=DIR``.
1595 .. cfg-field:: build-summary: template filepath
1596 --build-summary=TEMPLATE
1597 :synopsis: Build summaries location.
1599 :default: ``~/.cabal/logs/build.log``
1601 :strike:`The file to save build summaries.` Not implemented yet.
1603 Valid variables which can be used in the path are ``$pkgid``,
1604 ``$compiler``, ``$os`` and ``$arch``.
1606 The command line variant of this flag is
1607 ``--build-summary=TEMPLATE``.
1609 Undocumented fields: ``root-cmd``, ``symlink-bindir``, ``build-log``,
1610 ``remote-build-reporting``, ``report-planned-failure``, ``offline``.
1612 Advanced solver options
1613 ^^^^^^^^^^^^^^^^^^^^^^^
1615 Most users generally won't need these.
1617 .. cfg-field:: solver: modular
1619 :synopsis: Which solver to use.
1621 This field is reserved to allow the specification of alternative
1622 dependency solvers. At the moment, the only accepted option is
1625 The command line variant of this field is ``--solver=modular``.
1627 .. cfg-field:: max-backjumps: nat
1629 :synopsis: Maximum number of solver backjumps.
1633 Maximum number of backjumps (backtracking multiple steps) allowed
1634 while solving. Set -1 to allow unlimited backtracking, and 0 to
1635 disable backtracking completely.
1637 The command line variant of this field is ``--max-backjumps=4000``.
1639 .. cfg-field:: reorder-goals: boolean
1642 :synopsis: Allow solver to reorder goals.
1646 When enabled, the solver will reorder goals according to certain
1647 heuristics. Slows things down on average, but may make backtracking
1648 faster for some packages. It's unlikely to help for small projects,
1649 but for big install plans it may help you find a plan when otherwise
1650 this is not possible. See :issue:`1780` for more commentary.
1652 The command line variant of this field is ``--(no-)reorder-goals``.
1654 .. cfg-field:: count-conflicts: boolean
1656 --no-count-conflicts
1657 :synopsis: Solver prefers versions with less conflicts.
1661 Try to speed up solving by preferring goals that are involved in a
1664 The command line variant of this field is
1665 ``--(no-)count-conflicts``.
1667 .. cfg-field:: fine-grained-conflicts: boolean
1668 --fine-grained-conflicts
1669 --no-fine-grained-conflicts
1670 :synopsis: Skip a version of a package if it does not resolve any conflicts
1671 encountered in the last version (solver optimization).
1675 When enabled, the solver will skip a version of a package if it does not
1676 resolve any of the conflicts encountered in the last version of that
1677 package. For example, if ``foo-1.2`` depended on ``bar``, and the solver
1678 couldn't find consistent versions for ``bar``'s dependencies, then the
1679 solver would skip ``foo-1.1`` if it also depended on ``bar``.
1681 The command line variant of this field is
1682 ``--(no-)fine-grained-conflicts``.
1684 .. cfg-field:: minimize-conflict-set: boolean
1685 --minimize-conflict-set
1686 --no-minimize-conflict-set
1687 :synopsis: Try to improve the solver error message when there is no
1692 When there is no solution, try to improve the solver error message
1693 by finding a minimal conflict set. This option may increase run
1694 time significantly, so it is off by default.
1696 The command line variant of this field is
1697 ``--(no-)minimize-conflict-set``.
1699 .. cfg-field:: strong-flags: boolean
1702 :synopsis: Do not defer flag choices when solving.
1706 Do not defer flag choices. (TODO: Better documentation.)
1708 The command line variant of this field is ``--(no-)strong-flags``.
1710 .. cfg-field:: allow-boot-library-installs: boolean
1711 --allow-boot-library-installs
1712 --no-allow-boot-library-installs
1713 :synopsis: Allow cabal to install or upgrade any package.
1717 By default, the dependency solver doesn't allow ``base``,
1718 ``ghc-prim``, ``integer-simple``, ``integer-gmp``, and
1719 ``template-haskell`` to be installed or upgraded. This flag
1720 removes the restriction.
1722 The command line variant of this field is
1723 ``--(no-)allow-boot-library-installs``.
1725 .. cfg-field:: cabal-lib-version: version
1726 --cabal-lib-version=version
1727 :synopsis: Version of Cabal library used to build package.
1729 This field selects the version of the Cabal library which should be
1730 used to build packages. This option is intended primarily for
1731 internal development use (e.g., forcing a package to build with a
1732 newer version of Cabal, to test a new version of Cabal.) (TODO:
1733 Specify its semantics more clearly.)
1735 The command line variant of this field is
1736 ``--cabal-lib-version=1.24.0.1``.
1738 .. cfg-field:: prefer-oldest: boolean
1741 :synopsis: Prefer the oldest versions of packages available.
1746 By default, when solver has a choice of multiple versions of the same
1747 package, it will first try to derive a build plan with the latest
1748 version. This flag switches the behaviour, making the solver
1749 to prefer the oldest packages available.
1751 The primary use case is to help users in establishing lower bounds
1752 of upstream dependencies.
1754 The command line variant of this field is ``--(no-)prefer-oldest``.
1756 .. include:: references.inc