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 >=126.96.36.199.
> When I have installed Cabal-188.8.131.52 as well a s184.108.40.206 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-220.127.116.11
> package leksah-0.4.3 requires Cabal-18.104.22.168
> Why does this happen, as leksah does not require Cabal-22.214.171.124?
> 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-126.96.36.199 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-188.8.131.52 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 == 184.108.40.206"
More information about the Libraries