[Haskell-cafe] One problem with Cabal-install and dependencies
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-0.2.0.1 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.
As you've figured out, that's base 4, in base 3 there's no Data.Data.
> Then I tried to install containers-0.2.0.1 separately, andin the
> process of the struggle I found that issuing the following command in
> containers-0.2.0.1 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-0.2.0.1
selecting containers-0.2.0.1 (hackage)
selecting array-0.2.0.0 (installed or hackage) and discarding
0.3.0.0 and 0.3.0.1
selecting base-220.127.116.11 (installed) and 18.104.22.168 (installed) and discarding
syb-0.1.0.0, 0.1.0.1, 0.1.0.2, 0.1.0.3, 0.2 and 0.2.1
selecting ghc-prim-0.1.0.0 (installed)
selecting integer-0.1.0.1 (installed)
selecting rts-1.0 (installed)
selecting syb-0.1.0.1 (installed)
In order, the following would be installed:
containers-0.2.0.1 (reinstall) changes: base-22.214.171.124 -> 126.96.36.199
And it's pretty adamant about the last line.
Try containers-0.2.0.0, 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-0.2.0.1 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-0.2.0.0, 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