[Haskell-cafe] Fwd: hackage compile failure with QuickCheck 2.5

Andres Löh andres at well-typed.com
Wed Jul 18 07:50:31 CEST 2012


Hi.

> QuickCheck's constraint is template-haskell >= 2.4, which doesn't explain
> why cabal wanted to install 2.6.0.0 when 2.7.0.0 was already present.
>
> Also, I'd expect --avoid-reinstalls to stop it reinstalling anything,
> but apparently it doesn't do that with the modular solver.

Assuming the examples you gave are the ones that Hackage actually
uses: Is it necessary that Hackage uses an unreleased and older
version of cabal-install? I can't really tell right now what the
differences between 0.13.3 and 0.14.0 are, but clearly, if the modular
solver isn't the default, then there still are significant
differences. AFAIK --avoid-reinstalls is completely ignored by the old
solver, but *not* by the modular solver.

For me, 2.6.0.0 is picked with --avoid-reinstalls *because* 2.7.0.0 is
already present, and 2.6.0.0 isn't. In concrete terms, with
Cabal-1.14.0, cabal-install-0.14.0 and a ghc-7.4.1-based Haskell
Platform installation without further packages:

$ cabal install --dry-run sbv
Resolving dependencies...
In order, the following would be installed:
containers-0.5.0.0 (new version)
mtl-2.1.2 (new version)
strict-concurrency-0.2.4.1 (new package)
syb-0.3.7 (new version)
template-haskell-2.7.0.0 (reinstall) changes: containers-0.4.2.1 -> 0.5.0.0
QuickCheck-2.5 (new version)
sbv-2.2 (new package)
Warning: The following packages are likely to be broken by the reinstalls:
ghc-7.4.1
haddock-2.10.0
QuickCheck-2.4.2
haskell-platform-2012.2.0.0
Use --force-reinstalls if you want to install anyway.

$ cabal install --dry-run sbv --avoid-reinstalls -v
Reading available packages...
Choosing modular solver.
Resolving dependencies...
In order, the following would be installed:
containers-0.5.0.0 (new version)
mtl-2.1.2 (new version)
strict-concurrency-0.2.4.1 (new package)
syb-0.3.7 (new version)
template-haskell-2.6.0.0 (new version)
QuickCheck-2.5 (new version)
sbv-2.2 (new package)

I haven't had time to thoroughly look at this problem, but it
currently seems to me like it's triggered by containers-0.5.0.0 and
has nothing to do with QuickCheck. The containers package is a
dependency of template-haskell. So if containers is upgraded to 0.5,
then template-haskell-2.7.0.0 would have to be reinstalled. With
--avoid-reinstalls, cabal-install will pick an older template-haskell,
not knowing that this will lead to a failure at build time. There's
really no other chance, because sbv-2.2 seems to depend on
containers-0.5.0.0. With containers being a dependency of GHC core
libraries such as template-haskell, there isn't currently a good
option to use containers-0.5.0.0 with ghc-7.4.

Using --avoid-reinstalls blindly or as a default flag is also
unfortunately not a good idea in general. There are simply too many
cases where installing older versions of packages (which is often the
only thing that helps) is not really the solution you want. That's
also the reason why it's not enabled by default.

Cheers,
  Andres

-- 
Andres Löh, Haskell Consultant
Well-Typed LLP, http://www.well-typed.com



More information about the Haskell-Cafe mailing list