Tags: haskell.

The 1.18 release of Cabal is almost ready. This post describes what’s new and improved in this version.

Sandboxes - isolated environments for building packages, similar to (and inspired by) what the popular cabal-dev tool provides. See this article for a more detailed introduction.

cabal repl - New command that opens an interpreter session for the given target (executable or library). Code based on patches developed during GSoC 2011 by Sam Anklesaria.

cabal get - New command that replaces cabal unpack . When given the --source-repository argument (short form: -s ) cabal get checks out a working copy of a given package’s source code using the appropriate revision control system.

cabal run - New command that compiles and runs the given executable. Instead of cabal build && ./dist/build/prog/prog --args , you can now use cabal run prog -- --args .

Better support for cross-compilation: target platform is now inferred by parsing compiler’s output (i.e., ghc --info ). Packages are now installed to $arch-$os-$compiler/$pkgid instead of $pkgid/$compiler by default. (#1214)

It’s now possible to specify a target for the build and repl commands. For example, if your package includes executables foo and bar , you can run cabal build foo to build only foo (and its dependencies). If there’s also a library or test-suite named foo , cabal build exe:foo can be used for disambiguation.

New cabal configure and config file option: extra-prog-path . Allows to specify a list of directories to be searched for required programs. In newly-created config files it is initialised to ~/.cabal/bin , which should solve the common problem when cabal couldn’t find programs that the user have just installed (usually alex / happy / c2hs ) because they were in a location not on $PATH (#1415).

Two new config file sections: program-locations and program-default-options . This allows to specify custom paths and options for the required programs (#1328).

extra-doc-files : new package property for installing extra files referenced from the Haddock documentation, e.g. images (the lens package is a good example). (#1182).

Support for executables with C/C++/Obj-C main functions (#1080).

c-sources can now depend on headers generated for Haskell FFI exports ( *_stub.h ) (#1080).

Support for test and benchmark documentation with Haddock (#1374).

Support for GNU AGPLv3 license (#1361).

cabal test and cabal bench now imply cabal build .

The jobs field in the config file is now initialised with $ncpus .