[Haskell-cafe] ANN: HDBC v2.0 now available

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Sun Feb 1 09:38:09 EST 2009


On Fri, 2009-01-30 at 18:29 -0600, John Goerzen wrote:
> On Fri, Jan 30, 2009 at 03:50:30PM -0800, Michael Snoyman wrote:
> > >> [3 of 7] Compiling Database.HDBC.Statement ( Database/HDBC/Statement.hs,
> > >> dist/build/Database/HDBC/Statement.o )
> > >>
> > >> Database/HDBC/Statement.hs:113:9:
> > >>    Type constructor `Exception' used as a class
> > >>    In the instance declaration for `Exception SqlError'
> > >> cabal: Error: some packages failed to install:
> > >> HDBC-2.0.0 failed during the building phase. The exception was:
> > >> exit: ExitFailure 1
> 
> That's *WEIRD*.  
> 
> It's as if you have the old base from GHC 6.8.  Is cabal-install doing
> something (weird|evil|smart) here?

Yes.

> Leads me to think even more that there's cabal-install trickery here.

Yup.

> Can someone enlighten us on that?  Is cabal-install playing tricks
> with base?

Yes.

The difference (in the released version of cabal-install) between the
configure and install commands is that configure uses a dumb algorithm
for deciding what versions of dependencies to use while install uses a
smarter algorithm. Obviously this is confusing and in the next release
configure will use the smart algorithm too.

At the moment configure picks the latest versions of all packages
irrespective of whether this is likely to work or not. For developers
using ghc-6.10 with base 3 and 4 this means they end up with base 4.
They then likely do not notice that their package actually needs base
version 4.

The install command uses the constraint solver and takes into account
some global preferences from hackage. These are soft preferences / soft
constraints. They do not override constraints specified in the .cabal
file or on the command line. However for the huge number of packages on
hackage that worked with ghc-6.8 but failed to specify a constraint on
the version of base, using a preference of base 3 over base 4 enables
those packages to continue to build.

So in the next cabal-install release (which should be pretty soon now)
configure will do the same thing and pick base 3 unless you specify
build-depends base >= 4.

So the solution is for HDBC-2.0 to specify the version of base that it
needs more accurately. It appears that it does need version 4 so it
should use:

build-depends: base == 4.*


On a similar issue, I am going to make Hackage enforce that packages
specify an upper bounds on the version of base. Hopefully doing that
will make people also consider the appropriate lower bound. I don't see
an obvious way of automatically requiring accuracy in selecting the base
version between 3 and 4. It is perfectly possible to have a package that
works with both. Perhaps we should make not-specifying an upper bound an
error and not specifying a lower bound a warning.

Thoughts?

Duncan



More information about the Haskell-Cafe mailing list