Cabal Syntax Quicklinks

 
cabal.project fields
Specifying the local packages
    packages Project packages.
    optional-packages Optional project packages.
    extra-packages Adds external packages as local
Taking a dependency from a source code repository
    type
    location
    branch
    tag
    subdir
    post-checkout-command
Global configuration options
    verbose Build verbosity level.
    jobs Number of builds running in parallel.
    semaphore Use GHC's support for semaphore based parallelism.
    keep-going Try to continue building on failure.
    package-dbs (since version: 3.7) PackageDB stack manipulation
Solver configuration options
    constraints Extra dependencies constraints.
    preferences Preferred dependency versions.
    allow-newer Lift dependencies upper bound constraints.
    allow-older (since version: 2.0) Lift dependency lower bound constraints.
    index-state (since version: 2.0) Use source package index state as it existed at a previous time.
    active-repositories
    reject-unconstrained-dependencies Restrict the solver to packages that have constraints on them.
Package configuration options
    package
    flags Enable or disable package flags.
    with-compiler Path to compiler executable.
    with-hc-pkg Path to package tool.
    optimization Build with optimization.
    configure-options Options to pass to configure script.
    compiler Compiler to build with.
    tests Build tests.
    benchmarks Build benchmarks.
    extra-prog-path (since version: 1.18) Add directories to program search path.
    run-tests Run package test suite during installation.
Object code options
    debug-info (since version: 1.22) Build with debug info enabled.
    split-sections (since version: 2.2) Use GHC's split sections feature.
    split-objs Use GHC's split objects feature.
    executable-stripping Strip installed programs.
    library-stripping (since version: 1.20) Strip installed libraries.
Executable options
    program-prefix Prepend prefix to program names.
    program-suffix Append refix to program names.
Dynamic linking options
    shared Build shared library.
    executable-dynamic Link executables dynamically.
    library-for-ghci Build libraries suitable for use with GHCi.
    relocatable (since version: 1.22) Build relocatable package.
Static linking options
    static Build static library.
    executable-static Build fully static executables.
Foreign function interface options
    extra-include-dirs Adds C header search path.
    extra-lib-dirs Adds library search directory.
    extra-framework-dirs Adds framework search directory (OS X only).
Profiling options
    profiling (since version: 1.22) Enable profiling builds.
    profiling-detail (since version: 1.24) Profiling detail level.
    library-profiling-detail (since version: 1.24) Libraries profiling detail level.
    library-vanilla Build libraries without profiling.
    library-profiling (since version: 1.22) Build libraries with profiling enabled.
    executable-profiling (since version: 1.22) Build executables with profiling enabled.
Coverage options
    coverage (since version: 1.22) Build with coverage enabled.
    library-coverage (deprecated)
Haddock options
    documentation Enable building of documentation.
    doc-index-file Path to haddock templates.
    haddock-hoogle Generate Hoogle file.
    haddock-html Build HTML documentation.
    haddock-quickjump Generate Quickjump file.
    haddock-html-location Location of HTML documentation for prerequisite packages.
    haddock-executables Generate documentation for executables.
    haddock-tests Generate documentation for tests.
    haddock-benchmarks Generate documentation for benchmarks.
    haddock-internal Generate documentation for internal modules
    haddock-all Generate documentation for everything
    haddock-css Location of Haddock CSS file.
    haddock-hyperlink-source Generate hyperlinked source code for documentation
    haddock-hscolour-css Location of CSS file for HsColour
    haddock-contents-location URL for contents page.
    haddock-keep-temp-files Keep temporary Haddock files.
    haddock-output-dir Generate haddock documentation into this directory.
    haddock-use-unicode Pass --use-unicode option to haddock.
    haddock-resources-dir Location of Haddock's static/auxiliary files.
    open Open generated documentation in-browser.
Program options
    program-options
Advanced global configuration options
    write-ghc-environment-files Whether a ``.ghc.environment`` should be created after a successful build.
    build-info Whether build information for each individual component should be written in a machine readable format.
    http-transport Transport to use with http(s) requests.
    ignore-expiry Ignore Hackage expiration dates.
    remote-repo-cache Location of packages cache.
    logs-dir Directory to store build logs.
    build-summary Build summaries location.
Advanced solver options
    solver Which solver to use.
    max-backjumps Maximum number of solver backjumps.
    reorder-goals Allow solver to reorder goals.
    count-conflicts Solver prefers versions with less conflicts.
    fine-grained-conflicts Skip a version of a package if it does not resolve any conflicts encountered in the last version (solver optimization).
    minimize-conflict-set Try to improve the solver error message when there is no solution.
    strong-flags Do not defer flag choices when solving.
    allow-boot-library-installs Allow cabal to install or upgrade any package.
    cabal-lib-version Version of Cabal library used to build package.
    prefer-oldest (since version: 3.10) Prefer the oldest versions of packages available.
 
