Skip to content

2.2 migration guide

Mikhail Glushenkov edited this page Feb 20, 2018 · 4 revisions

This page documents the backwards-incompatible changes in Cabal 2.2 affecting the authors of packages that use custom Setup scripts. See also the Cabal 2.0 migration guide page.

  • Distribution.Types.PackageDescription.allBuildInfo now returns all build infos, not only the ones for buildable components (#5087).
  • PackageDescription's buildType field was renamed to buildTypeRaw. The buildType function now returns just a BuildType instead of Maybe BuildType (#4958).
  • The UnknownBuildType constructor of BuildType was removed (#5003).
  • The license field of PackageDescription now has type Either SPDX.License License (#5050).
  • FlagAssignment is now an opaque newtype (#4849).
  • The rawSystemStdInOut function now uses a proper type to represent binary and textual data (#4666).
  • The obsolete 'startsWithBOM', 'fileHasBOM', 'fromUTF8', and 'toUTF8' functions were removed (#4666).
  • compilerExtensions and ghcOptExtensionMap were changed to containMaybe Flags, since a supported extention can lack a flag (#4443).
  • Distribution.Simple.defaultHookedPackageDesc has been deprecated in favour of Distribution.Simple.findHookedPackageDesc (#4874).
  • Distribution.Simple.getHookedBuildInfo now takes an additional parameter specifying the build directory path (#4874).

The following change is not backwards-incompatible, but worth knowing about:

  • Added '.Lens' modules, with optics for package description data types (#4701).