[Haskell-beginners] cabal dependencies question

Daniel Fischer daniel.is.fischer at googlemail.com
Wed Mar 23 22:31:31 CET 2011


On Wednesday 23 March 2011 22:08:25, Rob Nikander wrote:
> Hi,
> 
> I was unable to normally install the "mime" package -- I got an error
> that it needed "base <= 4".  I have 4.3.1.0.  So I ran `cabal unpack
> mime`, edited mime.cabal to say "base <= 4.3.1.0" and from that file's
> directory ran `cabal install'.  It appeared to install it okay.   But
> when I try to install another package that needs mime, I get the same
> 
> kind of error:
>    > cabal install http-server
> 
>    Resolving dependencies...
>    cabal: cannot configure mime-0.3.2. It requires base >=3 && <=4
>    For the dependency on base >=3 && <=4 there are these packages:
> base-3.0.3.1 and base-3.0.3.2. However none of them are available.
>    base-3.0.3.1 was excluded because base-4.3.1.0 was selected instead
> 
> I'm wondering why it thinks the mime package wants base <= 4 when I
> just installed with a .cabal file that says base <= 4.3.1.0.

Because it tries to make a consistent install plan for the packages 
incuding mime-0.3.2. For that it looks at the dependencies listed in the 
package-index (because it knows where that is). That says mime-0.3.2 needs 
base <= 4, so for a consistent install it would have to reinstall 
mime-0.3.2, since a missing dependency indicates a broken package.

The solution (apart from prodding the maintainer to release a new version 
compatible with base-4.3) is to bump the version of mime in your local 
install, so

$ cd mime
-- edit mime.cabal to say the version is 0.3.2.1, save
$ cabal install

Now you have mime-0.3.2.1 installed and the package-index doesn't know 
about that package, so cabal assumes that one is okay for further installs.

It won't work if the packages specify a dependency mime <= 0.3.2, in which 
case you'd have to edit their .cabal files too (and don't forget to do a 
minor-minor version bump for those).

Remember, everyone:
if you edit a .cabal file to repair the build-depends, bump the version or 
cabal-install will think it's broken.

> 
> ??
> 
> thanks,
> Rob

HTH,
Daniel



More information about the Beginners mailing list