Notice for package authors

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Wed Jun 3 06:36:51 EDT 2009


Package authors,

We are about to add an additional quality check in the Hackage upload
process that will affect many packages. Hackage will require an upper
bound on the version of the base package and reject packages that omit
it.

Lots of packages currently specify:

        build-depends: base
or
        build-depends: base >= 3

This is bad.

There is no way for the tools to discover if you mean base 3 or 4 and
yet most packages break when we pick the wrong one. You must specify an
upper bound so that your package does not break when the next major
version of the base library is released.

For example, if you've tested with base 3 and 4 then use:

        build-depends: base >= 3 && < 5

Or if it needs version 4 then use:

        build-depends: base == 4.*


Background
----------

When base 4 was released with ghc-6.10.x the vast majority of packages
would have broken were it not for a compatibility shim that we added to
the cabal-install tool. It defaulted to picking base 3 when the version
constraints did not otherwise specify the use of base 4.

The same trick will not work when base 5 is released because it will
likely not be possible to continue to ship base 3. It is also important
that we start to move towards making the majority of packages compatible
with base 4.


cabal-install changes
---------------------

We will shortly release a minor update to cabal-install to change the
way it picks between base 3 and 4. Currently if it has the choice it
picks version 3. However that is not optimal for cases like:

        build-depends: base >= 3 && < 5

where it is clear that it is supposed to work with both. In this case we
should not be pessimistic in going with the old base 3 and should
instead pick base 4. More precisely, we will only apply the
compatibility shim when the version is unbounded above. When it is
bounded above, as Hackage will soon require, the normal preference to
use the latest version applies.

If you'd like to help us check this feature is working properly then
grab the latest darcs version of cabal-install (which needs the latest
darcs version the Cabal lib).
See also http://hackage.haskell.org/trac/hackage/ticket/485


Duncan



More information about the cabal-devel mailing list