[Haskell-cafe] Re: cabal install HaXml installs wrong version unless I specify the version number

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Mon Nov 24 18:38:30 EST 2008


On Mon, 2008-11-24 at 15:16 +0100, Thomas Hartman wrote:
> I have run into another issue with cabal packaging, which seems
> related to the issues discussed above. (see attached tar file for
> complete example of failure scenario)
> 
> If I have a cabal package that depends on two other packages
>   -- package xml-parsec requires HaXml == 1.19.4 (the latest)
>   -- package HAppS-Server requires HaXml == 1.13.3 (the default)
> 
> ghc --make testDepConflict.hs
>   works fine.

Yes, it happens to work.

> But I can't install via cabal without, I guess, breaking out the
> conflict into a separate cabal package.

But cabal does not have enough information to know that it is going to
work, and in many similar situations it'll fail. So it errs on the side
of caution.

The potential problem is that types defined in the two different
versions of HaXml get used together in your package. Obviously that's
not happening in your example but consider the case of different
packages using different versions of the bytestring package and you
would see type errors where different versions of the bytestring type
get equated.

Specifically the cabal install solver tries to find a solution that uses
at most one version of each package. So that's why it declares that
those two packages conflict.

There's not a lot more we can do without having more information. For
example if we know that the two packages you're using do not re-export
any types from the HaXml package, and we could somehow declare and
enforce such "private" build dependencies then that would be more
information and the solver could allow private versions of a package to
be different.

Duncan



More information about the Haskell-Cafe mailing list