cabal project flags
Global configuration options
    -v[n] Build verbosity level.
    -j[NUM] Number of builds running in parallel.
    --semaphore Use GHC's support for semaphore based parallelism.
    --no-semaphore Use GHC's support for semaphore based parallelism.
    --keep-going Try to continue building on failure.
    --package-db (since version: 3.7) PackageDB stack manipulation
Solver configuration options
    -c Extra dependencies constraints.
    --constraint Extra dependencies constraints.
    --preference Preferred dependency versions.
    --allow-newer Lift dependencies upper bound constraints.
    --allow-older (since version: 2.0) Lift dependency lower bound constraints.
    --reject-unconstrained-dependencies Restrict the solver to packages that have constraints on them.
Package configuration options
    package
    -f Enable or disable package flags.
    --flags Enable or disable package flags.
    -w Path to compiler executable.
    --with-hc-pkg Path to package tool.
    -O[n] Build with optimization.
    --disable-optimization Build with optimization.
    --configure-option Options to pass to configure script.
    --compiler Compiler to build with.
    --enable-tests Build tests.
    --disable-tests Build tests.
    --enable-benchmarks Build benchmarks.
    --disable-benchmarks Build benchmarks.
    --extra-prog-path (since version: 1.18) Add directories to program search path.
    --run-tests Run package test suite during installation.
