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.12``
23 -----------------------
25 * License fields use identifiers from SPDX License List version
29 ``cabal-version: 3.8``
30 ----------------------
32 * Added field ``code-generators`` to :pkg-section:`test-suite` stanzas. This
33 enumerates executabes (possibly brought into scope by :pkg-field:`build-tool-depends`) that are run after all other
34 preprocessors. These executables are invoked with a target dir for
35 output, a sequence of all source directories with source files of
36 local lib components that the given test stanza depends on, and
37 following a double dash, all options cabal would pass to ghc for a
38 build. They are expected to output a newline-separated list of
39 generated modules which have been written to the targetdir. This can
40 be used for driving doctests and other discover-style tests generated
43 * Added fields :pkg-field:`extra-libraries-static` and
44 :pkg-field:`extra-lib-dirs-static` to allow Haskell libraries to remember
45 linker flags needed for fully static linking of system libraries into
47 The existing field :pkg-field:`pkgconfig-depends` can used to append
48 the relevant output of ``pkg-config --libs --static`` to these new fields
50 When :pkg-field:`extra-libraries-static` is not given, it defaults to
51 :pkg-field:`extra-libraries`.
52 When :pkg-field:`extra-lib-dirs-static` is not given, it defaults to
53 :pkg-field:`extra-lib-dirs`.
55 * Wildcard matching has been slightly expanded. Matches are now
56 allowed of the form ``foo/**/literalFile``. Prior, double-star
57 wildcards required the trailing filename itself be a wildcard.
59 * Allow the omission of the `type` field in `test-suite` and `benchmark` stanzas
60 when the type can be inferred by the presence of `main-is` or `test-module`.
62 * License fields use identifiers from SPDX License List version
65 ``cabal-version: 3.6``
66 ----------------------
68 * License fields use identifiers from SPDX License List version
71 * Add :pkg-field:`hsc2hs-options`
73 ``cabal-version: 3.4``
74 ----------------------
77 * License fields use identifiers from SPDX License List version
80 * Dependencies to sublibraries must be specified explicitly,
81 even for current package.
82 For example: ``build-depends: mypackage:my-sublib``
83 This way you can have a sublibrary with the same
84 name as some external dependency.
86 * Remove ``-any`` and ``-none`` syntax for version ranges
87 Use ``>=0`` and ``<0`` respectively.
89 * :pkg-field:`default-language` is optional.
90 The Default value is to use the compiler's default language.
92 * :pkg-field:`mixins` field allow specifying a sublibrary.
94 ``cabal-version: 3.0``
95 ----------------------
97 * New :pkg-field:`library:visibility` for exposing sublibraries.
99 * New ``pkg:lib`` and ``pkg:{lib1,lib2}`` syntax in :pkg-field:`build-depends`
100 for depending on public sublibraries from other packages.
102 * Added the :pkg-field:`extra-dynamic-library-flavours` field to specify non-trivial
103 variants of dynamic flavours. It is :pkg-field:`extra-library-flavours` but for
104 shared libraries. Mainly useful for GHC's RTS library.
106 * Free text fields (e.g. :pkg-field:`description`) preserve empty lines
107 and indentation. In other words, you don't need to add dots for blank lines.
109 * License fields use identifiers from SPDX License List version
112 * Remove deprecated ``hs-source-dir``, :pkg-field:`extensions` and
113 :pkg-field:`build-tools` fields.
115 * Common stanzas are now allowed also in the beginning of conditional
116 sections. In other words, the following is valid
126 * Allow redundant leading or trailing commas in package fields with
127 optional commas, such as :pkg-field:`library:exposed-modules`
129 * Require fields with optional commas to consistently omit or place
130 commas between elements.
132 * Changed the behavior of :pkg-field:`extra-bundled-libraries` field. The naming convention
133 of dynamic library files (e.g. generated by a custom build script) has
134 changed. For library names prefixed with "C", the dynamic library file
135 name(s) must be of the form `lib<library-name>.<dyn-library-extension>*`
136 instead of the old `libC<library-name>-ghc<ghc-flavour><ghc-version>.<dyn-library-extension>`
138 * New set-notation syntax for ``==`` and ``^>=`` operators, see
139 :pkg-field:`build-depends` field documentation for examples.
141 * Allow more whitespace in :pkg-field:`mixins` field
143 * Wildcards are disallowed in :pkg-field:`pkgconfig-depends`,
144 Yet the pkgconfig format is relaxed to accept e.g. versions like ``1.1.0h``.
146 * New :pkg-field:`autogen-includes` for specifying :pkg-field:`install-includes`
147 which are autogenerated (e.g. by a ``configure`` script).
149 * New :pkg-field:`asm-sources` and :pkg-field:`asm-options` fields
150 added for supporting bundled foreign routines implemented in
153 * New :pkg-field:`cmm-sources` and :pkg-field:`cmm-options` fields
154 added for supporting bundled foreign primops implemented in
157 ``cabal-version: 2.4``
158 ----------------------
160 * Wildcard matching has been expanded. All previous wildcard
161 expressions are still valid; some will match strictly more files
162 than before. Specifically:
164 * Double-star (``**``) wildcards are now accepted for recursive
165 matching immediately before the final slash; they must be followed
166 by a filename wildcard (e.g., ``foo/**/*.html`` is valid;
167 ``foo/**/bar/*.html`` and ``foo/**/**/*.html``,
168 ``foo/**/bar.html`` are all invalid). As ``**`` was an error in
169 globs before, this does not affect any existing ``.cabal`` files
170 that previously worked.
171 (Caveat: Double-star wildcards in :pkg-field:`data-files` directories,
172 e.g. ``data-files: data/**/*.csv``,
173 `are only supported correctly from Cabal 3.0 <https://github.com/haskell/cabal/issues/6125#issuecomment-1379878419>`_.)
176 * Wildcards now match when the pattern's extensions form a suffix of
177 the candidate file's extension, rather than requiring strict
178 equality (e.g., previously ``*.html`` did not match
179 ``foo.en.html``, but now it does).
181 * License fields use identifiers from SPDX License List version
185 ``cabal-version: 2.2``
186 ----------------------
188 * New :pkg-section:`common` stanzas and :pkg-field:`import`
191 * New :pkg-field:`library:virtual-modules` field added.
193 * New :pkg-field:`cxx-sources` and :pkg-field:`cxx-options` fields
194 added for supporting bundled foreign routines implemented in C++.
196 * New :pkg-field:`extra-bundled-libraries` field for specifying
197 additional custom library objects to be installed.
199 * Extended ``if`` control structure with support for ``elif`` keyword.
201 * Changed default rules of :pkg-field:`build-type` field to infer
202 "build-type:" for "Simple"/"Custom" automatically.
204 * :pkg-field:`license` field syntax changed to require SPDX
205 expression syntax (using SPDX license list version ``3.0 2017-12-28``).
207 * Allow redundant leading or trailing commas in package fields (which
208 require commas) such as :pkg-field:`build-depends`.
211 ``cabal-version: 2.0``
212 ----------------------
214 * New :pkg-field:`library:signatures` and :pkg-field:`mixins` fields
215 added for supporting :ref:`Backpack`.
217 * New :pkg-field:`build-tool-depends` field added for adding
218 build-time dependencies of executable components.
220 * New :pkg-field:`custom-setup:autogen-modules` field added for declaring modules
221 which are generated at build time.
223 * Support for new PVP_ caret-style version operator (``^>=``) added to
224 :pkg-field:`build-depends`.
226 * Add support for new :pkg-section:`foreign-library` stanza.
228 * Add support for :ref:`sublibrary stanzas <sublibs>`.
230 * New CPP Macro ``CURRENT_PACKAGE_VERSION``.
232 ``cabal-version: 1.24``
233 -----------------------
235 * New :pkg-section:`custom-setup` stanza and
236 :pkg-field:`custom-setup:setup-depends` field added for specifying dependencies
237 of custom ``Setup.hs`` scripts.
239 * CPP Macros ``VERSION_$pkgname`` and ``MIN_VERSION_$pkgname`` are now
240 also generated for the current package.
242 * New CPP Macros ``CURRENT_COMPONENT_ID`` and ``CURRENT_PACKAGE_KEY``.
244 * New :pkg-field:`extra-framework-dirs` field added for specifying
245 extra locations to find OS X frameworks.
247 ``cabal-version: 1.22``
248 -----------------------
250 * New :pkg-field:`library:reexported-modules` field.
252 * Support for ``-none`` version constraint added to
253 :pkg-field:`build-depends`.
255 * New :pkg-field:`license` type ``ISC`` added.
257 ``cabal-version: 1.20``
258 -----------------------
260 * Add support for new :pkg-field:`license-files` field for declaring
261 multiple license documents.
263 * New CPP Macro ``MIN_TOOL_VERSION_$buildtool``.
265 * New :pkg-field:`license` types ``BSD2`` and ``MPL-2.0`` added.
267 ``cabal-version: 1.18``
268 -----------------------
270 * Add support for new :pkg-field:`extra-doc-files` field for
271 specifying extra file assets referenced by the Haddock
274 * New :pkg-field:`license` type ``AGPL`` and ``AGPL-3`` added.
276 * Add support for specifying a C/C++/obj-C source file in
277 :pkg-field:`executable:main-is` field.
279 * Add ``getSysconfDir`` operation to ``Paths_`` API.
281 ``cabal-version: 1.16``
282 -----------------------
286 this needs to be researched; there were only few changes between
289 ``cabal-version: 1.12``
290 -----------------------
292 * Change syntax of :pkg-field:`cabal-version` to support the new recommended
293 ``cabal-version: x.y`` style
297 .. include:: references.inc