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 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 :strike:`Specifies a list of external packages from Hackage which
131 should be considered local packages.` (Not implemented)
133 There is no command line variant of this field.
137 All local packages are *vendored*, in the sense that if other packages
138 (including external ones from Hackage) depend on a package with the name
139 of a local package, the local package is preferentially used.
140 For subdirectories to be considered local packages, the following setting
144 optional-packages: ./*/*.cabal
146 ...then any package can be vendored simply by making a checkout in the
147 top-level project directory, as might be seen in this hypothetical
151 foo-helper/ # local package
152 unix/ # vendored external package
154 All of these options support globs. ``cabal build`` has its own glob
157 - Anywhere in a path, as many times as you like, you can specify an
158 asterisk ``*`` wildcard. E.g., ``*/*.cabal`` matches all ``.cabal``
159 files in all immediate subdirectories. Like in glob(7), asterisks do
160 not match hidden files unless there is an explicit period, e.g.,
161 ``.*/foo.cabal`` will match ``.private/foo.cabal`` (but
162 ``*/foo.cabal`` will not).
164 - You can use braces to specify specific directories; e.g.,
165 ``{vendor,pkgs}/*.cabal`` matches all Cabal files in the ``vendor``
166 and ``pkgs`` subdirectories.
168 Formally, the format is described by the following BNF:
171 convert globbing grammar to proper ABNF_ syntax
175 FilePathGlob ::= FilePathRoot FilePathGlobRel
176 FilePathRoot ::= {- empty -} # relative to cabal.project
178 | [a-zA-Z] ":" [/\\] # Windows root
179 | "~" # home directory
180 FilePathGlobRel ::= Glob "/" FilePathGlobRel # Unix directory
181 | Glob "\\" FilePathGlobRel # Windows directory
183 | {- empty -} # trailing slash
185 GlobPiece ::= "*" # wildcard
186 | [^*{},/\\] * # literal string
187 | "\\" [*{},] # escaped reserved character
188 | "{" Glob "," ... "," Glob "}" # union (match any of these)
191 Specifying Packages from Remote Version Control Locations
192 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
194 Starting with Cabal 2.4, there is now a stanza
195 ``source-repository-package`` for specifying packages from an external
198 .. code-block:: cabal
202 source-repository-package
204 location: https://github.com/hvr/HsYAML.git
205 tag: e70cf0c171c9a586b62b3f75d72f1591e4e6aaa1
207 source-repository-package
209 location: https://github.com/well-typed/cborg
210 tag: 3d274c14ca3077c3a081ba7ad57c5182da65c8c1
213 source-repository-package
215 location: https://github.com/haskell/network.git
216 tag: e76fdc753e660dfa615af6c8b6a2ad9ddf6afe70
217 post-checkout-command: autoreconf -i
219 cabal-install 3.4 sdists the ``source-repository-package`` repositories and uses resulting tarballs as project packages.
220 This allows sharing of packages across different projects.
222 .. cfg-field:: type: VCS kind
224 .. cfg-field:: location: VCS location (usually URL)
226 .. cfg-field:: tag: VCS tag
228 .. cfg-field:: subdir: subdirectory list
230 Use one or more subdirectories of the repository.
232 .. cfg-field:: post-checkout-command: command
234 Run command in the checked out repository, prior sdisting.
236 Global configuration options
237 ----------------------------
239 The following top-level configuration options are not specific to any
240 package, and thus apply globally:
243 .. cfg-field:: verbose: nat
245 :synopsis: Build verbosity level.
249 Control the verbosity of ``cabal`` commands, valid values are from 0
252 The command line variant of this field is ``--verbose=2``; a short
253 form ``-v2`` is also supported.
255 .. cfg-field:: jobs: nat or $ncpus
256 --jobs=n, -jn, --jobs=$ncpus
257 :synopsis: Number of builds running in parallel.
261 Run *nat* jobs simultaneously when building. If ``$ncpus`` is
262 specified, run the number of jobs equal to the number of CPUs.
263 Package building is often quite parallel, so turning on parallelism
264 can speed up build times quite a bit!
266 The command line variant of this field is ``--jobs=2``; a short form
267 ``-j2`` is also supported; a bare ``--jobs`` or ``-j`` is equivalent
268 to ``--jobs=$ncpus``.
270 .. cfg-field:: keep-going: boolean
272 :synopsis: Try to continue building on failure.
276 If true, after a build failure, continue to build other unaffected
279 The command line variant of this field is ``--keep-going``.
281 .. option:: --builddir=DIR
283 Specifies the name of the directory where build products for
284 build will be stored; defaults to ``dist-newstyle``. If a
285 relative name is specified, this directory is resolved relative
286 to the root of the project (i.e., where the ``cabal.project``
289 This option cannot be specified via a ``cabal.project`` file.
291 .. _cmdoption-project-file:
292 .. option:: --project-file=FILE
294 Specifies the name of the project file used to specify the
295 rest of the top-level configuration; defaults to ``cabal.project``.
296 This name not only specifies the name of the main project file,
297 but also the auxiliary project files ``cabal.project.freeze``
298 and ``cabal.project.local``; for example, if you specify
299 ``--project-file=my.project``, then the other files that will
300 be probed are ``my.project.freeze`` and ``my.project.local``.
302 If the specified project file is a relative path, we will
303 look for the file relative to the current working directory,
304 and then for the parent directory, until the project file is
305 found or we have hit the top of the user's home directory.
307 This option cannot be specified via a ``cabal.project`` file.
309 .. option:: --ignore-project
311 Ignores the local ``cabal.project`` file and uses the default
312 configuration with the local ``foo.cabal`` file. Note that
313 if this flag is set while the ``--project-file`` flag is also
314 set then this flag will be ignored.
316 .. option:: --store-dir=DIR
318 Specifies the name of the directory of the global package store.
320 .. cfg-field:: package-dbs: package DB stack (comma separated)
321 --package-db=[clear, global, user, PATH]
322 :synopsis: PackageDB stack manipulation
325 There are three package databases involved with most builds:
328 Compiler installation of rts, base, etc.
330 Nix-style local build cache
332 Project-specific build directory
334 By default, the package stack you will have with v2 commands is:
340 So all remote packages required by your project will be
341 registered in the store package db (because it is last).
343 When cabal starts building your local projects, it appends the in-place db
348 -- [global, store, in-place]
350 So your local packages get put in ``dist-newstyle`` instead of the store.
352 This flag manipulates the default prefix: ``[global, store]`` and accepts
353 paths, the special value ``global`` referring to the global package db, and
354 ``clear`` which removes all prior entries. For example,
358 -- [global, store, foo]
362 package-dbs: clear, foo
365 package-dbs: clear, foo, clear, bar, baz
367 The command line variant of this flag is ``--package-db=DB`` which can be
368 specified multiple times.
373 The following settings apply to commands that result in build actions
374 (``build``, ``run``, ``repl``, ``test``...), and control which phases of the
377 .. option:: --dry-run
379 Do not download, build, or install anything, only print what would happen.
381 .. option:: --only-configure
383 Instead of performing a full build just run the configure step.
384 Only accepted by the ``build`` command.
386 .. option:: --only-download
388 Do not build anything, only fetch the packages.
390 .. option:: --only-dependencies
392 Install only the dependencies necessary to build the given packages.
393 Not accepted by the ``repl`` command.
395 Solver configuration options
396 ----------------------------
398 The following settings control the behavior of the dependency solver:
400 .. cfg-field:: constraints: constraints list (comma separated)
401 --constraint="pkg >= 2.0", -c "pkg >= 2.0"
402 :synopsis: Extra dependencies constraints.
404 Add extra constraints to the version bounds, flag settings,
405 and other properties a solver can pick for a
406 package. For example:
410 constraints: bar == 2.1
412 A package can be specified multiple times in ``constraints``, in
413 which case the specified constraints are intersected. This is
414 useful, since the syntax does not allow you to specify multiple
415 constraints at once. For example, to specify both version bounds and
416 flag assignments, you would write:
420 constraints: bar == 2.1,
423 Valid constraints take the same form as for the
424 :option:`runhaskell Setup.hs configure --constraint`
427 .. cfg-field:: preferences: preference (comma separated)
428 --preference="pkg >= 2.0"
429 :synopsis: Preferred dependency versions.
431 Like :cfg-field:`constraints`, but the solver will attempt to satisfy
432 these preferences on a best-effort basis. The resulting install is locally
433 optimal with respect to preferences; specifically, no single package
434 could be replaced with a more preferred version that still satisfies
435 the hard constraints.
437 Operationally, preferences can cause the solver to attempt certain
438 version choices of a package before others, which can improve
439 dependency solver runtime.
441 One way to use :cfg-field:`preferences` is to take a known working set of
442 constraints (e.g., via ``cabal freeze``) and record them as
443 preferences. In this case, the solver will first attempt to use this
444 configuration, and if this violates hard constraints, it will try to
445 find the minimal number of upgrades to satisfy the hard constraints
448 The command line variant of this field is
449 ``--preference="pkg >= 2.0"``; to specify multiple preferences, pass
450 the flag multiple times.
452 .. cfg-field:: allow-newer: none, all or list of scoped package names (space or comma separated)
453 --allow-newer, --allow-newer=[none,all,[scope:][^]pkg]
454 :synopsis: Lift dependencies upper bound constraints.
458 Allow the solver to pick more recent version of some packages than
459 would normally be permitted by the :pkg-field:`build-depends` bounds
460 of packages in the install plan. This option may be useful if the
461 dependency solver cannot otherwise find a valid install plan.
463 For example, to relax ``pkg``\ s :pkg-field:`build-depends` upper bound on
464 ``dep-pkg``, write a scoped package name of the form:
468 allow-newer: pkg:dep-pkg
470 If the scope shall be limited to specific releases of ``pkg``, the
475 allow-newer: pkg-1.2.3:dep-pkg, pkg-1.1.2:dep-pkg
477 can be used to limit the relaxation of dependencies on
478 ``dep-pkg`` by the ``pkg-1.2.3`` and ``pkg-1.1.2`` releases only.
480 The scoped syntax is recommended, as it is often only a single package
481 whose upper bound is misbehaving. In this case, the upper bounds of
482 other packages should still be respected; indeed, relaxing the bound
483 can break some packages which test the selected version of packages.
485 The syntax also allows to prefix the dependee package with a
486 modifier symbol to modify the scope/semantic of the relaxation
487 transformation in a additional ways. Currently only one modifier
488 symbol is defined, i.e. ``^`` (i.e. caret) which causes the
489 relaxation to be applied only to ``^>=`` operators and leave all other
490 version operators untouched.
492 However, in some situations (e.g., when attempting to build packages
493 on a new version of GHC), it is useful to disregard *all*
494 upper-bounds, with respect to a package or all packages. This can be
495 done by specifying just a package name, or using the keyword ``all``
496 to specify all packages:
500 -- Disregard upper bounds involving the dependencies on
501 -- packages bar, baz. For quux only, relax
502 -- 'quux ^>= ...'-style constraints only.
503 allow-newer: bar, baz, ^quux
505 -- Disregard all upper bounds when dependency solving
508 -- Disregard all `^>=`-style upper bounds when dependency solving
512 For consistency, there is also the explicit wildcard scope syntax
513 ``*`` (or its alphabetic synonym ``all``). Consequently, the
514 examples above are equivalent to the explicitly scoped variants:
518 allow-newer: all:bar, *:baz, *:^quux
524 allow-newer: all:^all
526 In order to ignore all bounds specified by a package ``pkg-1.2.3``
527 you can combine scoping with a right-hand-side wildcard like so
531 -- Disregard any upper bounds specified by pkg-1.2.3
532 allow-newer: pkg-1.2.3:*
534 -- Disregard only `^>=`-style upper bounds in pkg-1.2.3
535 allow-newer: pkg-1.2.3:^*
538 :cfg-field:`allow-newer` is often used in conjunction with a constraint
539 (in the :cfg-field:`constraints` field) forcing the usage of a specific,
540 newer version of a package.
542 The command line variant of this field is e.g. ``--allow-newer=bar``. A
543 bare ``--allow-newer`` is equivalent to ``--allow-newer=all``.
545 .. cfg-field:: allow-older: none, all, list of scoped package names (space or comma separated)
546 --allow-older, --allow-older=[none,all,[scope:][^]pkg]
547 :synopsis: Lift dependency lower bound constraints.
552 Like :cfg-field:`allow-newer`, but applied to lower bounds rather than
555 The command line variant of this field is ``--allow-older=all``. A
556 bare ``--allow-older`` is equivalent to ``--allow-older=all``.
559 .. cfg-field:: index-state: HEAD, unix-timestamp, ISO8601 UTC timestamp.
560 :synopsis: Use source package index state as it existed at a previous time.
565 This allows to change the source package index state the solver uses
566 to compute install-plans. This is particularly useful in
567 combination with freeze-files in order to also freeze the state the
568 package index was in at the time the install-plan was frozen.
572 -- UNIX timestamp format example
573 index-state: @1474739268
575 -- ISO8601 UTC timestamp format example
576 -- This format is used by 'cabal configure'
577 -- for storing `--index-state` values.
578 index-state: 2016-09-24T17:47:48Z
580 -- Specify different index-states per package repository
581 -- Supported since 3.4
583 , hackage.haskell.org 2020-05-06T22:33:27Z
584 , head.hackage 2020-04-29T04:11:05Z
586 .. cfg-field:: active-repositories: reponame1, reponame2
588 :synopsis: Specify active package repositories
593 Specifies which of the package repositories defined in the configuration
594 should be active. It's also useful for specifying the order and the way
595 active repositories are merged.
597 When searching for a certain version of a certain package name, the list of
598 active repositories is searched last-to-first.
600 For example, suppose hackage.haskell.org has versions 1.0 and 2.0 of
601 package X, and my-repository has version 2.0 of a similarly named package.
602 Then, with the following configuration:
606 -- Force my-repository to be the first repository considered
608 , hackage.haskell.org
611 version 2.0 of X will come from my-repository, and version 1.0 will come
612 from hackage.haskell.org.
614 If we want to make a repository the sole provider of certain packages, we
615 can put it last in the active repositories list, and add the :override
618 For example, if we modify the previous example like this:
623 , hackage.haskell.org
624 , my-repository:override
626 then version 1.0 of package X won't be found in any case, because X is
627 present in my-repository only in version 2.0, and the :override forbids
628 searching for other versions of X further up the list.
630 :override has no effect for package names that aren't present in the
631 overriding repository.
633 The special repository reference :rest stands for "all the other repositories"
634 and can be useful to avoid lengthy lists of repository names:
638 -- Force my-repository to be the first repository considered
639 active-repositories: :rest, my-repository
641 The special repository reference :none disables all repositories, effectively
642 putting cabal in "offline" mode:
646 active-repositories: :none
649 .. cfg-field:: reject-unconstrained-dependencies: all, none
650 --reject-unconstrained-dependencies=[all|none]
651 :synopsis: Restrict the solver to packages that have constraints on them.
656 By default, the dependency solver can include any package that it's
657 aware of in a build plan. If you wish to restrict the build plan to
658 a closed set of packages (e.g., from a freeze file), use this flag.
660 When set to `all`, all non-local packages that aren't goals must be
661 explicitly constrained. When set to `none`, the solver will
662 consider all packages.
665 Package configuration options
666 -----------------------------
668 Package options affect the building of specific packages. There are three
669 ways a package option can be specified:
671 - They can be specified at the top-level, in which case they apply only
672 to **local package**, or
674 - They can be specified inside a ``package`` stanza, in which case they
675 apply to the build of the package, whether or not it is local or
678 - They can be specified inside an ``package *`` stanza, in which case they
679 apply to all packages, local ones from the project and also external
683 For example, the following options specify that :cfg-field:`optimization`
684 should be turned off for all local packages, and that ``bytestring`` (possibly
685 an external dependency) should be built with ``-fno-state-hack``::
690 ghc-options: -fno-state-hack
692 ``ghc-options`` is not specifically described in this documentation, but is one
693 of many fields for configuring programs. They take the form
694 ``progname-options`` and ``progname-location``, and can be set for all local
695 packages in a ``program-options`` stanza or under a package stanza.
697 On the command line, these options are applied to all local packages.
698 There is no per-package command line interface.
700 Some flags were added by more recent versions of the Cabal library. This
701 means that they are NOT supported by packages which use Custom setup
702 scripts that require a version of the Cabal library older than when the
705 .. cfg-field:: flags: list of +flagname or -flagname (space separated)
706 --flags="+foo -bar", -ffoo, -f-bar
707 :synopsis: Enable or disable package flags.
709 Force all flags specified as ``+flagname`` to be true, and all flags
710 specified as ``-flagname`` to be false. For example, to enable the
711 flag ``foo`` and disable ``bar``, set:
717 Exactly one of + or - is required before each flag.
719 Flags are *per-package*, so it doesn't make much sense to specify
720 flags at the top-level, unless you happen to know that *all* of your
721 local packages support the same named flags. If a flag is not
722 supported by a package, it is ignored.
724 See also the solver configuration field :cfg-field:`constraints`.
726 The command line variant of this flag is ``--flags``. There is also
727 a shortened form ``-ffoo -f-bar``.
729 A common mistake is to say ``cabal build -fhans``, where
730 ``hans`` is a flag for a transitive dependency that is not in the
731 local package; in this case, the flag will be silently ignored. If
732 ``haskell-tor`` is the package you want this flag to apply to, try
733 ``--constraint="haskell-tor +hans"`` instead.
735 .. cfg-field:: with-compiler: executable
736 --with-compiler=executable
737 :synopsis: Path to compiler executable.
739 Specify the path to a particular compiler to be used. If not an
740 absolute path, it will be resolved according to the ``PATH``
741 environment. The type of the compiler (GHC, GHCJS, etc) must be
742 consistent with the setting of the :cfg-field:`compiler` field.
744 The most common use of this option is to specify a different version
745 of your compiler to be used; e.g., if you have ``ghc-7.8`` in your
746 path, you can specify ``with-compiler: ghc-7.8`` to use it.
748 This flag also sets the default value of :cfg-field:`with-hc-pkg`, using
749 the heuristic that it is named ``ghc-pkg-7.8`` (if your executable name
750 is suffixed with a version number), or is the executable named
751 ``ghc-pkg`` in the same directory as the ``ghc`` directory. If this
752 heuristic does not work, set :cfg-field:`with-hc-pkg` explicitly.
754 For inplace packages, ``cabal build`` maintains a separate build
755 directory for each version of GHC, so you can maintain multiple
756 build trees for different versions of GHC without clobbering each
759 It's not possible to set :cfg-field:`with-compiler` on a
762 The command line variant of this flag is
763 ``--with-compiler=ghc-7.8``; there is also a short version
766 .. cfg-field:: with-hc-pkg: executable
767 --with-hc-pkg=executable
768 :synopsis: Specifies package tool.
770 Specify the path to the package tool, e.g., ``ghc-pkg``. This
771 package tool must be compatible with the compiler specified by
772 :cfg-field:`with-compiler` (generally speaking, it should be precisely
773 the tool that was distributed with the compiler). If this option is
774 omitted, the default value is determined from :cfg-field:`with-compiler`.
776 The command line variant of this flag is
777 ``--with-hc-pkg=ghc-pkg-7.8``.
779 .. cfg-field:: optimization: nat
780 --enable-optimization
781 --disable-optimization
782 :synopsis: Build with optimization.
786 Build with optimization. This is appropriate for production use,
787 taking more time to build faster libraries and programs.
789 The optional *nat* value is the optimisation level. Some compilers
790 support multiple optimisation levels. The range is 0 to 2. Level 0
791 disables optimization, level 1 is the default. Level 2 is higher
792 optimisation if the compiler supports it. Level 2 is likely to lead
793 to longer compile times and bigger generated code. If you are not
794 planning to run code, turning off optimization will lead to better
795 build times and less code to be rebuilt when a module changes.
797 When optimizations are enabled, Cabal passes ``-O2`` to the C compiler.
799 We also accept ``True`` (equivalent to 1) and ``False`` (equivalent
802 Note that as of GHC 8.0, GHC does not recompile when optimization
803 levels change (see :ghc-ticket:`10923`), so if
804 you change the optimization level for a local package you may need
805 to blow away your old build products in order to rebuild with the
806 new optimization level.
808 The command line variant of this flag is ``-O2`` (with ``-O1``
809 equivalent to ``-O``). There are also long-form variants
810 ``--enable-optimization`` and ``--disable-optimization``.
812 .. cfg-field:: configure-options: args (space separated)
813 --configure-option=arg
814 :synopsis: Options to pass to configure script.
816 A list of extra arguments to pass to the external ``./configure``
817 script, if one is used. This is only useful for packages which have
818 the ``Configure`` build type. See also the section on
819 :ref:`system-dependent parameters`.
821 The command line variant of this flag is ``--configure-option=arg``,
822 which can be specified multiple times to pass multiple options.
824 .. cfg-field:: compiler: ghc, ghcjs, jhc, lhc, uhc or haskell-suite
826 :synopsis: Compiler to build with.
830 Specify the compiler toolchain to be used. This is independent of
831 ``with-compiler``, because the choice of toolchain affects Cabal's
834 The command line variant of this flag is ``--compiler=ghc``.
836 It's not possible to set :cfg-field:`compiler` on a
839 .. cfg-field:: tests: boolean
842 :synopsis: Build tests.
846 Force test suites to be enabled. For most users this should not be
847 needed, as we always attempt to solve for test suite dependencies,
848 even when this value is ``False``; furthermore, test suites are
849 automatically enabled if they are requested as a built target.
851 The command line variant of this flag is ``--enable-tests`` and
854 .. cfg-field:: benchmarks: boolean
857 :synopsis: Build benchmarks.
861 Force benchmarks to be enabled. For most users this should not be
862 needed, as we always attempt to solve for benchmark dependencies,
863 even when this value is ``False``; furthermore, benchmarks are
864 automatically enabled if they are requested as a built target.
866 The command line variant of this flag is ``--enable-benchmarks`` and
867 ``--disable-benchmarks``.
869 .. cfg-field:: extra-prog-path: paths (newline or comma separated)
870 --extra-prog-path=PATH
871 :synopsis: Add directories to program search path.
874 A list of directories to search for extra required programs. Most
875 users should not need this, as programs like ``happy`` and ``alex``
876 will automatically be installed and added to the path. This can be
877 useful if a ``Custom`` setup script relies on an exotic extra
880 The command line variant of this flag is ``--extra-prog-path=PATH``,
881 which can be specified multiple times.
883 .. cfg-field:: run-tests: boolean
885 :synopsis: Run package test suite upon installation.
889 Run the package test suite upon installation. This is useful for
890 saying "When this package is installed, check that the test suite
891 passes, terminating the rest of the build if it is broken."
895 One deficiency: the :cfg-field:`run-tests` setting of a package is NOT
896 recorded as part of the hash, so if you install something without
897 :cfg-field:`run-tests` and then turn on ``run-tests``, we won't
898 subsequently test the package. If this is causing you problems, give
901 The command line variant of this flag is ``--run-tests``.
906 .. cfg-field:: debug-info: integer
907 --enable-debug-info=<n>
909 :synopsis: Build with debug info enabled.
914 If the compiler (e.g., GHC 7.10 and later) supports outputing OS
915 native debug info (e.g., DWARF), setting ``debug-info: True`` will
916 instruct it to do so. See the GHC wiki page on :ghc-wiki:`DWARF`
917 for more information about this feature.
919 (This field also accepts numeric syntax, but until GHC 8.2 this didn't
922 The command line variant of this flag is ``--enable-debug-info`` and
923 ``--disable-debug-info``.
925 .. cfg-field:: split-sections: boolean
926 --enable-split-sections
927 --disable-split-sections
928 :synopsis: Use GHC's split sections feature.
933 Use the GHC ``-split-sections`` feature when building the library. This
934 reduces the final size of the executables that use the library by
935 allowing them to link with only the bits that they use rather than
936 the entire library. The downside is that building the library takes
937 longer and uses a bit more memory.
939 This feature is supported by GHC 8.0 and later.
941 The command line variant of this flag is ``--enable-split-sections`` and
942 ``--disable-split-sections``.
944 .. cfg-field:: split-objs: boolean
947 :synopsis: Use GHC's split objects feature.
951 Use the GHC ``-split-objs`` feature when building the library. This
952 reduces the final size of the executables that use the library by
953 allowing them to link with only the bits that they use rather than
954 the entire library. The downside is that building the library takes
955 longer and uses considerably more memory.
957 It is generally recommend that you use ``split-sections`` instead
958 of ``split-objs`` where possible.
960 The command line variant of this flag is ``--enable-split-objs`` and
961 ``--disable-split-objs``.
963 .. cfg-field:: executable-stripping: boolean
964 --enable-executable-stripping
965 --disable-executable-stripping
966 :synopsis: Strip installed programs.
970 When installing binary executable programs, run the ``strip``
971 program on the binary. This can considerably reduce the size of the
972 executable binary file. It does this by removing debugging
973 information and symbols.
975 Not all Haskell implementations generate native binaries. For such
976 implementations this option has no effect.
978 If ``debug-info`` is set explicitly then ``executable-stripping`` is set
979 to ``False`` as otherwise all the debug symbols will be stripped.
981 The command line variant of this flag is
982 ``--enable-executable-stripping`` and
983 ``--disable-executable-stripping``.
985 .. cfg-field:: library-stripping: boolean
986 --enable-library-stripping
987 --disable-library-stripping
988 :synopsis: Strip installed libraries.
991 When installing binary libraries, run the ``strip`` program on the
992 binary, saving space on the file system. See also
993 ``executable-stripping``.
995 If ``debug-info`` is set explicitly then ``library-stripping`` is set
996 to ``False`` as otherwise all the debug symbols will be stripped.
998 The command line variant of this flag is
999 ``--enable-library-stripping`` and ``--disable-library-stripping``.
1004 .. cfg-field:: program-prefix: prefix
1005 --program-prefix=prefix
1006 :synopsis: Prepend prefix to program names.
1008 :strike:`Prepend *prefix* to installed program names.` (Currently
1009 implemented in a silly and not useful way. If you need this to work
1012 *prefix* may contain the following path variables: ``$pkgid``,
1013 ``$pkg``, ``$version``, ``$compiler``, ``$os``, ``$arch``, ``$abi``,
1016 The command line variant of this flag is ``--program-prefix=foo-``.
1018 .. cfg-field:: program-suffix: suffix
1019 --program-suffix=suffix
1020 :synopsis: Append refix to program names.
1022 :strike:`Append *suffix* to installed program names.` (Currently
1023 implemented in a silly and not useful way. If you need this to work
1026 The most obvious use for this is to append the program's version
1027 number to make it possible to install several versions of a program
1028 at once: ``program-suffix: $version``.
1030 *suffix* may contain the following path variables: ``$pkgid``,
1031 ``$pkg``, ``$version``, ``$compiler``, ``$os``, ``$arch``, ``$abi``,
1034 The command line variant of this flag is
1035 ``--program-suffix='$version'``.
1037 Dynamic linking options
1038 ^^^^^^^^^^^^^^^^^^^^^^^
1040 .. cfg-field:: shared: boolean
1043 :synopsis: Build shared library.
1047 Build shared library. This implies a separate compiler run to
1048 generate position independent code as required on most platforms.
1050 The command line variant of this flag is ``--enable-shared`` and
1051 ``--disable-shared``.
1053 .. cfg-field:: executable-dynamic: boolean
1054 --enable-executable-dynamic
1055 --disable-executable-dynamic
1056 :synopsis: Link executables dynamically.
1060 Link executables dynamically. The executable's library dependencies
1061 should be built as shared objects. This implies ``shared: True``
1062 unless ``shared: False`` is explicitly specified.
1064 The command line variant of this flag is
1065 ``--enable-executable-dynamic`` and
1066 ``--disable-executable-dynamic``.
1068 .. cfg-field:: library-for-ghci: boolean
1069 --enable-library-for-ghci
1070 --disable-library-for-ghci
1071 :synopsis: Build libraries suitable for use with GHCi.
1075 Build libraries suitable for use with GHCi. This involves an extra
1076 linking step after the build.
1078 Not all platforms support GHCi and indeed on some platforms, trying
1079 to build GHCi libs fails. In such cases, consider setting
1080 ``library-for-ghci: False``.
1082 The command line variant of this flag is
1083 ``--enable-library-for-ghci`` and ``--disable-library-for-ghci``.
1085 .. cfg-field:: relocatable:
1087 :synopsis: Build relocatable package.
1092 :strike:`Build a package which is relocatable.` (TODO: It is not
1093 clear what this actually does, or if it works at all.)
1095 The command line variant of this flag is ``--relocatable``.
1097 Static linking options
1098 ^^^^^^^^^^^^^^^^^^^^^^
1100 .. cfg-field:: static: boolean
1103 :synopsis: Build static library.
1108 Roll this and all dependent libraries into a combined ``.a`` archive.
1109 This uses GHCs ``-staticlib`` flag, which is available for iOS and with
1110 GHC 8.4 and later for other platforms as well.
1112 .. cfg-field:: executable-static: boolean
1113 --enable-executable-static
1114 --disable-executable-static
1115 :synopsis: Build fully static executables.
1120 Build fully static executables.
1121 This links all dependent libraries into executables statically,
1123 This passes ``-static`` and ``-optl=-static`` to GHC.
1125 Foreign function interface options
1126 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1128 .. cfg-field:: extra-include-dirs: directories (comma or newline separated list)
1129 --extra-include-dirs=DIR
1130 :synopsis: Adds C header search path.
1132 An extra directory to search for C header files. You can use this
1133 flag multiple times to get a list of directories.
1135 You might need to use this flag if you have standard system header
1136 files in a non-standard location that is not mentioned in the
1137 package's ``.cabal`` file. Using this option has the same affect as
1138 appending the directory *dir* to the :pkg-field:`include-dirs` field in each
1139 library and executable in the package's ``.cabal`` file. The
1140 advantage of course is that you do not have to modify the package at
1141 all. These extra directories will be used while building the package
1142 and for libraries it is also saved in the package registration
1143 information and used when compiling modules that use the library.
1145 The command line variant of this flag is
1146 ``--extra-include-dirs=DIR``, which can be specified multiple times.
1148 .. cfg-field:: extra-lib-dirs: directories (comma or newline separated list)
1149 --extra-lib-dirs=DIR
1150 :synopsis: Adds library search directory.
1152 An extra directory to search for system libraries files.
1154 The command line variant of this flag is ``--extra-lib-dirs=DIR``,
1155 which can be specified multiple times.
1157 .. cfg-field:: extra-framework-dirs: directories (comma or newline separated list)
1158 --extra-framework-dirs=DIR
1159 :synopsis: Adds framework search directory (OS X only).
1161 An extra directory to search for frameworks (OS X only).
1163 You might need to use this flag if you have standard system
1164 libraries in a non-standard location that is not mentioned in the
1165 package's ``.cabal`` file. Using this option has the same affect as
1166 appending the directory *dir* to the :cfg-field:`extra-lib-dirs` field in
1167 each library and executable in the package's ``.cabal`` file. The
1168 advantage of course is that you do not have to modify the package at
1169 all. These extra directories will be used while building the package
1170 and for libraries it is also saved in the package registration
1171 information and used when compiling modules that use the library.
1173 The command line variant of this flag is
1174 ``--extra-framework-dirs=DIR``, which can be specified multiple
1180 .. cfg-field:: profiling: boolean
1183 :synopsis: Enable profiling builds.
1188 Build libraries and executables with profiling enabled (for
1189 compilers that support profiling as a separate mode). It is only
1190 necessary to specify :cfg-field:`profiling` for the specific package you
1191 want to profile; ``cabal build`` will ensure that all of its
1192 transitive dependencies are built with profiling enabled.
1194 To enable profiling for only libraries or executables, see
1195 :cfg-field:`library-profiling` and :cfg-field:`executable-profiling`.
1197 For useful profiling, it can be important to control precisely what
1198 cost centers are allocated; see :cfg-field:`profiling-detail`.
1200 The command line variant of this flag is ``--enable-profiling`` and
1201 ``--disable-profiling``.
1203 .. cfg-field:: profiling-detail: level
1204 --profiling-detail=level
1205 :synopsis: Profiling detail level.
1208 Some compilers that support profiling, notably GHC, can allocate
1209 costs to different parts of the program and there are different
1210 levels of granularity or detail with which this can be done. In
1211 particular for GHC this concept is called "cost centers", and GHC
1212 can automatically add cost centers, and can do so in different ways.
1214 This flag covers both libraries and executables, but can be
1215 overridden by the ``library-profiling-detail`` field.
1217 Currently this setting is ignored for compilers other than GHC. The
1218 levels that cabal currently supports are:
1221 For GHC this uses ``exported-functions`` for libraries and
1222 ``toplevel-functions`` for executables.
1224 No costs will be assigned to any code within this component.
1226 Costs will be assigned at the granularity of all top level
1227 functions exported from each module. In GHC, this
1228 is for non-inline functions. Corresponds to ``-fprof-auto-exported``.
1230 Costs will be assigned at the granularity of all top level
1231 functions in each module, whether they are exported from the
1232 module or not. In GHC specifically, this is for non-inline
1233 functions. Corresponds to ``-fprof-auto-top``.
1235 Costs will be assigned at the granularity of all functions in
1236 each module, whether top level or local. In GHC specifically,
1237 this is for non-inline toplevel or where-bound functions or
1238 values. Corresponds to ``-fprof-auto``.
1240 The command line variant of this flag is
1241 ``--profiling-detail=none``.
1243 .. cfg-field:: library-profiling-detail: level
1244 --library-profiling-detail=level
1245 :synopsis: Libraries profiling detail level.
1248 Like :cfg-field:`profiling-detail`, but applied only to libraries
1250 The command line variant of this flag is
1251 ``--library-profiling-detail=none``.
1253 .. cfg-field:: library-vanilla: boolean
1254 --enable-library-vanilla
1255 --disable-library-vanilla
1256 :synopsis: Build libraries without profiling.
1260 Build ordinary libraries (as opposed to profiling libraries).
1261 Mostly, you can set this to False to avoid building ordinary
1262 libraries when you are profiling.
1264 The command line variant of this flag is
1265 ``--enable-library-vanilla`` and ``--disable-library-vanilla``.
1267 .. cfg-field:: library-profiling: boolean
1268 --enable-library-profiling
1269 --disable-library-profiling
1270 :synopsis: Build libraries with profiling enabled.
1275 Build libraries with profiling enabled. You probably want
1276 to use :cfg-field:`profiling` instead.
1278 The command line variant of this flag is
1279 ``--enable-library-profiling`` and ``--disable-library-profiling``.
1281 .. cfg-field:: executable-profiling: boolean
1282 --enable-executable-profiling
1283 --disable-executable-profiling
1284 :synopsis: Build executables with profiling enabled.
1289 Build executables with profiling enabled. You probably want
1290 to use :cfg-field:`profiling` instead.
1292 The command line variant of this flag is
1293 ``--enable-executable-profiling`` and
1294 ``--disable-executable-profiling``.
1299 .. cfg-field:: coverage: boolean
1302 :synopsis: Build with coverage enabled.
1307 Build libraries and executables (including test suites) with Haskell
1308 Program Coverage enabled. Running the test suites will automatically
1309 generate coverage reports with HPC.
1311 The command line variant of this flag is ``--enable-coverage`` and
1312 ``--disable-coverage``.
1314 .. cfg-field:: library-coverage: boolean
1315 --enable-library-coverage
1316 --disable-library-coverage
1322 Deprecated, use :cfg-field:`coverage`.
1324 The command line variant of this flag is
1325 ``--enable-library-coverage`` and ``--disable-library-coverage``.
1330 .. cfg-field:: documentation: boolean
1331 --enable-documentation
1332 --disable-documentation
1333 :synopsis: Enable building of documentation.
1337 Enables building of Haddock documentation.
1338 Implied when calling ``cabal haddock``.
1340 The command line variant of this flag is ``--enable-documentation``
1341 and ``--disable-documentation``.
1343 ``documentation: true`` does not imply
1344 :cfg-field:`haddock-all`,
1345 :cfg-field:`haddock-benchmarks`,
1346 :cfg-field:`haddock-executables`,
1347 :cfg-field:`haddock-internal` or
1348 :cfg-field:`haddock-tests`.
1349 These need to be enabled separately if desired.
1351 .. cfg-field:: doc-index-file: templated path
1352 --doc-index-file=TEMPLATE
1353 :synopsis: Path to haddock templates.
1355 A central index of Haddock API documentation (template cannot use
1356 ``$pkgid``), which should be updated as documentation is built.
1358 The following commands are equivalent to ones that would be passed when
1359 running ``setup haddock``.
1361 .. cfg-field:: haddock-hoogle: boolean
1363 :synopsis: Generate Hoogle file.
1367 Generate a text file which can be converted by Hoogle_
1368 into a database for searching.
1369 This is equivalent to running ``haddock`` with the ``--hoogle`` flag.
1371 .. cfg-field:: haddock-html: boolean
1373 :synopsis: Build HTML documentation.
1377 Build HTML documentation.
1379 .. cfg-field:: haddock-quickjump: boolean
1381 :synopsis: Generate Quickjump file.
1385 Generate an index for interactive documentation navigation.
1386 This is equivalent to running ``haddock`` with the ``--quickjump`` flag.
1388 .. cfg-field:: haddock-html-location: templated path
1389 --haddock-html-location=TEMPLATE
1390 :synopsis: Haddock HTML templates location.
1392 Specify a template for the location of HTML documentation for
1393 prerequisite packages. The substitutions are applied to the template
1394 to obtain a location for each package, which will be used by
1395 hyperlinks in the generated documentation. For example, the
1396 following command generates links pointing at Hackage pages:
1400 html-location: http://hackage.haskell.org/packages/archive/$pkg/latest/doc/html
1402 If passed on the command line,
1403 the argument may be quoted to prevent substitution by the shell.
1407 --html-location='http://hackage.haskell.org/packages/archive/$pkg/latest/doc/html'
1409 If this option is omitted, the location for each package is obtained
1410 using the package tool (e.g. ``ghc-pkg``).
1412 .. cfg-field:: haddock-executables: boolean
1413 --haddock-executables
1414 :synopsis: Generate documentation for executables.
1418 Run haddock on all executable programs.
1420 .. cfg-field:: haddock-tests: boolean
1422 :synopsis: Generate documentation for tests.
1426 Run haddock on all test suites.
1428 .. cfg-field:: haddock-benchmarks: boolean
1429 --haddock-benchmarks
1430 :synopsis: Generate documentation for benchmarks.
1434 Run haddock on all benchmarks.
1436 .. cfg-field:: haddock-internal: boolean
1438 :synopsis: Generate documentation for internal modules
1442 Build haddock documentation which includes unexposed modules and
1445 .. cfg-field:: haddock-all: boolean
1447 :synopsis: Generate documentation for everything
1451 Run haddock on all components.
1453 .. cfg-field:: haddock-css: path
1455 :synopsis: Location of Haddock CSS file.
1457 The CSS file that should be used to style the generated
1458 documentation (overriding haddock's default).
1460 .. cfg-field:: haddock-hyperlink-source: boolean
1461 --haddock-hyperlink-source
1462 :synopsis: Generate hyperlinked source code for documentation
1466 Generated hyperlinked source code using `HsColour`_, and have
1467 Haddock documentation link to it.
1468 This is equivalent to running ``haddock`` with the ``--hyperlinked-source`` flag.
1470 .. cfg-field:: haddock-hscolour-css: path
1471 --haddock-hscolour-css=PATH
1472 :synopsis: Location of CSS file for HsColour
1474 The CSS file that should be used to style the generated hyperlinked
1475 source code (from `HsColour`_).
1477 .. cfg-field:: haddock-contents-location: URL
1478 --haddock-contents-location=URL
1479 :synopsis: URL for contents page.
1481 A baked-in URL to be used as the location for the contents page.
1483 .. cfg-field:: haddock-keep-temp-files: boolean
1484 :synopsis: Keep temporary Haddock files.
1486 Keep temporary files.
1488 There is no command line variant of this flag.
1490 .. cfg-field:: open: boolean
1492 :synopsis: Open generated documentation in-browser.
1494 When generating HTML documentation, attempt to open it in a browser
1495 when complete. This will use ``xdg-open`` on Linux and BSD systems,
1496 ``open`` on macOS, and ``start`` on Windows.
1498 Advanced global configuration options
1499 -------------------------------------
1501 .. cfg-field:: write-ghc-environment-files: always, never, or ghc8.4.4+
1502 --write-ghc-environment-files=policy
1503 :synopsis: Whether a ``.ghc.environment`` should be created after a successful build.
1507 Whether a `GHC package environment file <https://downloads.haskell.org/~ghc/master/users-guide/packages.html#package-environments>`_
1508 should be created after a successful build.
1510 Since Cabal 3.0, defaults to ``never``. Before that, defaulted to
1511 creating them only when compiling with GHC 8.4.4 and older (GHC
1512 8.4.4 `is the first version
1513 <https://gitlab.haskell.org/ghc/ghc/-/issues/13753>`_ that supports
1514 the ``-package-env -`` option that allows ignoring the package
1517 .. cfg-field:: build-info: True, False
1519 --disable-build-info
1520 :synopsis: Whether build information for each individual component should be
1521 written in a machine readable format.
1525 Enable generation of build information for Cabal components. Contains very
1526 detailed information on how to build an individual component, such as
1527 compiler version, modules of a component and how to compile the component.
1529 The output format is in json, and the exact location can be discovered from
1530 ``plan.json``, where it is identified by ``build-info`` within the items in
1531 the ``install-plan``.
1532 Note, that this field in ``plan.json`` can be ``null``, if and only if
1533 ``build-type: Custom`` is set, and the ``Cabal`` version is too
1534 old (i.e. ``< 3.7``).
1535 If the field is missing entirely, the component is not a local one, thus,
1536 no ``build-info`` exists for that particular component within the
1540 The format and fields of the generated build information is currently experimental,
1541 in the future we might add or remove fields, depending on the needs of other tooling.
1544 .. cfg-field:: http-transport: curl, wget, powershell, or plain-http
1545 --http-transport=transport
1546 :synopsis: Transport to use with http(s) requests.
1550 Set a transport to be used when making http(s) requests.
1552 The command line variant of this field is ``--http-transport=curl``.
1554 .. cfg-field:: ignore-expiry: boolean
1556 :synopsis: Ignore Hackage expiration dates.
1560 If ``True``, we will ignore expiry dates on metadata from Hackage.
1562 In general, you should not set this to ``True`` as it will leave you
1563 vulnerable to stale cache attacks. However, it may be temporarily
1564 useful if the main Hackage server is down, and we need to rely on
1565 mirrors which have not been updated for longer than the expiry
1566 period on the timestamp.
1568 The command line variant of this field is ``--ignore-expiry``.
1570 .. cfg-field:: remote-repo-cache: directory
1571 --remote-repo-cache=DIR
1572 :synopsis: Location of packages cache.
1574 :default: ``~/.cabal/packages``
1576 :strike:`The location where packages downloaded from remote
1577 repositories will be cached.` Not implemented yet.
1579 The command line variant of this flag is
1580 ``--remote-repo-cache=DIR``.
1582 .. cfg-field:: logs-dir: directory
1584 :synopsis: Directory to store build logs.
1586 :default: ``~/.cabal/logs``
1588 :strike:`The location where build logs for packages are stored.`
1589 Not implemented yet.
1591 The command line variant of this flag is ``--logs-dir=DIR``.
1593 .. cfg-field:: build-summary: template filepath
1594 --build-summary=TEMPLATE
1595 :synopsis: Build summaries location.
1597 :default: ``~/.cabal/logs/build.log``
1599 :strike:`The file to save build summaries.` Not implemented yet.
1601 Valid variables which can be used in the path are ``$pkgid``,
1602 ``$compiler``, ``$os`` and ``$arch``.
1604 The command line variant of this flag is
1605 ``--build-summary=TEMPLATE``.
1607 Undocumented fields: ``root-cmd``, ``symlink-bindir``, ``build-log``,
1608 ``remote-build-reporting``, ``report-planned-failure``, ``offline``.
1610 Advanced solver options
1611 ^^^^^^^^^^^^^^^^^^^^^^^
1613 Most users generally won't need these.
1615 .. cfg-field:: solver: modular
1617 :synopsis: Which solver to use.
1619 This field is reserved to allow the specification of alternative
1620 dependency solvers. At the moment, the only accepted option is
1623 The command line variant of this field is ``--solver=modular``.
1625 .. cfg-field:: max-backjumps: nat
1627 :synopsis: Maximum number of solver backjumps.
1631 Maximum number of backjumps (backtracking multiple steps) allowed
1632 while solving. Set -1 to allow unlimited backtracking, and 0 to
1633 disable backtracking completely.
1635 The command line variant of this field is ``--max-backjumps=4000``.
1637 .. cfg-field:: reorder-goals: boolean
1640 :synopsis: Allow solver to reorder goals.
1644 When enabled, the solver will reorder goals according to certain
1645 heuristics. Slows things down on average, but may make backtracking
1646 faster for some packages. It's unlikely to help for small projects,
1647 but for big install plans it may help you find a plan when otherwise
1648 this is not possible. See :issue:`1780` for more commentary.
1650 The command line variant of this field is ``--(no-)reorder-goals``.
1652 .. cfg-field:: count-conflicts: boolean
1654 --no-count-conflicts
1655 :synopsis: Solver prefers versions with less conflicts.
1659 Try to speed up solving by preferring goals that are involved in a
1662 The command line variant of this field is
1663 ``--(no-)count-conflicts``.
1665 .. cfg-field:: fine-grained-conflicts: boolean
1666 --fine-grained-conflicts
1667 --no-fine-grained-conflicts
1668 :synopsis: Skip a version of a package if it does not resolve any conflicts
1669 encountered in the last version (solver optimization).
1673 When enabled, the solver will skip a version of a package if it does not
1674 resolve any of the conflicts encountered in the last version of that
1675 package. For example, if ``foo-1.2`` depended on ``bar``, and the solver
1676 couldn't find consistent versions for ``bar``'s dependencies, then the
1677 solver would skip ``foo-1.1`` if it also depended on ``bar``.
1679 The command line variant of this field is
1680 ``--(no-)fine-grained-conflicts``.
1682 .. cfg-field:: minimize-conflict-set: boolean
1683 --minimize-conflict-set
1684 --no-minimize-conflict-set
1685 :synopsis: Try to improve the solver error message when there is no
1690 When there is no solution, try to improve the solver error message
1691 by finding a minimal conflict set. This option may increase run
1692 time significantly, so it is off by default.
1694 The command line variant of this field is
1695 ``--(no-)minimize-conflict-set``.
1697 .. cfg-field:: strong-flags: boolean
1700 :synopsis: Do not defer flag choices when solving.
1704 Do not defer flag choices. (TODO: Better documentation.)
1706 The command line variant of this field is ``--(no-)strong-flags``.
1708 .. cfg-field:: allow-boot-library-installs: boolean
1709 --allow-boot-library-installs
1710 --no-allow-boot-library-installs
1711 :synopsis: Allow cabal to install or upgrade any package.
1715 By default, the dependency solver doesn't allow ``base``,
1716 ``ghc-prim``, ``integer-simple``, ``integer-gmp``, and
1717 ``template-haskell`` to be installed or upgraded. This flag
1718 removes the restriction.
1720 The command line variant of this field is
1721 ``--(no-)allow-boot-library-installs``.
1723 .. cfg-field:: cabal-lib-version: version
1724 --cabal-lib-version=version
1725 :synopsis: Version of Cabal library used to build package.
1727 This field selects the version of the Cabal library which should be
1728 used to build packages. This option is intended primarily for
1729 internal development use (e.g., forcing a package to build with a
1730 newer version of Cabal, to test a new version of Cabal.) (TODO:
1731 Specify its semantics more clearly.)
1733 The command line variant of this field is
1734 ``--cabal-lib-version=1.24.0.1``.
1736 .. cfg-field:: prefer-oldest: boolean
1739 :synopsis: Prefer the oldest versions of packages available.
1744 By default, when solver has a choice of multiple versions of the same
1745 package, it will first try to derive a build plan with the latest
1746 version. This flag switches the behaviour, making the solver
1747 to prefer the oldest packages available.
1749 The primary use case is to help users in establishing lower bounds
1750 of upstream dependencies.
1752 The command line variant of this field is ``--(no-)prefer-oldest``.
1754 .. include:: references.inc