[Haskell-cafe] One problem with Cabal-install and dependencies

Daniel Fischer daniel.is.fischer at web.de
Sun Jul 4 09:04:45 EDT 2010

On Sunday 04 July 2010 14:39:05, Michael Lazarev wrote:
> Hi, everybody!
> I think there's either an error in cabal-install, or I don't have an
> idea on haskell packages.
> I tried to install one particular library that depends on
> containers- and got the following error:
> Data/IntMap.hs:182:7:
>     Could not find module `Data.Data':
>       It is a member of the hidden package `base'.
>       Perhaps you need to add `base' to the build-depends in your .cabal
> file. Use -v to see a list of the files searched for.

As you've figured out, that's base 4, in base 3 there's no Data.Data.

> Then I tried to install containers- separately, andin the
> process of the struggle I found that issuing the following command in
> containers- directory:
> ~/.cabal/bin/cabal install --constraint="base >= 4" -v
> ... prints this:

$ cabal install --with-compiler=/home/dafis/bin/ghc-6.10.3 -v3 --reinstall 
--constraint="base == 4.*" --dry-run containers-
Resolving dependencies...
selecting containers- (hackage)
selecting array- (installed or hackage) and discarding 
array-, and
selecting base- (installed) and (installed) and discarding
syb-,,,, 0.2 and 0.2.1
selecting ghc-prim- (installed)
selecting integer- (installed)
selecting rts-1.0 (installed)
selecting syb- (installed)
In order, the following would be installed:
containers- (reinstall) changes: base- ->

And it's pretty adamant about the last line.

Try containers-, cabal-install doesn't announce to ignore the base-
constraint for that one.

> So, my qusetion is, whether I'm doing something wrong, or there are
> really two errors:
> 1) cabal-install makes a wrong choice for dependency version

containers- doesn't give an upper bound for the base version, so 
cabal-install chooses base-3 by default (less likely to break on older 
packages than the still more reduced base-4).
But I would've thought the preferred version could be overridden by a 
constraint (and it seems for containers-, it can).

> 2) cabal-install does not respect the constraint, and proceeds to
> building the library without any warning

More information about the Haskell-Cafe mailing list