Object code options
    --enable-debug-info[ (since version: 1.22) Build with debug info enabled.
    --disable-debug-info (since version: 1.22) Build with debug info enabled.
    --enable-split-sections (since version: 2.2) Use GHC's split sections feature.
    --disable-split-sections (since version: 2.2) Use GHC's split sections feature.
    --enable-split-objs Use GHC's split objects feature.
    --disable-split-objs Use GHC's split objects feature.
    --enable-executable-stripping Strip installed programs.
    --disable-executable-stripping Strip installed programs.
    --enable-library-stripping (since version: 1.20) Strip installed libraries.
    --disable-library-stripping (since version: 1.20) Strip installed libraries.
Executable options
    --program-prefix Prepend prefix to program names.
    --program-suffix Append refix to program names.
Dynamic linking options
    --enable-shared Build shared library.
    --disable-shared Build shared library.
    --enable-executable-dynamic Link executables dynamically.
    --disable-executable-dynamic Link executables dynamically.
    --enable-library-for-ghci Build libraries suitable for use with GHCi.
    --disable-library-for-ghci Build libraries suitable for use with GHCi.
    --relocatable (since version: 1.22) Build relocatable package.
Static linking options
    --enable-static Build static library.
    --disable-static Build static library.
    --enable-executable-static Build fully static executables.
    --disable-executable-static Build fully static executables.
Foreign function interface options
    --extra-include-dirs Adds C header search path.
    --extra-lib-dirs Adds library search directory.
    --extra-framework-dirs Adds framework search directory (OS X only).
Profiling options
    --enable-profiling (since version: 1.22) Enable profiling builds.
    --disable-profiling (since version: 1.22) Enable profiling builds.
    --profiling-detail (since version: 1.24) Profiling detail level.
    --library-profiling-detail (since version: 1.24) Libraries profiling detail level.
    --enable-library-vanilla Build libraries without profiling.
    --disable-library-vanilla Build libraries without profiling.
    --enable-library-profiling (since version: 1.22) Build libraries with profiling enabled.
    --disable-library-profiling (since version: 1.22) Build libraries with profiling enabled.
    --enable-executable-profiling (since version: 1.22) Build executables with profiling enabled.
    --disable-executable-profiling (since version: 1.22) Build executables with profiling enabled.
Coverage options
    --enable-coverage (since version: 1.22) Build with coverage enabled.
    --disable-coverage (since version: 1.22) Build with coverage enabled.
    --enable-library-coverage (deprecated)
    --disable-library-coverage (deprecated)
Haddock options
    --enable-documentation Enable building of documentation.
    --disable-documentation Enable building of documentation.
    --doc-index-file Path to haddock templates.
    --haddock-hoogle Generate Hoogle file.
    --haddock-html Build HTML documentation.
    --haddock-quickjump Generate Quickjump file.
    --haddock-html-location Location of HTML documentation for prerequisite packages.
    --haddock-executables Generate documentation for executables.
    --haddock-tests Generate documentation for tests.
    --haddock-benchmarks Generate documentation for benchmarks.
    --haddock-internal Generate documentation for internal modules
    --haddock-all Generate documentation for everything
    --haddock-css Location of Haddock CSS file.
    --haddock-hyperlink-source Generate hyperlinked source code for documentation
    --haddock-hscolour-css Location of CSS file for HsColour
    --haddock-contents-location URL for contents page.
    --haddock-output-dir Generate haddock documentation into this directory.
    --haddock-use-unicode Pass --use-unicode option to haddock.
    --haddock-resources-dir Location of Haddock's static/auxiliary files.
    --open Open generated documentation in-browser.
Program options
    program-options
Advanced global configuration options
    --write-ghc-environment-files Whether a ``.ghc.environment`` should be created after a successful build.
    --enable-build-info Whether build information for each individual component should be written in a machine readable format.
    --disable-build-info Whether build information for each individual component should be written in a machine readable format.
    --http-transport Transport to use with http(s) requests.
    --ignore-expiry Ignore Hackage expiration dates.
    --remote-repo-cache Location of packages cache.
    --logs-dir Directory to store build logs.
    --build-summary Build summaries location.
Advanced solver options
    --solver Which solver to use.
    --max-backjumps Maximum number of solver backjumps.
    --reorder-goals Allow solver to reorder goals.
    --no-reorder-goals Allow solver to reorder goals.
    --count-conflicts Solver prefers versions with less conflicts.
    --no-count-conflicts Solver prefers versions with less conflicts.
    --fine-grained-conflicts Skip a version of a package if it does not resolve any conflicts encountered in the last version (solver optimization).
    --no-fine-grained-conflicts Skip a version of a package if it does not resolve any conflicts encountered in the last version (solver optimization).
    --minimize-conflict-set Try to improve the solver error message when there is no solution.
    --no-minimize-conflict-set Try to improve the solver error message when there is no solution.
    --strong-flags Do not defer flag choices when solving.
    --no-strong-flags Do not defer flag choices when solving.
    --allow-boot-library-installs Allow cabal to install or upgrade any package.
    --no-allow-boot-library-installs Allow cabal to install or upgrade any package.
    --cabal-lib-version Version of Cabal library used to build package.
    --prefer-oldest (since version: 3.10) Prefer the oldest versions of packages available.
    --no-prefer-oldest (since version: 3.10) Prefer the oldest versions of packages available.
 
package.cabal fields
Package properties
    name
    version
    cabal-version
    build-type
    license
    license-file
    license-files (since version: 1.20)
    copyright
    author
    maintainer
    stability
    homepage
    bug-reports
    package-url
    synopsis
    description
    category
    tested-with
    data-files
    data-dir
    extra-source-files
    extra-doc-files (since version: 1.18)
    extra-tmp-files
    extra-files
Library
    library Library build information.
    visibility
    exposed-modules
    virtual-modules (since version: 2.2)
    exposed
    reexported-modules (since version: 1.22)
    signatures (since version: 2.0)
Executables
    executable Executable build info section.
    main-is
    scope (since version: 2.0)
Test suites
    test-suite Test suite build information.
    type
    main-is Module containing tests main function.
    test-module
    code-generators
Benchmarks
    benchmark (since version: 1.9.2) Benchmark build information.
    type
    main-is
Build information
    build-depends
    other-modules
    hs-source-dir (removed in: 3.0; deprecated since: 2.0)
    hs-source-dirs
    default-extensions (since version: 1.12)
    other-extensions (since version: 1.12)
    default-language (since version: 1.12)
    other-languages (since version: 1.12)
    extensions (removed in: 3.0; deprecated since: 1.12)
    build-tool-depends (since version: 2.0)
    build-tools (removed in: 3.0; deprecated since: 2.0)
    buildable
    ghc-options
    ghc-prof-options
    ghc-shared-options
    ghc-prof-shared-options
    ghcjs-options
    ghcjs-prof-options
    ghcjs-shared-options
    ghcjs-prof-shared-options
    includes (deprecated since: 2.0)
    install-includes
    include-dirs
    c-sources
    cxx-sources (since version: 2.2)
    asm-sources (since version: 3.0)
    cmm-sources (since version: 3.0)
    js-sources
    extra-libraries
    extra-libraries-static
    extra-ghci-libraries
    extra-bundled-libraries (since version: 2.2)
    extra-lib-dirs
    extra-lib-dirs-static
    extra-library-flavours
    extra-dynamic-library-flavours
    cc-options
    cpp-options
    cxx-options (since version: 2.2)
    cmm-options (since version: 3.0)
    asm-options (since version: 3.0)
    ld-options
    hsc2hs-options (since version: 3.6)
    pkgconfig-depends
    frameworks
    extra-framework-dirs (since version: 1.24)
    mixins (since version: 2.0)
Foreign libraries
    foreign-library (since version: 2.0) Foreign library build information.
    type
    options
    mod-def-file
    lib-version-info
    lib-version-linux
Configuration Flags
    flag Flag declaration.
    description
    default
    manual
Common stanzas
    common (since version: 2.2) Common build info section
    import
Source code repository marker
    source-repository (since version: 1.6)
    type
    location
    module
    branch
    tag
    subdir
Custom setup scripts
    custom-setup (since version: 1.24) Build information for ``Custom`` and ``Hooks`` build types
    setup-depends (since version: 1.24)
Autogenerated modules and includes
    autogen-modules (since version: 2.0)
    autogen-includes (since version: 3.0)