Dependency version problem with Cabal
duncan.coutts at worc.ox.ac.uk
Thu Mar 19 06:46:32 EDT 2009
On Wed, 2009-03-18 at 15:34 -0700, jutaro wrote:
> In my leksah.cabal file i have the package dependency Cabal >=184.108.40.206.
> When I have installed Cabal-220.127.116.11 as well a s18.104.22.168 I get the following
> Warning: This package indirectly depends on multiple versions of the same
> package. This is highly likely to cause a compile failure.
> package ghc-6.10.1 requires Cabal-22.214.171.124
> package leksah-0.4.3 requires Cabal-126.96.36.199
> Why does this happen, as leksah does not require Cabal-188.8.131.52?
> How can I solve this problem?
The runghc Setup configure uses a simple algorithm to decide what
versions of packages should be used. It always picks the latest
However then it checks if the configuration it picked means that
directly or indirectly we end up depending on multiple versions of the
same package. It does that check because depending on multiple versions
of the same package is often a mistake and leads to compile failure.
So it's saying that leksah requires Cabal-184.108.40.206 only because it went
and picked the latest version of Cabal.
Now in this case the warning is probably superfluous. It's unlikely that
the bits of the Cabal library that ghc re-exports are bits that you
directly import from Cabal. So it'll probably work.
Note that you will not get the warning if you use the "cabal
configure" (at least the latest version) or "cabal install" commands.
That's because these two commands use a more sophisticated algorithm to
decide what versions of packages should be used. In this case they would
probably end up picking Cabal-220.127.116.11 and everything would be ok.
If you want to use the runghc Setup configure method and don't like the
warning you can tell it to pick a different version:
runghc Setup configure --constraint="Cabal == 18.104.22.168"
More information about the Libraries