3 ==================================================
4 Package Description Format Specification History
5 ==================================================
7 :ref:`pkg-desc` need to specify the version of the
8 specification they need to be interpreted in via the
9 :pkg-field:`cabal-version` declaration. The following list describes
10 changes that occurred in each version of the cabal specification
11 relative to the respective preceding *published* version.
15 The sequence of specification version numbers is *not*
16 contiguous because it's synchronised with the version of the
17 ``Cabal`` library. As a consequence, only *even* versions are
18 considered proper published versions of the specification as *odd*
19 versions of the ``Cabal`` library denote unreleased development
20 branches which have no stability guarantee.
22 ``cabal-version: 3.14``
23 -----------------------
25 * Added field ``extra-files`` for specifying extra files to be included in
26 ``sdist`` without adding any other semantics (cf. ``extra-source-files``
27 is tracked by ``cabal build``).
29 ``cabal-version: 3.12``
30 -----------------------
32 * License fields use identifiers from SPDX License List version
36 ``cabal-version: 3.8``
37 ----------------------
39 * Added field ``code-generators`` to :pkg-section:`test-suite` stanzas. This
40 enumerates executabes (possibly brought into scope by :pkg-field:`build-tool-depends`) that are run after all other
41 preprocessors. These executables are invoked with a target dir for
42 output, a sequence of all source directories with source files of
43 local lib components that the given test stanza depends on, and
44 following a double dash, all options cabal would pass to ghc for a
45 build. They are expected to output a newline-separated list of
46 generated modules which have been written to the targetdir. This can
47 be used for driving doctests and other discover-style tests generated
50 * Added fields :pkg-field:`extra-libraries-static` and
51 :pkg-field:`extra-lib-dirs-static` to allow Haskell libraries to remember
52 linker flags needed for fully static linking of system libraries into
54 The existing field :pkg-field:`pkgconfig-depends` can used to append
55 the relevant output of ``pkg-config --libs --static`` to these new fields
57 When :pkg-field:`extra-libraries-static` is not given, it defaults to
58 :pkg-field:`extra-libraries`.
59 When :pkg-field:`extra-lib-dirs-static` is not given, it defaults to
60 :pkg-field:`extra-lib-dirs`.
62 * Wildcard matching has been slightly expanded. Matches are now
63 allowed of the form ``foo/**/literalFile``. Prior, double-star
64 wildcards required the trailing filename itself be a wildcard.
66 * Allow the omission of the `type` field in `test-suite` and `benchmark` stanzas
67 when the type can be inferred by the presence of `main-is` or `test-module`.
69 * License fields use identifiers from SPDX License List version
72 ``cabal-version: 3.6``
73 ----------------------
75 * License fields use identifiers from SPDX License List version
78 * Add :pkg-field:`hsc2hs-options`
80 ``cabal-version: 3.4``
81 ----------------------
84 * License fields use identifiers from SPDX License List version
87 * Dependencies to sublibraries must be specified explicitly,
88 even for current package.
89 For example: ``build-depends: mypackage:my-sublib``
90 This way you can have a sublibrary with the same
91 name as some external dependency.
93 * Remove ``-any`` and ``-none`` syntax for version ranges
94 Use ``>=0`` and ``<0`` respectively.
96 * :pkg-field:`default-language` is optional.
97 The Default value is to use the compiler's default language.
99 * :pkg-field:`mixins` field allow specifying a sublibrary.
101 ``cabal-version: 3.0``
102 ----------------------
104 * New :pkg-field:`library:visibility` for exposing sublibraries.
106 * New ``pkg:lib`` and ``pkg:{lib1,lib2}`` syntax in :pkg-field:`build-depends`
107 for depending on public sublibraries from other packages.
109 * Added the :pkg-field:`extra-dynamic-library-flavours` field to specify non-trivial
110 variants of dynamic flavours. It is :pkg-field:`extra-library-flavours` but for
111 shared libraries. Mainly useful for GHC's RTS library.
113 * Free text fields (e.g. :pkg-field:`description`) preserve empty lines
114 and indentation. In other words, you don't need to add dots for blank lines.
116 * License fields use identifiers from SPDX License List version
119 * Remove deprecated ``hs-source-dir``, :pkg-field:`extensions` and
120 :pkg-field:`build-tools` fields.
122 * Common stanzas are now allowed also in the beginning of conditional
123 sections. In other words, the following is valid
133 * Allow redundant leading or trailing commas in package fields with
134 optional commas, such as :pkg-field:`library:exposed-modules`
136 * Require fields with optional commas to consistently omit or place
137 commas between elements.
139 * Changed the behavior of :pkg-field:`extra-bundled-libraries` field. The naming convention
140 of dynamic library files (e.g. generated by a custom build script) has
141 changed. For library names prefixed with "C", the dynamic library file
142 name(s) must be of the form `lib<library-name>.<dyn-library-extension>*`
143 instead of the old `libC<library-name>-ghc<ghc-flavour><ghc-version>.<dyn-library-extension>`
145 * New set-notation syntax for ``==`` and ``^>=`` operators, see
146 :pkg-field:`build-depends` field documentation for examples.
148 * Allow more whitespace in :pkg-field:`mixins` field
150 * Wildcards are disallowed in :pkg-field:`pkgconfig-depends`,
151 Yet the pkgconfig format is relaxed to accept e.g. versions like ``1.1.0h``.
153 * New :pkg-field:`autogen-includes` for specifying :pkg-field:`install-includes`
154 which are autogenerated (e.g. by a ``configure`` script).
156 * New :pkg-field:`asm-sources` and :pkg-field:`asm-options` fields
157 added for supporting bundled foreign routines implemented in
160 * New :pkg-field:`cmm-sources` and :pkg-field:`cmm-options` fields
161 added for supporting bundled foreign primops implemented in
164 ``cabal-version: 2.4``
165 ----------------------
167 * Wildcard matching has been expanded. All previous wildcard
168 expressions are still valid; some will match strictly more files
169 than before. Specifically:
171 * Double-star (``**``) wildcards are now accepted for recursive
172 matching immediately before the final slash; they must be followed
173 by a filename wildcard (e.g., ``foo/**/*.html`` is valid;
174 ``foo/**/bar/*.html`` and ``foo/**/**/*.html``,
175 ``foo/**/bar.html`` are all invalid). As ``**`` was an error in
176 globs before, this does not affect any existing ``.cabal`` files
177 that previously worked.
178 (Caveat: Double-star wildcards in :pkg-field:`data-files` directories,
179 e.g. ``data-files: data/**/*.csv``,
180 `are only supported correctly from Cabal 3.0 <https://github.com/haskell/cabal/issues/6125#issuecomment-1379878419>`_.)
183 * Wildcards now match when the pattern's extensions form a suffix of
184 the candidate file's extension, rather than requiring strict
185 equality (e.g., previously ``*.html`` did not match
186 ``foo.en.html``, but now it does).
188 * License fields use identifiers from SPDX License List version
192 ``cabal-version: 2.2``
193 ----------------------
195 * New :pkg-section:`common` stanzas and :pkg-field:`import`
198 * New :pkg-field:`library:virtual-modules` field added.
200 * New :pkg-field:`cxx-sources` and :pkg-field:`cxx-options` fields
201 added for supporting bundled foreign routines implemented in C++.
203 * New :pkg-field:`extra-bundled-libraries` field for specifying
204 additional custom library objects to be installed.
206 * Extended ``if`` control structure with support for ``elif`` keyword.
208 * Changed default rules of :pkg-field:`build-type` field to infer
209 "build-type:" for "Simple"/"Custom" automatically.
211 * :pkg-field:`license` field syntax changed to require SPDX
212 expression syntax (using SPDX license list version ``3.0 2017-12-28``).
214 * Allow redundant leading or trailing commas in package fields (which
215 require commas) such as :pkg-field:`build-depends`.
218 ``cabal-version: 2.0``
219 ----------------------
221 * New :pkg-field:`library:signatures` and :pkg-field:`mixins` fields
222 added for supporting :ref:`Backpack`.
224 * New :pkg-field:`build-tool-depends` field added for adding
225 build-time dependencies of executable components.
227 * New :pkg-field:`custom-setup:autogen-modules` field added for declaring modules
228 which are generated at build time.
230 * Support for new PVP_ caret-style version operator (``^>=``) added to
231 :pkg-field:`build-depends`.
233 * Add support for new :pkg-section:`foreign-library` stanza.
235 * Add support for :ref:`sublibrary stanzas <sublibs>`.
237 * New CPP Macro ``CURRENT_PACKAGE_VERSION``.
239 ``cabal-version: 1.24``
240 -----------------------
242 * New :pkg-section:`custom-setup` stanza and
243 :pkg-field:`custom-setup:setup-depends` field added for specifying dependencies
244 of custom ``Setup.hs`` scripts.
246 * CPP Macros ``VERSION_$pkgname`` and ``MIN_VERSION_$pkgname`` are now
247 also generated for the current package.
249 * New CPP Macros ``CURRENT_COMPONENT_ID`` and ``CURRENT_PACKAGE_KEY``.
251 * New :pkg-field:`extra-framework-dirs` field added for specifying
252 extra locations to find OS X frameworks.
254 ``cabal-version: 1.22``
255 -----------------------
257 * New :pkg-field:`library:reexported-modules` field.
259 * Support for ``-none`` version constraint added to
260 :pkg-field:`build-depends`.
262 * New :pkg-field:`license` type ``ISC`` added.
264 ``cabal-version: 1.20``
265 -----------------------
267 * Add support for new :pkg-field:`license-files` field for declaring
268 multiple license documents.
270 * New CPP Macro ``MIN_TOOL_VERSION_$buildtool``.
272 * New :pkg-field:`license` types ``BSD2`` and ``MPL-2.0`` added.
274 ``cabal-version: 1.18``
275 -----------------------
277 * Add support for new :pkg-field:`extra-doc-files` field for
278 specifying extra file assets referenced by the Haddock
281 * New :pkg-field:`license` type ``AGPL`` and ``AGPL-3`` added.
283 * Add support for specifying a C/C++/obj-C source file in
284 :pkg-field:`executable:main-is` field.
286 * Add ``getSysconfDir`` operation to ``Paths_`` API.
288 ``cabal-version: 1.16``
289 -----------------------
293 this needs to be researched; there were only few changes between
296 ``cabal-version: 1.12``
297 -----------------------
299 * Change syntax of :pkg-field:`cabal-version` to support the new recommended
300 ``cabal-version: x.y`` style
304 .. include:: references.inc