7. Package Description Format Specification History¶
Package descriptions need to specify the version of the
specification they need to be interpreted in via the
cabal-version declaration. The following list describes
changes that occurred in each version of the cabal specification
relative to the respective preceding published version.
Note
The sequence of specification version numbers is not
contiguous because it’s synchronised with the version of the
Cabal library. As a consequence, only even versions are
considered proper published versions of the specification as odd
versions of the Cabal library denote unreleased development
branches which have no stability guarantee.
7.1. cabal-version: 3.0¶
Added the
extra-dynamic-library-flavoursfield to specify non-trivial variants of dynamic flavours. It isextra-library-flavoursbut for shared libraries. Mainly useful for GHC’s RTS library.Free text fields (e.g.
description) preserve empty lines and indentation. In other words, you don’t need to add dots for blank lines.License fields use identifiers from SPDX License List version
3.6 2019-07-10Remove deprecated
hs-source-dir,extensionsandbuild-toolsfields.Common stanzas are now allowed also in the beginnning of conditional sections. In other words, the following is valid
library import deps if flag(foo) import foo-depsAllow redundant leading or trailing commas in package fields with optional commas, such as
exposed-modulesRequire fields with optional commas to consistently omit or place commas between elements.
Changed the behavior of
extra-bundled-librariesfield. The naming convention of dynamic library files (e.g. generated by a custom build script) has changed. For library names prefixed with “C”, the dynamic library file name(s) must be of the form lib<library-name>.<dyn-library-extension>* instead of the old libC<library-name>-ghc<ghc-flavour><ghc-version>.<dyn-library-extension>New set-notation syntax for
==and^>=operators, seebuild-dependsfield documentation for examples.Allow more whitespace in
mixinsfieldWildcards are disallowed in
pkgconfig-depends, Yet the pkgconfig format is relaxed to accept e.g. versions like1.1.0h.New
autogen-includesfor specifyinginstall-includeswhich are autogenerated (e.g. by aconfigurescript).New
asm-sourcesandasm-optionsfields added for suppporting bundled foreign routines implemented in assembler.New
cmm-sourcesandcmm-optionsfields added for suppporting bundled foreign primops implemented in C–.
7.2. cabal-version: 2.4¶
- Wildcard matching has been expanded. All previous wildcard
expressions are still valid; some will match strictly more files
than before. Specifically:
- Double-star (
**) wildcards are now accepted for recursive matching immediately before the final slash; they must be followed by a filename wildcard (e.g.,foo/**/*.htmlis valid;foo/**/bar/*.htmlandfoo/**/**/*.html,foo/**/bar.htmlare all invalid). As**was an error in globs before, this does not affect any existing.cabalfiles that previously worked. - Wildcards now match when the pattern’s extensions form a suffix of
the candidate file’s extension, rather than requiring strict
equality (e.g., previously
*.htmldid not matchfoo.en.html, but now it does).
- Double-star (
- License fields use identifiers from SPDX License List version
3.2 2018-07-10
7.3. cabal-version: 2.2¶
- New
commonstanzas andimportpseudo-field added. - New
library:virtual-modulesfield added. - New
cxx-sourcesandcxx-optionsfields added for suppporting bundled foreign routines implemented in C++. - New
extra-bundled-librariesfield for specifying additional custom library objects to be installed. - Extended
ifcontrol structure with support forelifkeyword. - Changed default rules of
build-typefield to infer “build-type:” for “Simple”/”Custom” automatically. licensefield syntax changed to require SPDX expression syntax (using SPDX license list version3.0 2017-12-28).- Allow redundant leading or trailing commas in package fields (which
require commas) such as
build-depends.
7.4. cabal-version: 2.0¶
- New
library:signaturesandmixinsfields added for supporting Backpack. - New
build-tool-dependsfield added for adding build-time dependencies of executable components. - New
custom-setup:autogen-modulesfield added for declaring modules which are generated at build time. - Support for new PVP caret-style version operator (
^>=) added tobuild-depends. - Add support for new
foreign-librarystanza. - Add support for internal library stanzas.
- New CPP Macro
CURRENT_PACKAGE_VERSION.
7.5. cabal-version: 1.24¶
- New
custom-setupstanza andcustom-setup:setup-dependsfield added for specifying dependencies of customSetup.hsscripts. - CPP Macros
VERSION_$pkgnameandMIN_VERSION_$pkgnameare now also generated for the current package. - New CPP Macros
CURRENT_COMPONENT_IDandCURRENT_PACKAGE_KEY. - New
extra-framework-dirsfield added for specifying extra locations to find OS X frameworks.
7.6. cabal-version: 1.22¶
- New
library:reexported-modulesfield. - Support for
-noneversion constraint added tobuild-depends. - New
licensetypeISCadded.
7.7. cabal-version: 1.20¶
- Add support for new
license-filesfield for declaring multiple license documents. - New CPP Macro
MIN_TOOL_VERSION_$buildtool. - New
licensetypesBSD2andMPL-2.0added.
7.8. cabal-version: 1.18¶
- Add support for new
extra-doc-filesfield for specifying extra file assets referenced by the Haddock documentation. - New
licensetypeAGPLandAGPL-3added. - Add support for specifying a C/C++/obj-C source file in
executable:main-isfield. - Add
getSysconfDiroperation toPaths_API.
7.9. cabal-version: 1.16¶
Todo
this needs to be researched; there were only few changes between 1.12 and 1.18;
7.10. cabal-version: 1.12¶
- Change syntax of
cabal-versionto support the new recommendedcabal-version: x.ystyle