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

Michael Lazarev lazarev.michael at gmail.com
Sun Jul 4 08:39:05 EDT 2010

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:

    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.

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:

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 ffi-1.0 (installed)
selecting ghc-prim- (installed)
selecting integer-gmp- (installed)
selecting rts-1.0 (installed)
selecting syb- (installed)
In order, the following would be installed:
containers- (new version)
Configuring containers-
Dependency array == using array-
Dependency base == using base-

And proceeds to building the library:

/usr/local/bin/ghc --make -package-name containers-
-hide-all-packages -fbuilding-cabal-package -i -idist/build -i.
-idist/build/autogen -Idist/build/autogen -Idist/build -Iinclude
-optP-include -optPdist/build/autogen/cabal_macros.h -odir dist/build
-hidir dist/build -stubdir dist/build -package-id
array- -package-id
base- -O -XDeriveDataTypeable
-XMagicHash -XRank2Types -XCPP Data.Graph Data.IntMap Data.IntSet
Data.Map Data.Sequence Data.Set Data.Tree

where, as you see, it really uses base-, and thus fails.

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
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