[Nix-dev] Announcing cabal2nix version 20150807
Peter Simons
simons at cryp.to
Fri Aug 7 15:27:53 CEST 2015
Fellow Nix ∩ Haskell hackers,
I'd like to draw your attention to the newly available version 20150807 [1] of
cabal2nix, which changes the format of the generated expressions.
tl;dr: You *should* re-generate your Nix expressions with the new version, but
you don't have to.
This update greatly enhances the accuracy with which dependencies are expressed
in the generated Nix files. Previous versions distinguished dependencies for
building ("buildDepends") and testing ("testDepends"). This distinction didn't
apply to system packages or build tools, however: the fields "extraLibs" and
"buildTools" applied to the entire build. This meant that dependencies required
only for testing would be pulled in regardless of whether the test were
actually run or not.
These days, we distinguish dependencies for libraries, executables, and tests,
and for each of those types we distinguish dependencies on Haskell libraries,
system libraries, pkgconfig libraries, and build tools. This gives us a
whopping 12 new attributes
xxxHaskellDepends
xxxSystemDepends
xxxPkgconfigDepends
xxxToolDepends
where "xxx" is any of "library", "executable", or "test".
The old dependency attributes are no longer generated by cabal2nix. The generic
builder in Nixpkgs still accepts them, though, for the sake of backwards
compatibility. This means that you don't have to re-generate all your build
expressions with the new version, but you *should*.
I've re-generated the "haskell-packages.nix" file with the new version, and we
can now compile well over 5,000 Haskell packages successfully with GHC 7.10.2
on Linux/x86_64 -- that's approximately 60% of Hackage:
http://hydra.cryp.to/jobset/nixpkgs/haskell-updates
Users of the unstable channel will see those updates soon, everyone who's
following the 'master' branch already has them.
Best regards,
Peter
[1] https://github.com/NixOS/nixpkgs/commit/29fed6f834c1f8be1252d273b51b111589ad8ff8
More information about the nix-dev
mailing list