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. ``~/.cabal/config`` (the user-wide global configuration)
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 Specifying the local packages
67 -----------------------------
69 The following top-level options specify what the local packages of a
72 .. cfg-field:: packages: package location list (space or comma separated)
73 :synopsis: Project packages.
75 :default: ``./*.cabal``
77 Specifies the list of package locations which contain the local
78 packages to be built by this project. Package locations can take the
81 1. They can specify a Cabal file, or a directory containing a Cabal
82 file, e.g., ``packages: Cabal cabal-install/cabal-install.cabal``.
84 2. They can specify glob-style wildcards, which must match one or
85 more (a) directories containing a (single) Cabal file, (b) Cabal
86 files (extension ``.cabal``), or (c) tarballs which contain Cabal
87 packages (extension ``.tar.gz``).
88 For example, to match all Cabal files in all
89 subdirectories, as well as the Cabal projects in the parent
90 directories ``foo`` and ``bar``, use
91 ``packages: */*.cabal ../{foo,bar}/``
93 3. They can specify an ``http``, ``https`` or ``file``
94 URL, representing the path to a remote tarball to be downloaded
97 There is no command line variant of this field; see :issue:`3585`.
98 Note that the default value is only included if there is no
99 ``cabal.project`` file. The field is appendable which means there would be
100 no way to drop the default value if it was included.
102 .. cfg-field:: optional-packages: package location list (space or comma-separated)
103 :synopsis: Optional project packages.
107 Like :cfg-field:`packages`, specifies a list of package locations
108 containing local packages to be built. Unlike :cfg-field:`packages`,
109 if we glob for a package, it is permissible for the glob to match against
110 zero packages. The intended use-case for :cfg-field:`optional-packages`
111 is to make it so that vendored packages can be automatically picked up if
112 they are placed in a subdirectory, but not error if there aren't any.
114 There is no command line variant of this field.
116 .. cfg-field:: extra-packages: package list with version bounds (comma separated)
117 :synopsis: Adds external packages as local
119 :strike:`Specifies a list of external packages from Hackage which
120 should be considered local packages.` (Not implemented)
122 There is no command line variant of this field.
126 All local packages are *vendored*, in the sense that if other packages
127 (including external ones from Hackage) depend on a package with the name
128 of a local package, the local package is preferentially used.
129 For subdirectories to be considered local packages, the following setting
133 optional-packages: ./*/*.cabal
135 ...then any package can be vendored simply by making a checkout in the
136 top-level project directory, as might be seen in this hypothetical
140 foo-helper/ # local package
141 unix/ # vendored external package
143 All of these options support globs. ``cabal build`` has its own glob
146 - Anywhere in a path, as many times as you like, you can specify an
147 asterisk ``*`` wildcard. E.g., ``*/*.cabal`` matches all ``.cabal``
148 files in all immediate subdirectories. Like in glob(7), asterisks do
149 not match hidden files unless there is an explicit period, e.g.,
150 ``.*/foo.cabal`` will match ``.private/foo.cabal`` (but
151 ``*/foo.cabal`` will not).
153 - You can use braces to specify specific directories; e.g.,
154 ``{vendor,pkgs}/*.cabal`` matches all Cabal files in the ``vendor``
155 and ``pkgs`` subdirectories.
157 Formally, the format is described by the following BNF:
160 convert globbing grammar to proper ABNF_ syntax
164 FilePathGlob ::= FilePathRoot FilePathGlobRel
165 FilePathRoot ::= {- empty -} # relative to cabal.project
167 | [a-zA-Z] ":" [/\\] # Windows root
168 | "~" # home directory
169 FilePathGlobRel ::= Glob "/" FilePathGlobRel # Unix directory
170 | Glob "\\" FilePathGlobRel # Windows directory
172 | {- empty -} # trailing slash
174 GlobPiece ::= "*" # wildcard
175 | [^*{},/\\] * # literal string
176 | "\\" [*{},] # escaped reserved character
177 | "{" Glob "," ... "," Glob "}" # union (match any of these)
180 Specifying Packages from Remote Version Control Locations
181 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
183 Starting with Cabal 2.4, there is now a stanza
184 ``source-repository-package`` for specifying packages from an external
187 .. code-block:: cabal
191 source-repository-package
193 location: https://github.com/hvr/HsYAML.git
194 tag: e70cf0c171c9a586b62b3f75d72f1591e4e6aaa1
196 source-repository-package
198 location: https://github.com/well-typed/cborg
199 tag: 3d274c14ca3077c3a081ba7ad57c5182da65c8c1
202 source-repository-package
204 location: https://github.com/haskell/network.git
205 tag: e76fdc753e660dfa615af6c8b6a2ad9ddf6afe70
206 post-checkout-command: autoreconf -i
208 cabal-install 3.4 sdists the ``source-repository-package`` repositories and uses resulting tarballs as project packages.
209 This allows sharing of packages across different projects.
211 .. cfg-field:: type: VCS kind
213 .. cfg-field:: location: VCS location (usually URL)
215 .. cfg-field:: tag: VCS tag
217 .. cfg-field:: subdir: subdirectory list
219 Use one or more subdirectories of the repository.
221 .. cfg-field:: post-checkout-command: command
223 Run command in the checked out repository, prior sdisting.
225 Global configuration options
226 ----------------------------
228 The following top-level configuration options are not specific to any
229 package, and thus apply globally:
232 .. cfg-field:: verbose: nat
234 :synopsis: Build verbosity level.
238 Control the verbosity of ``cabal`` commands, valid values are from 0
241 The command line variant of this field is ``--verbose=2``; a short
242 form ``-v2`` is also supported.
244 .. cfg-field:: jobs: nat or $ncpus
245 --jobs=n, -jn, --jobs=$ncpus
246 :synopsis: Number of builds running in parallel.
250 Run *nat* jobs simultaneously when building. If ``$ncpus`` is
251 specified, run the number of jobs equal to the number of CPUs.
252 Package building is often quite parallel, so turning on parallelism
253 can speed up build times quite a bit!
255 The command line variant of this field is ``--jobs=2``; a short form
256 ``-j2`` is also supported; a bare ``--jobs`` or ``-j`` is equivalent
257 to ``--jobs=$ncpus``.
259 .. cfg-field:: keep-going: boolean
261 :synopsis: Try to continue building on failure.
265 If true, after a build failure, continue to build other unaffected
268 The command line variant of this field is ``--keep-going``.
270 .. option:: --builddir=DIR
272 Specifies the name of the directory where build products for
273 build will be stored; defaults to ``dist-newstyle``. If a
274 relative name is specified, this directory is resolved relative
275 to the root of the project (i.e., where the ``cabal.project``
278 This option cannot be specified via a ``cabal.project`` file.
280 .. _cmdoption-project-file:
281 .. option:: --project-file=FILE
283 Specifies the name of the project file used to specify the
284 rest of the top-level configuration; defaults to ``cabal.project``.
285 This name not only specifies the name of the main project file,
286 but also the auxiliary project files ``cabal.project.freeze``
287 and ``cabal.project.local``; for example, if you specify
288 ``--project-file=my.project``, then the other files that will
289 be probed are ``my.project.freeze`` and ``my.project.local``.
291 If the specified project file is a relative path, we will
292 look for the file relative to the current working directory,
293 and then for the parent directory, until the project file is
294 found or we have hit the top of the user's home directory.
296 This option cannot be specified via a ``cabal.project`` file.
298 .. option:: --ignore-project
300 Ignores the local ``cabal.project`` file and uses the default
301 configuration with the local ``foo.cabal`` file. Note that
302 if this flag is set while the ``--project-file`` flag is also
303 set then this flag will be ignored.
305 .. option:: --store-dir=DIR
307 Specifies the name of the directory of the global package store.
309 .. cfg-field:: package-dbs: package DB stack (comma separated)
310 --package-db=[clear, global, user, PATH]
311 :synopsis: PackageDB stack manipulation
314 There are three package databases involved with most builds:
317 Compiler installation of rts, base, etc.
319 Nix-style local build cache
321 Project-specific build directory
323 By default, the package stack you will have with v2 commands is:
329 So all remote packages required by your project will be
330 registered in the store package db (because it is last).
332 When cabal starts building your local projects, it appends the in-place db
337 -- [global, store, in-place]
339 So your local packages get put in ``dist-newstyle`` instead of the store.
341 This flag manipulates the default prefix: ``[global, store]`` and accepts
342 paths, the special value ``global`` referring to the global package db, and
343 ``clear`` which removes all prior entries. For example,
347 -- [global, store, foo]
351 package-dbs: clear, foo
354 package-dbs: clear, foo, clear, bar, baz
356 The command line variant of this flag is ``--package-db=DB`` which can be
357 specified multiple times.
362 The following settings apply to commands that result in build actions
363 (``build``, ``run``, ``repl``, ``test``...), and control which phases of the
366 .. option:: --dry-run
368 Do not download, build, or install anything, only print what would happen.
370 .. option:: --only-configure
372 Instead of performing a full build just run the configure step.
373 Only accepted by the ``build`` command.
375 .. option:: --only-download
377 Do not build anything, only fetch the packages.
379 .. option:: --only-dependencies
381 Install only the dependencies necessary to build the given packages.
382 Not accepted by the ``repl`` command.
384 Solver configuration options
385 ----------------------------
387 The following settings control the behavior of the dependency solver:
389 .. cfg-field:: constraints: constraints list (comma separated)
390 --constraint="pkg >= 2.0", -c "pkg >= 2.0"
391 :synopsis: Extra dependencies constraints.
393 Add extra constraints to the version bounds, flag settings,
394 and other properties a solver can pick for a
395 package. For example:
399 constraints: bar == 2.1
401 A package can be specified multiple times in ``constraints``, in
402 which case the specified constraints are intersected. This is
403 useful, since the syntax does not allow you to specify multiple
404 constraints at once. For example, to specify both version bounds and
405 flag assignments, you would write:
409 constraints: bar == 2.1,
412 Valid constraints take the same form as for the
413 :option:`runhaskell Setup.hs configure --constraint`
416 .. cfg-field:: preferences: preference (comma separated)
417 --preference="pkg >= 2.0"
418 :synopsis: Preferred dependency versions.
420 Like :cfg-field:`constraints`, but the solver will attempt to satisfy
421 these preferences on a best-effort basis. The resulting install is locally
422 optimal with respect to preferences; specifically, no single package
423 could be replaced with a more preferred version that still satisfies
424 the hard constraints.
426 Operationally, preferences can cause the solver to attempt certain
427 version choices of a package before others, which can improve
428 dependency solver runtime.
430 One way to use :cfg-field:`preferences` is to take a known working set of
431 constraints (e.g., via ``cabal freeze``) and record them as
432 preferences. In this case, the solver will first attempt to use this
433 configuration, and if this violates hard constraints, it will try to
434 find the minimal number of upgrades to satisfy the hard constraints
437 The command line variant of this field is
438 ``--preference="pkg >= 2.0"``; to specify multiple preferences, pass
439 the flag multiple times.
441 .. cfg-field:: allow-newer: none, all or list of scoped package names (space or comma separated)
442 --allow-newer, --allow-newer=[none,all,[scope:][^]pkg]
443 :synopsis: Lift dependencies upper bound constraints.
447 Allow the solver to pick more recent version of some packages than
448 would normally be permitted by the :pkg-field:`build-depends` bounds
449 of packages in the install plan. This option may be useful if the
450 dependency solver cannot otherwise find a valid install plan.
452 For example, to relax ``pkg``\ s :pkg-field:`build-depends` upper bound on
453 ``dep-pkg``, write a scoped package name of the form:
457 allow-newer: pkg:dep-pkg
459 If the scope shall be limited to specific releases of ``pkg``, the
464 allow-newer: pkg-1.2.3:dep-pkg, pkg-1.1.2:dep-pkg
466 can be used to limit the relaxation of dependencies on
467 ``dep-pkg`` by the ``pkg-1.2.3`` and ``pkg-1.1.2`` releases only.
469 The scoped syntax is recommended, as it is often only a single package
470 whose upper bound is misbehaving. In this case, the upper bounds of
471 other packages should still be respected; indeed, relaxing the bound
472 can break some packages which test the selected version of packages.
474 The syntax also allows to prefix the dependee package with a
475 modifier symbol to modify the scope/semantic of the relaxation
476 transformation in a additional ways. Currently only one modifier
477 symbol is defined, i.e. ``^`` (i.e. caret) which causes the
478 relaxation to be applied only to ``^>=`` operators and leave all other
479 version operators untouched.
481 However, in some situations (e.g., when attempting to build packages
482 on a new version of GHC), it is useful to disregard *all*
483 upper-bounds, with respect to a package or all packages. This can be
484 done by specifying just a package name, or using the keyword ``all``
485 to specify all packages:
489 -- Disregard upper bounds involving the dependencies on
490 -- packages bar, baz. For quux only, relax
491 -- 'quux ^>= ...'-style constraints only.
492 allow-newer: bar, baz, ^quux
494 -- Disregard all upper bounds when dependency solving
497 -- Disregard all `^>=`-style upper bounds when dependency solving
501 For consistency, there is also the explicit wildcard scope syntax
502 ``*`` (or its alphabetic synonym ``all``). Consequently, the
503 examples above are equivalent to the explicitly scoped variants:
507 allow-newer: all:bar, *:baz, *:^quux
513 allow-newer: all:^all
515 In order to ignore all bounds specified by a package ``pkg-1.2.3``
516 you can combine scoping with a right-hand-side wildcard like so
520 -- Disregard any upper bounds specified by pkg-1.2.3
521 allow-newer: pkg-1.2.3:*
523 -- Disregard only `^>=`-style upper bounds in pkg-1.2.3
524 allow-newer: pkg-1.2.3:^*
527 :cfg-field:`allow-newer` is often used in conjunction with a constraint
528 (in the :cfg-field:`constraints` field) forcing the usage of a specific,
529 newer version of a package.
531 The command line variant of this field is e.g. ``--allow-newer=bar``. A
532 bare ``--allow-newer`` is equivalent to ``--allow-newer=all``.
534 .. cfg-field:: allow-older: none, all, list of scoped package names (space or comma separated)
535 --allow-older, --allow-older=[none,all,[scope:][^]pkg]
536 :synopsis: Lift dependency lower bound constraints.
541 Like :cfg-field:`allow-newer`, but applied to lower bounds rather than
544 The command line variant of this field is ``--allow-older=all``. A
545 bare ``--allow-older`` is equivalent to ``--allow-older=all``.
548 .. cfg-field:: index-state: HEAD, unix-timestamp, ISO8601 UTC timestamp.
549 :synopsis: Use source package index state as it existed at a previous time.
554 This allows to change the source package index state the solver uses
555 to compute install-plans. This is particularly useful in
556 combination with freeze-files in order to also freeze the state the
557 package index was in at the time the install-plan was frozen.
561 -- UNIX timestamp format example
562 index-state: @1474739268
564 -- ISO8601 UTC timestamp format example
565 -- This format is used by 'cabal configure'
566 -- for storing `--index-state` values.
567 index-state: 2016-09-24T17:47:48Z
569 -- Specify different index-states per package repository
570 -- Supported since 3.4
572 , hackage.haskell.org 2020-05-06T22:33:27Z
573 , head.hackage 2020-04-29T04:11:05Z
575 .. cfg-field:: active-repositories: reponame1, reponame2
577 :synopsis: Specify active package repositories
582 Specifies which of the package repositories defined in the configuration
583 should be active. It's also useful for specifying the order and the way
584 active repositories are merged.
586 When searching for a certain version of a certain package name, the list of
587 active repositories is searched last-to-first.
589 For example, suppose hackage.haskell.org has versions 1.0 and 2.0 of
590 package X, and my-repository has version 2.0 of a similarly named package.
591 Then, with the following configuration:
595 -- Force my-repository to be the first repository considered
597 , hackage.haskell.org
600 version 2.0 of X will come from my-repository, and version 1.0 will come
601 from hackage.haskell.org.
603 If we want to make a repository the sole provider of certain packages, we
604 can put it last in the active repositories list, and add the :override
607 For example, if we modify the previous example like this:
612 , hackage.haskell.org
613 , my-repository:override
615 then version 1.0 of package X won't be found in any case, because X is
616 present in my-repository only in version 2.0, and the :override forbids
617 searching for other versions of X further up the list.
619 :override has no effect for package names that aren't present in the
620 overriding repository.
622 The special repository reference :rest stands for "all the other repositories"
623 and can be useful to avoid lengthy lists of repository names:
627 -- Force my-repository to be the first repository considered
628 active-repositories: :rest, my-repository
630 The special repository reference :none disables all repositories, effectively
631 putting cabal in "offline" mode:
635 active-repositories: :none
638 .. cfg-field:: reject-unconstrained-dependencies: all, none
639 --reject-unconstrained-dependencies=[all|none]
640 :synopsis: Restrict the solver to packages that have constraints on them.
645 By default, the dependency solver can include any package that it's
646 aware of in a build plan. If you wish to restrict the build plan to
647 a closed set of packages (e.g., from a freeze file), use this flag.
649 When set to `all`, all non-local packages that aren't goals must be
650 explicitly constrained. When set to `none`, the solver will
651 consider all packages.
654 Package configuration options
655 -----------------------------
657 Package options affect the building of specific packages. There are three
658 ways a package option can be specified:
660 - They can be specified at the top-level, in which case they apply only
661 to **local package**, or
663 - They can be specified inside a ``package`` stanza, in which case they
664 apply to the build of the package, whether or not it is local or
667 - They can be specified inside an ``package *`` stanza, in which case they
668 apply to all packages, local ones from the project and also external
672 For example, the following options specify that :cfg-field:`optimization`
673 should be turned off for all local packages, and that ``bytestring`` (possibly
674 an external dependency) should be built with ``-fno-state-hack``::
679 ghc-options: -fno-state-hack
681 ``ghc-options`` is not specifically described in this documentation, but is one
682 of many fields for configuring programs. They take the form
683 ``progname-options`` and ``progname-location``, and can be set for all local
684 packages in a ``program-options`` stanza or under a package stanza.
686 On the command line, these options are applied to all local packages.
687 There is no per-package command line interface.
689 Some flags were added by more recent versions of the Cabal library. This
690 means that they are NOT supported by packages which use Custom setup
691 scripts that require a version of the Cabal library older than when the
694 .. cfg-field:: flags: list of +flagname or -flagname (space separated)
695 --flags="+foo -bar", -ffoo, -f-bar
696 :synopsis: Enable or disable package flags.
698 Force all flags specified as ``+flagname`` to be true, and all flags
699 specified as ``-flagname`` to be false. For example, to enable the
700 flag ``foo`` and disable ``bar``, set:
706 Exactly one of + or - is required before each flag.
708 Flags are *per-package*, so it doesn't make much sense to specify
709 flags at the top-level, unless you happen to know that *all* of your
710 local packages support the same named flags. If a flag is not
711 supported by a package, it is ignored.
713 See also the solver configuration field :cfg-field:`constraints`.
715 The command line variant of this flag is ``--flags``. There is also
716 a shortened form ``-ffoo -f-bar``.
718 A common mistake is to say ``cabal build -fhans``, where
719 ``hans`` is a flag for a transitive dependency that is not in the
720 local package; in this case, the flag will be silently ignored. If
721 ``haskell-tor`` is the package you want this flag to apply to, try
722 ``--constraint="haskell-tor +hans"`` instead.
724 .. cfg-field:: with-compiler: executable
725 --with-compiler=executable
726 :synopsis: Path to compiler executable.
728 Specify the path to a particular compiler to be used. If not an
729 absolute path, it will be resolved according to the ``PATH``
730 environment. The type of the compiler (GHC, GHCJS, etc) must be
731 consistent with the setting of the :cfg-field:`compiler` field.
733 The most common use of this option is to specify a different version
734 of your compiler to be used; e.g., if you have ``ghc-7.8`` in your
735 path, you can specify ``with-compiler: ghc-7.8`` to use it.
737 This flag also sets the default value of :cfg-field:`with-hc-pkg`, using
738 the heuristic that it is named ``ghc-pkg-7.8`` (if your executable name
739 is suffixed with a version number), or is the executable named
740 ``ghc-pkg`` in the same directory as the ``ghc`` directory. If this
741 heuristic does not work, set :cfg-field:`with-hc-pkg` explicitly.
743 For inplace packages, ``cabal build`` maintains a separate build
744 directory for each version of GHC, so you can maintain multiple
745 build trees for different versions of GHC without clobbering each
748 It's not possible to set :cfg-field:`with-compiler` on a
751 The command line variant of this flag is
752 ``--with-compiler=ghc-7.8``; there is also a short version
755 .. cfg-field:: with-hc-pkg: executable
756 --with-hc-pkg=executable
757 :synopsis: Specifies package tool.
759 Specify the path to the package tool, e.g., ``ghc-pkg``. This
760 package tool must be compatible with the compiler specified by
761 :cfg-field:`with-compiler` (generally speaking, it should be precisely
762 the tool that was distributed with the compiler). If this option is
763 omitted, the default value is determined from :cfg-field:`with-compiler`.
765 The command line variant of this flag is
766 ``--with-hc-pkg=ghc-pkg-7.8``.
768 .. cfg-field:: optimization: nat
769 --enable-optimization
770 --disable-optimization
771 :synopsis: Build with optimization.
775 Build with optimization. This is appropriate for production use,
776 taking more time to build faster libraries and programs.
778 The optional *nat* value is the optimisation level. Some compilers
779 support multiple optimisation levels. The range is 0 to 2. Level 0
780 disables optimization, level 1 is the default. Level 2 is higher
781 optimisation if the compiler supports it. Level 2 is likely to lead
782 to longer compile times and bigger generated code. If you are not
783 planning to run code, turning off optimization will lead to better
784 build times and less code to be rebuilt when a module changes.
786 When optimizations are enabled, Cabal passes ``-O2`` to the C compiler.
788 We also accept ``True`` (equivalent to 1) and ``False`` (equivalent
791 Note that as of GHC 8.0, GHC does not recompile when optimization
792 levels change (see :ghc-ticket:`10923`), so if
793 you change the optimization level for a local package you may need
794 to blow away your old build products in order to rebuild with the
795 new optimization level.
797 The command line variant of this flag is ``-O2`` (with ``-O1``
798 equivalent to ``-O``). There are also long-form variants
799 ``--enable-optimization`` and ``--disable-optimization``.
801 .. cfg-field:: configure-options: args (space separated)
802 --configure-option=arg
803 :synopsis: Options to pass to configure script.
805 A list of extra arguments to pass to the external ``./configure``
806 script, if one is used. This is only useful for packages which have
807 the ``Configure`` build type. See also the section on
808 :ref:`system-dependent parameters`.
810 The command line variant of this flag is ``--configure-option=arg``,
811 which can be specified multiple times to pass multiple options.
813 .. cfg-field:: compiler: ghc, ghcjs, jhc, lhc, uhc or haskell-suite
815 :synopsis: Compiler to build with.
819 Specify the compiler toolchain to be used. This is independent of
820 ``with-compiler``, because the choice of toolchain affects Cabal's
823 The command line variant of this flag is ``--compiler=ghc``.
825 It's not possible to set :cfg-field:`compiler` on a
828 .. cfg-field:: tests: boolean
831 :synopsis: Build tests.
835 Force test suites to be enabled. For most users this should not be
836 needed, as we always attempt to solve for test suite dependencies,
837 even when this value is ``False``; furthermore, test suites are
838 automatically enabled if they are requested as a built target.
840 The command line variant of this flag is ``--enable-tests`` and
843 .. cfg-field:: benchmarks: boolean
846 :synopsis: Build benchmarks.
850 Force benchmarks to be enabled. For most users this should not be
851 needed, as we always attempt to solve for benchmark dependencies,
852 even when this value is ``False``; furthermore, benchmarks are
853 automatically enabled if they are requested as a built target.
855 The command line variant of this flag is ``--enable-benchmarks`` and
856 ``--disable-benchmarks``.
858 .. cfg-field:: extra-prog-path: paths (newline or comma separated)
859 --extra-prog-path=PATH
860 :synopsis: Add directories to program search path.
863 A list of directories to search for extra required programs. Most
864 users should not need this, as programs like ``happy`` and ``alex``
865 will automatically be installed and added to the path. This can be
866 useful if a ``Custom`` setup script relies on an exotic extra
869 The command line variant of this flag is ``--extra-prog-path=PATH``,
870 which can be specified multiple times.
872 .. cfg-field:: run-tests: boolean
874 :synopsis: Run package test suite upon installation.
878 Run the package test suite upon installation. This is useful for
879 saying "When this package is installed, check that the test suite
880 passes, terminating the rest of the build if it is broken."
884 One deficiency: the :cfg-field:`run-tests` setting of a package is NOT
885 recorded as part of the hash, so if you install something without
886 :cfg-field:`run-tests` and then turn on ``run-tests``, we won't
887 subsequently test the package. If this is causing you problems, give
890 The command line variant of this flag is ``--run-tests``.
895 .. cfg-field:: debug-info: integer
896 --enable-debug-info=<n>
898 :synopsis: Build with debug info enabled.
903 If the compiler (e.g., GHC 7.10 and later) supports outputing OS
904 native debug info (e.g., DWARF), setting ``debug-info: True`` will
905 instruct it to do so. See the GHC wiki page on :ghc-wiki:`DWARF`
906 for more information about this feature.
908 (This field also accepts numeric syntax, but until GHC 8.2 this didn't
911 The command line variant of this flag is ``--enable-debug-info`` and
912 ``--disable-debug-info``.
914 .. cfg-field:: split-sections: boolean
915 --enable-split-sections
916 --disable-split-sections
917 :synopsis: Use GHC's split sections feature.
922 Use the GHC ``-split-sections`` feature when building the library. This
923 reduces the final size of the executables that use the library by
924 allowing them to link with only the bits that they use rather than
925 the entire library. The downside is that building the library takes
926 longer and uses a bit more memory.
928 This feature is supported by GHC 8.0 and later.
930 The command line variant of this flag is ``--enable-split-sections`` and
931 ``--disable-split-sections``.
933 .. cfg-field:: split-objs: boolean
936 :synopsis: Use GHC's split objects feature.
940 Use the GHC ``-split-objs`` feature when building the library. This
941 reduces the final size of the executables that use the library by
942 allowing them to link with only the bits that they use rather than
943 the entire library. The downside is that building the library takes
944 longer and uses considerably more memory.
946 It is generally recommend that you use ``split-sections`` instead
947 of ``split-objs`` where possible.
949 The command line variant of this flag is ``--enable-split-objs`` and
950 ``--disable-split-objs``.
952 .. cfg-field:: executable-stripping: boolean
953 --enable-executable-stripping
954 --disable-executable-stripping
955 :synopsis: Strip installed programs.
959 When installing binary executable programs, run the ``strip``
960 program on the binary. This can considerably reduce the size of the
961 executable binary file. It does this by removing debugging
962 information and symbols.
964 Not all Haskell implementations generate native binaries. For such
965 implementations this option has no effect.
967 If ``debug-info`` is set explicitly then ``executable-stripping`` is set
968 to ``False`` as otherwise all the debug symbols will be stripped.
970 The command line variant of this flag is
971 ``--enable-executable-stripping`` and
972 ``--disable-executable-stripping``.
974 .. cfg-field:: library-stripping: boolean
975 --enable-library-stripping
976 --disable-library-stripping
977 :synopsis: Strip installed libraries.
980 When installing binary libraries, run the ``strip`` program on the
981 binary, saving space on the file system. See also
982 ``executable-stripping``.
984 If ``debug-info`` is set explicitly then ``library-stripping`` is set
985 to ``False`` as otherwise all the debug symbols will be stripped.
987 The command line variant of this flag is
988 ``--enable-library-stripping`` and ``--disable-library-stripping``.
993 .. cfg-field:: program-prefix: prefix
994 --program-prefix=prefix
995 :synopsis: Prepend prefix to program names.
997 :strike:`Prepend *prefix* to installed program names.` (Currently
998 implemented in a silly and not useful way. If you need this to work
1001 *prefix* may contain the following path variables: ``$pkgid``,
1002 ``$pkg``, ``$version``, ``$compiler``, ``$os``, ``$arch``, ``$abi``,
1005 The command line variant of this flag is ``--program-prefix=foo-``.
1007 .. cfg-field:: program-suffix: suffix
1008 --program-suffix=suffix
1009 :synopsis: Append refix to program names.
1011 :strike:`Append *suffix* to installed program names.` (Currently
1012 implemented in a silly and not useful way. If you need this to work
1015 The most obvious use for this is to append the program's version
1016 number to make it possible to install several versions of a program
1017 at once: ``program-suffix: $version``.
1019 *suffix* may contain the following path variables: ``$pkgid``,
1020 ``$pkg``, ``$version``, ``$compiler``, ``$os``, ``$arch``, ``$abi``,
1023 The command line variant of this flag is
1024 ``--program-suffix='$version'``.
1026 Dynamic linking options
1027 ^^^^^^^^^^^^^^^^^^^^^^^
1029 .. cfg-field:: shared: boolean
1032 :synopsis: Build shared library.
1036 Build shared library. This implies a separate compiler run to
1037 generate position independent code as required on most platforms.
1039 The command line variant of this flag is ``--enable-shared`` and
1040 ``--disable-shared``.
1042 .. cfg-field:: executable-dynamic: boolean
1043 --enable-executable-dynamic
1044 --disable-executable-dynamic
1045 :synopsis: Link executables dynamically.
1049 Link executables dynamically. The executable's library dependencies
1050 should be built as shared objects. This implies ``shared: True``
1051 unless ``shared: False`` is explicitly specified.
1053 The command line variant of this flag is
1054 ``--enable-executable-dynamic`` and
1055 ``--disable-executable-dynamic``.
1057 .. cfg-field:: library-for-ghci: boolean
1058 --enable-library-for-ghci
1059 --disable-library-for-ghci
1060 :synopsis: Build libraries suitable for use with GHCi.
1064 Build libraries suitable for use with GHCi. This involves an extra
1065 linking step after the build.
1067 Not all platforms support GHCi and indeed on some platforms, trying
1068 to build GHCi libs fails. In such cases, consider setting
1069 ``library-for-ghci: False``.
1071 The command line variant of this flag is
1072 ``--enable-library-for-ghci`` and ``--disable-library-for-ghci``.
1074 .. cfg-field:: relocatable:
1076 :synopsis: Build relocatable package.
1081 :strike:`Build a package which is relocatable.` (TODO: It is not
1082 clear what this actually does, or if it works at all.)
1084 The command line variant of this flag is ``--relocatable``.
1086 Static linking options
1087 ^^^^^^^^^^^^^^^^^^^^^^
1089 .. cfg-field:: static: boolean
1092 :synopsis: Build static library.
1097 Roll this and all dependent libraries into a combined ``.a`` archive.
1098 This uses GHCs ``-staticlib`` flag, which is available for iOS and with
1099 GHC 8.4 and later for other platforms as well.
1101 .. cfg-field:: executable-static: boolean
1102 --enable-executable-static
1103 --disable-executable-static
1104 :synopsis: Build fully static executables.
1109 Build fully static executables.
1110 This links all dependent libraries into executables statically,
1112 This passes ``-static`` and ``-optl=-static`` to GHC.
1114 Foreign function interface options
1115 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1117 .. cfg-field:: extra-include-dirs: directories (comma or newline separated list)
1118 --extra-include-dirs=DIR
1119 :synopsis: Adds C header search path.
1121 An extra directory to search for C header files. You can use this
1122 flag multiple times to get a list of directories.
1124 You might need to use this flag if you have standard system header
1125 files in a non-standard location that is not mentioned in the
1126 package's ``.cabal`` file. Using this option has the same affect as
1127 appending the directory *dir* to the :pkg-field:`include-dirs` field in each
1128 library and executable in the package's ``.cabal`` file. The
1129 advantage of course is that you do not have to modify the package at
1130 all. These extra directories will be used while building the package
1131 and for libraries it is also saved in the package registration
1132 information and used when compiling modules that use the library.
1134 The command line variant of this flag is
1135 ``--extra-include-dirs=DIR``, which can be specified multiple times.
1137 .. cfg-field:: extra-lib-dirs: directories (comma or newline separated list)
1138 --extra-lib-dirs=DIR
1139 :synopsis: Adds library search directory.
1141 An extra directory to search for system libraries files.
1143 The command line variant of this flag is ``--extra-lib-dirs=DIR``,
1144 which can be specified multiple times.
1146 .. cfg-field:: extra-framework-dirs: directories (comma or newline separated list)
1147 --extra-framework-dirs=DIR
1148 :synopsis: Adds framework search directory (OS X only).
1150 An extra directory to search for frameworks (OS X only).
1152 You might need to use this flag if you have standard system
1153 libraries in a non-standard location that is not mentioned in the
1154 package's ``.cabal`` file. Using this option has the same affect as
1155 appending the directory *dir* to the :cfg-field:`extra-lib-dirs` field in
1156 each library and executable in the package's ``.cabal`` file. The
1157 advantage of course is that you do not have to modify the package at
1158 all. These extra directories will be used while building the package
1159 and for libraries it is also saved in the package registration
1160 information and used when compiling modules that use the library.
1162 The command line variant of this flag is
1163 ``--extra-framework-dirs=DIR``, which can be specified multiple
1169 .. cfg-field:: profiling: boolean
1172 :synopsis: Enable profiling builds.
1177 Build libraries and executables with profiling enabled (for
1178 compilers that support profiling as a separate mode). It is only
1179 necessary to specify :cfg-field:`profiling` for the specific package you
1180 want to profile; ``cabal build`` will ensure that all of its
1181 transitive dependencies are built with profiling enabled.
1183 To enable profiling for only libraries or executables, see
1184 :cfg-field:`library-profiling` and :cfg-field:`executable-profiling`.
1186 For useful profiling, it can be important to control precisely what
1187 cost centers are allocated; see :cfg-field:`profiling-detail`.
1189 The command line variant of this flag is ``--enable-profiling`` and
1190 ``--disable-profiling``.
1192 .. cfg-field:: profiling-detail: level
1193 --profiling-detail=level
1194 :synopsis: Profiling detail level.
1197 Some compilers that support profiling, notably GHC, can allocate
1198 costs to different parts of the program and there are different
1199 levels of granularity or detail with which this can be done. In
1200 particular for GHC this concept is called "cost centers", and GHC
1201 can automatically add cost centers, and can do so in different ways.
1203 This flag covers both libraries and executables, but can be
1204 overridden by the ``library-profiling-detail`` field.
1206 Currently this setting is ignored for compilers other than GHC. The
1207 levels that cabal currently supports are:
1210 For GHC this uses ``exported-functions`` for libraries and
1211 ``toplevel-functions`` for executables.
1213 No costs will be assigned to any code within this component.
1215 Costs will be assigned at the granularity of all top level
1216 functions exported from each module. In GHC, this
1217 is for non-inline functions. Corresponds to ``-fprof-auto-exported``.
1219 Costs will be assigned at the granularity of all top level
1220 functions in each module, whether they are exported from the
1221 module or not. In GHC specifically, this is for non-inline
1222 functions. Corresponds to ``-fprof-auto-top``.
1224 Costs will be assigned at the granularity of all functions in
1225 each module, whether top level or local. In GHC specifically,
1226 this is for non-inline toplevel or where-bound functions or
1227 values. Corresponds to ``-fprof-auto``.
1229 The command line variant of this flag is
1230 ``--profiling-detail=none``.
1232 .. cfg-field:: library-profiling-detail: level
1233 --library-profiling-detail=level
1234 :synopsis: Libraries profiling detail level.
1237 Like :cfg-field:`profiling-detail`, but applied only to libraries
1239 The command line variant of this flag is
1240 ``--library-profiling-detail=none``.
1242 .. cfg-field:: library-vanilla: boolean
1243 --enable-library-vanilla
1244 --disable-library-vanilla
1245 :synopsis: Build libraries without profiling.
1249 Build ordinary libraries (as opposed to profiling libraries).
1250 Mostly, you can set this to False to avoid building ordinary
1251 libraries when you are profiling.
1253 The command line variant of this flag is
1254 ``--enable-library-vanilla`` and ``--disable-library-vanilla``.
1256 .. cfg-field:: library-profiling: boolean
1257 --enable-library-profiling
1258 --disable-library-profiling
1259 :synopsis: Build libraries with profiling enabled.
1264 Build libraries with profiling enabled. You probably want
1265 to use :cfg-field:`profiling` instead.
1267 The command line variant of this flag is
1268 ``--enable-library-profiling`` and ``--disable-library-profiling``.
1270 .. cfg-field:: executable-profiling: boolean
1271 --enable-executable-profiling
1272 --disable-executable-profiling
1273 :synopsis: Build executables with profiling enabled.
1278 Build executables with profiling enabled. You probably want
1279 to use :cfg-field:`profiling` instead.
1281 The command line variant of this flag is
1282 ``--enable-executable-profiling`` and
1283 ``--disable-executable-profiling``.
1288 .. cfg-field:: coverage: boolean
1291 :synopsis: Build with coverage enabled.
1296 Build libraries and executables (including test suites) with Haskell
1297 Program Coverage enabled. Running the test suites will automatically
1298 generate coverage reports with HPC.
1300 The command line variant of this flag is ``--enable-coverage`` and
1301 ``--disable-coverage``.
1303 .. cfg-field:: library-coverage: boolean
1304 --enable-library-coverage
1305 --disable-library-coverage
1311 Deprecated, use :cfg-field:`coverage`.
1313 The command line variant of this flag is
1314 ``--enable-library-coverage`` and ``--disable-library-coverage``.
1319 .. cfg-field:: documentation: boolean
1320 --enable-documentation
1321 --disable-documentation
1322 :synopsis: Enable building of documentation.
1326 Enables building of Haddock documentation.
1328 The command line variant of this flag is ``--enable-documentation``
1329 and ``--disable-documentation``.
1331 `documentation: true` does not imply
1332 :cfg-field:`haddock-all`,
1333 :cfg-field:`haddock-benchmarks`,
1334 :cfg-field:`haddock-executables`,
1335 :cfg-field:`haddock-internal` or
1336 :cfg-field:`haddock-tests`.
1337 These need to be enabled separately if desired.
1339 .. cfg-field:: doc-index-file: templated path
1340 --doc-index-file=TEMPLATE
1341 :synopsis: Path to haddock templates.
1343 A central index of Haddock API documentation (template cannot use
1344 ``$pkgid``), which should be updated as documentation is built.
1346 The following commands are equivalent to ones that would be passed when
1347 running ``setup haddock``.
1349 .. cfg-field:: haddock-hoogle: boolean
1351 :synopsis: Generate Hoogle file.
1355 Generate a text file which can be converted by Hoogle_
1356 into a database for searching.
1357 This is equivalent to running ``haddock`` with the ``--hoogle`` flag.
1359 .. cfg-field:: haddock-html: boolean
1361 :synopsis: Build HTML documentation.
1365 Build HTML documentation.
1367 .. cfg-field:: haddock-quickjump: boolean
1369 :synopsis: Generate Quickjump file.
1373 Generate an index for interactive documentation navigation.
1374 This is equivalent to running ``haddock`` with the ``--quickjump`` flag.
1376 .. cfg-field:: haddock-html-location: templated path
1377 --haddock-html-location=TEMPLATE
1378 :synopsis: Haddock HTML templates location.
1380 Specify a template for the location of HTML documentation for
1381 prerequisite packages. The substitutions are applied to the template
1382 to obtain a location for each package, which will be used by
1383 hyperlinks in the generated documentation. For example, the
1384 following command generates links pointing at Hackage pages:
1388 html-location: http://hackage.haskell.org/packages/archive/$pkg/latest/doc/html
1390 If passed on the command line,
1391 the argument may be quoted to prevent substitution by the shell.
1395 --html-location='http://hackage.haskell.org/packages/archive/$pkg/latest/doc/html'
1397 If this option is omitted, the location for each package is obtained
1398 using the package tool (e.g. ``ghc-pkg``).
1400 .. cfg-field:: haddock-executables: boolean
1401 --haddock-executables
1402 :synopsis: Generate documentation for executables.
1406 Run haddock on all executable programs.
1408 .. cfg-field:: haddock-tests: boolean
1410 :synopsis: Generate documentation for tests.
1414 Run haddock on all test suites.
1416 .. cfg-field:: haddock-benchmarks: boolean
1417 --haddock-benchmarks
1418 :synopsis: Generate documentation for benchmarks.
1422 Run haddock on all benchmarks.
1424 .. cfg-field:: haddock-internal: boolean
1426 :synopsis: Generate documentation for internal modules
1430 Build haddock documentation which includes unexposed modules and
1433 .. cfg-field:: haddock-all: boolean
1435 :synopsis: Generate documentation for everything
1439 Run haddock on all components.
1441 .. cfg-field:: haddock-css: path
1443 :synopsis: Location of Haddock CSS file.
1445 The CSS file that should be used to style the generated
1446 documentation (overriding haddock's default).
1448 .. cfg-field:: haddock-hyperlink-source: boolean
1449 --haddock-hyperlink-source
1450 :synopsis: Generate hyperlinked source code for documentation
1454 Generated hyperlinked source code using `HsColour`_, and have
1455 Haddock documentation link to it.
1456 This is equivalent to running ``haddock`` with the ``--hyperlinked-source`` flag.
1458 .. cfg-field:: haddock-hscolour-css: path
1459 --haddock-hscolour-css=PATH
1460 :synopsis: Location of CSS file for HsColour
1462 The CSS file that should be used to style the generated hyperlinked
1463 source code (from `HsColour`_).
1465 .. cfg-field:: haddock-contents-location: URL
1466 --haddock-contents-location=URL
1467 :synopsis: URL for contents page.
1469 A baked-in URL to be used as the location for the contents page.
1471 .. cfg-field:: haddock-keep-temp-files: boolean
1472 :synopsis: Keep temporary Haddock files.
1474 Keep temporary files.
1476 There is no command line variant of this flag.
1478 .. cfg-field:: open: boolean
1480 :synopsis: Open generated documentation in-browser.
1482 When generating HTML documentation, attempt to open it in a browser
1483 when complete. This will use ``xdg-open`` on Linux and BSD systems,
1484 ``open`` on macOS, and ``start`` on Windows.
1486 Advanced global configuration options
1487 -------------------------------------
1489 .. cfg-field:: write-ghc-environment-files: always, never, or ghc8.4.4+
1490 --write-ghc-environment-files=policy
1491 :synopsis: Whether a ``.ghc.environment`` should be created after a successful build.
1495 Whether a `GHC package environment file <https://downloads.haskell.org/~ghc/master/users-guide/packages.html#package-environments>`_
1496 should be created after a successful build.
1498 Since Cabal 3.0, defaults to ``never``. Before that, defaulted to
1499 creating them only when compiling with GHC 8.4.4 and older (GHC
1500 8.4.4 `is the first version
1501 <https://gitlab.haskell.org/ghc/ghc/-/issues/13753>`_ that supports
1502 the ``-package-env -`` option that allows ignoring the package
1505 .. cfg-field:: build-info: True, False
1507 --disable-build-info
1508 :synopsis: Whether build information for each individual component should be
1509 written in a machine readable format.
1513 Enable generation of build information for Cabal components. Contains very
1514 detailed information on how to build an individual component, such as
1515 compiler version, modules of a component and how to compile the component.
1517 The output format is in json, and the exact location can be discovered from
1518 ``plan.json``, where it is identified by ``build-info`` within the items in
1519 the ``install-plan``.
1520 Note, that this field in ``plan.json`` can be ``null``, if and only if
1521 ``build-type: Custom`` is set, and the ``Cabal`` version is too
1522 old (i.e. ``< 3.7``).
1523 If the field is missing entirely, the component is not a local one, thus,
1524 no ``build-info`` exists for that particular component within the
1528 The format and fields of the generated build information is currently experimental,
1529 in the future we might add or remove fields, depending on the needs of other tooling.
1532 .. cfg-field:: http-transport: curl, wget, powershell, or plain-http
1533 --http-transport=transport
1534 :synopsis: Transport to use with http(s) requests.
1538 Set a transport to be used when making http(s) requests.
1540 The command line variant of this field is ``--http-transport=curl``.
1542 .. cfg-field:: ignore-expiry: boolean
1544 :synopsis: Ignore Hackage expiration dates.
1548 If ``True``, we will ignore expiry dates on metadata from Hackage.
1550 In general, you should not set this to ``True`` as it will leave you
1551 vulnerable to stale cache attacks. However, it may be temporarily
1552 useful if the main Hackage server is down, and we need to rely on
1553 mirrors which have not been updated for longer than the expiry
1554 period on the timestamp.
1556 The command line variant of this field is ``--ignore-expiry``.
1558 .. cfg-field:: remote-repo-cache: directory
1559 --remote-repo-cache=DIR
1560 :synopsis: Location of packages cache.
1562 :default: ``~/.cabal/packages``
1564 :strike:`The location where packages downloaded from remote
1565 repositories will be cached.` Not implemented yet.
1567 The command line variant of this flag is
1568 ``--remote-repo-cache=DIR``.
1570 .. cfg-field:: logs-dir: directory
1572 :synopsis: Directory to store build logs.
1574 :default: ``~/.cabal/logs``
1576 :strike:`The location where build logs for packages are stored.`
1577 Not implemented yet.
1579 The command line variant of this flag is ``--logs-dir=DIR``.
1581 .. cfg-field:: build-summary: template filepath
1582 --build-summary=TEMPLATE
1583 :synopsis: Build summaries location.
1585 :default: ``~/.cabal/logs/build.log``
1587 :strike:`The file to save build summaries.` Not implemented yet.
1589 Valid variables which can be used in the path are ``$pkgid``,
1590 ``$compiler``, ``$os`` and ``$arch``.
1592 The command line variant of this flag is
1593 ``--build-summary=TEMPLATE``.
1595 Undocumented fields: ``root-cmd``, ``symlink-bindir``, ``build-log``,
1596 ``remote-build-reporting``, ``report-planned-failure``, ``offline``.
1598 Advanced solver options
1599 ^^^^^^^^^^^^^^^^^^^^^^^
1601 Most users generally won't need these.
1603 .. cfg-field:: solver: modular
1605 :synopsis: Which solver to use.
1607 This field is reserved to allow the specification of alternative
1608 dependency solvers. At the moment, the only accepted option is
1611 The command line variant of this field is ``--solver=modular``.
1613 .. cfg-field:: max-backjumps: nat
1615 :synopsis: Maximum number of solver backjumps.
1619 Maximum number of backjumps (backtracking multiple steps) allowed
1620 while solving. Set -1 to allow unlimited backtracking, and 0 to
1621 disable backtracking completely.
1623 The command line variant of this field is ``--max-backjumps=4000``.
1625 .. cfg-field:: reorder-goals: boolean
1628 :synopsis: Allow solver to reorder goals.
1632 When enabled, the solver will reorder goals according to certain
1633 heuristics. Slows things down on average, but may make backtracking
1634 faster for some packages. It's unlikely to help for small projects,
1635 but for big install plans it may help you find a plan when otherwise
1636 this is not possible. See :issue:`1780` for more commentary.
1638 The command line variant of this field is ``--(no-)reorder-goals``.
1640 .. cfg-field:: count-conflicts: boolean
1642 --no-count-conflicts
1643 :synopsis: Solver prefers versions with less conflicts.
1647 Try to speed up solving by preferring goals that are involved in a
1650 The command line variant of this field is
1651 ``--(no-)count-conflicts``.
1653 .. cfg-field:: fine-grained-conflicts: boolean
1654 --fine-grained-conflicts
1655 --no-fine-grained-conflicts
1656 :synopsis: Skip a version of a package if it does not resolve any conflicts
1657 encountered in the last version (solver optimization).
1661 When enabled, the solver will skip a version of a package if it does not
1662 resolve any of the conflicts encountered in the last version of that
1663 package. For example, if ``foo-1.2`` depended on ``bar``, and the solver
1664 couldn't find consistent versions for ``bar``'s dependencies, then the
1665 solver would skip ``foo-1.1`` if it also depended on ``bar``.
1667 The command line variant of this field is
1668 ``--(no-)fine-grained-conflicts``.
1670 .. cfg-field:: minimize-conflict-set: boolean
1671 --minimize-conflict-set
1672 --no-minimize-conflict-set
1673 :synopsis: Try to improve the solver error message when there is no
1678 When there is no solution, try to improve the solver error message
1679 by finding a minimal conflict set. This option may increase run
1680 time significantly, so it is off by default.
1682 The command line variant of this field is
1683 ``--(no-)minimize-conflict-set``.
1685 .. cfg-field:: strong-flags: boolean
1688 :synopsis: Do not defer flag choices when solving.
1692 Do not defer flag choices. (TODO: Better documentation.)
1694 The command line variant of this field is ``--(no-)strong-flags``.
1696 .. cfg-field:: allow-boot-library-installs: boolean
1697 --allow-boot-library-installs
1698 --no-allow-boot-library-installs
1699 :synopsis: Allow cabal to install or upgrade any package.
1703 By default, the dependency solver doesn't allow ``base``,
1704 ``ghc-prim``, ``integer-simple``, ``integer-gmp``, and
1705 ``template-haskell`` to be installed or upgraded. This flag
1706 removes the restriction.
1708 The command line variant of this field is
1709 ``--(no-)allow-boot-library-installs``.
1711 .. cfg-field:: cabal-lib-version: version
1712 --cabal-lib-version=version
1713 :synopsis: Version of Cabal library used to build package.
1715 This field selects the version of the Cabal library which should be
1716 used to build packages. This option is intended primarily for
1717 internal development use (e.g., forcing a package to build with a
1718 newer version of Cabal, to test a new version of Cabal.) (TODO:
1719 Specify its semantics more clearly.)
1721 The command line variant of this field is
1722 ``--cabal-lib-version=1.24.0.1``.
1724 .. include:: references.inc