What's new in Cabal/cabal-install 2.0 — improved new-build, Backpack, foreign libraries and more!

Tags: haskell.

A couple of weeks ago we’ve quietly released versions 2.0 of both Cabal and cabal-install after approximately a year of development. The 2.0 release incorporates more than 1500 commits by 64 different contributors. This post serves as a formal release announcement and describes what’s new and improved in version 2.0.

There is a number of backwards-incompatible Cabal library API changes in this release that affect packages with Custom setup scripts. Therefore cabal-install will by default use a previous version of Cabal to build setup scripts that don’t explicitly declare compatibility with Cabal 2.0. The 2.0 migration guide gives advice for package authors on how to adapt Custom setup scripts to backwards-incompatible changes in this release.

Major new features

Minor improvements and bug fixes

Dropped support for versions of GHC earlier than 6.12 (#3111). Also, GHC compatibility window for the Cabal library has been extended to five years (#3838).

Added a technical preview version of the ‘cabal doctest’ command (#4480).

Cabal now invokes GHC with -Wmissing-home-modules , if that flag is supported (added in version 8.2). This means that you’ll get a warning if you forget to list a module in other-modules or exposed-modules (#4254).

Verbosity -v now takes an extended format which allows specifying exactly what you want to be logged. The format is [silent|normal|verbose|debug] flags , where flags is a space separated list of flags. At the moment, only the flags +callsite and +callstack are supported; these report the call site/stack of a logging output respectively (these are only supported if Cabal is built with GHC 8.0/7.10.2 or greater, respectively).

The -v/--verbosity option no longer affects GHC verbosity (except in the case of -v0 ). Use --ghc-options=-v to enable verbose GHC output (#3540, #3671).

Packages which use internal libraries can result in multiple registrations; thus --gen-pkg-config can now output a directory of registration scripts rather than a single file.

Changed the default logfile template from .../$pkgid.log to .../$compiler/$libname.log (#3807).

Macros in ‘cabal_macros.h’ are now #ifndef ’d, so that they don’t cause an error if the macro is already defined (#3041).

Added qualified constraints for setup dependencies. For example, --constraint="setup.bar == 1.0" constrains all setup dependencies on bar, and --constraint="foo:setup.bar == 1.0" constrains foo’s setup dependency on bar (part of #3502).

Non-qualified constraints, such as –constraint=“bar == 1.0”, now only apply to top-level dependencies. They don’t constrain setup or build-tool dependencies. The new syntax --constraint="any.bar ==1.0" constrains all uses of bar.

Added a new solver flag, --allow-boot-library-installs , that allows normally non-upgradeable packages like base to be installed or upgraded (#4209). Made the ‘template-haskell’ package non-upgradable again (#4185).

Fixed password echoing on MinTTY (#4128).

Added optional solver output visualisation support via the tracetree package (#3410). Mainly intended for debugging.

New ./Setup configure flag --cabal-file , allowing multiple .cabal files in a single directory (#3553). Primarily intended for internal use.

Removed the --check option from cabal upload (#1823). It was replaced by Hackage package candidates.

Removed the --root-cmd parameter of the ‘install’ command and deprecated cabal install --global (#3356).

Removed the top-down solver (#3598).

Cabal no longer supports using a version bound to disambiguate between an internal and external package (#4020). This should not affect many people, as this mode of use already did not work with the dependency solver.

Miscellaneous minor and/or internal bug fixes and improvements.

See the full Cabal 2.0 and cabal-install 2.0 changelogs for the complete list of changes in the 2.0 release.

Acknowledgements

Thanks to everyone who contributed code and bug reports. Full list of people who contributed patches to Cabal/ cabal-install 2.0 is available here.

Looking forward

We plan to make a new release of Cabal/ cabal-install before the end of the year – that is, around December 2017. We want to decouple the Cabal release cycle from the GHC one; that’ll allow us to release a new version of Cabal/ cabal-install approximately every six months in the future. Main features that are currently targeted at the 2.2 milestone are:

We would like to encourage people considering contributing to take a look at the bug tracker on GitHub, take part in discussions on tickets and pull requests, or submit their own. The bug tracker is reasonably well maintained and it should be relatively clear to new contributors what is in need of attention and which tasks are considered relatively easy. Additionally, the list of potential projects from the latest hackathon and the tickets marked “easy” and “newcomer” can be used as a source of ideas for what to work on.