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