[Haskell-beginners] cabal dependencies question
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:
> I was unable to normally install the "mime" package -- I got an error
> that it needed "base <= 4". I have 126.96.36.199. So I ran `cabal unpack
> mime`, edited mime.cabal to say "base <= 188.8.131.52" 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-184.108.40.206 and base-220.127.116.11. However none of them are available.
> base-18.104.22.168 was excluded because base-22.214.171.124 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 <= 126.96.36.199.
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
$ 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).
if you edit a .cabal file to repair the build-depends, bump the version or
cabal-install will think it's broken.
More information about the Beginners