One problem with Cabal-install and dependencies

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: 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. 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: Resolving dependencies... selecting containers-0.2.0.1 (hackage) selecting array-0.3.0.1 (installed or hackage) and discarding array-0.1.0.0, 0.2.0.0 and 0.3.0.0 selecting base-3.0.3.2 (installed) and 4.2.0.1 (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 ffi-1.0 (installed) selecting ghc-prim-0.2.0.0 (installed) selecting integer-gmp-0.2.0.1 (installed) selecting rts-1.0 (installed) selecting syb-0.1.0.2 (installed) In order, the following would be installed: containers-0.2.0.1 (new version) Configuring containers-0.2.0.1... Dependency array ==0.3.0.1: using array-0.3.0.1 Dependency base ==3.0.3.2: using base-3.0.3.2 And proceeds to building the library: /usr/local/bin/ghc --make -package-name containers-0.2.0.1 -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-0.3.0.1-fb28b07fd38a6011f4f73844e0d8281f -package-id base-3.0.3.2-260693a92016991a03206b5a55f6a411 -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-3.0.3.2, 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

Michael Lazarev
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:
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.
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:
You don't install containers by hand. This package sounds a bit like the package you're trying to install hasn't been updated to the latest version of GHC (containers-0.2 was GHC-6.10, wasn't it?). -- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com

Ivan Lazar Miljenovic wrote:
You don't install containers by hand.
I didn't want to, I had to do this because one library depending on them ceased to install.
This package sounds a bit like the package you're trying to install hasn't been updated to the latest version of GHC (containers-0.2 was GHC-6.10, wasn't it?).
On http://hackage.haskell.org/package/containers-0.2.0.1 it is stated that it's "Built on: ghc-6.12" ----------------------------------------------------------------------- Daniel Fischer wrote:
containers-0.2.0.1 (reinstall) changes: base-4.1.0.0 -> 3.0.3.1
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.
Alas, with ghc-6.12.2, I had the same error for containers-0.2.0.0
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).
Do you mean that if it's just "build-depends: base" without version constraint, cabal-install has some special code that chooses the third version of base? I'd like to note that I finally managed to install the package after changing "build-depends: base, array" to "build-depends: base == 4.*, array" in containers.cabal file. Thanks for some pointers.

Michael Lazarev
Ivan Lazar Miljenovic wrote:
You don't install containers by hand.
I didn't want to, I had to do this because one library depending on them ceased to install.
This package sounds a bit like the package you're trying to install hasn't been updated to the latest version of GHC (containers-0.2 was GHC-6.10, wasn't it?).
On http://hackage.haskell.org/package/containers-0.2.0.1 it is stated that it's "Built on: ghc-6.12"
Doesn't mean you should, though. Care to tell us which package this is that you're trying to install?
Do you mean that if it's just "build-depends: base" without version constraint, cabal-install has some special code that chooses the third version of base?
Yes. The reason being, when base-4 came out with GHC 6.10.1, there were a lot of breakages caused due to the non-backwards-compatible changes in Control.Exception (which was for all intents and purposes completely re-written but using the same function names). As such, since a lot of packages just said "base" rather than specifying which version, there were quite a few build failures and users were understandably annoyed. cabal-install had just made its debut around that time, and in an attempt to avoid this issue if there's no upper bound on the version of base used (which all new packages must have to be uploaded to Hackage), then it assumes that it's one of the old pre-6.10 packages and it won't build with base-4 and as such will use base-3. Similar things happen with parsec, etc. -- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com

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:
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-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:
Hah-rumph: $ cabal install --with-compiler=/home/dafis/bin/ghc-6.10.3 -v3 --reinstall --constraint="base == 4.*" --dry-run containers-0.2.0.1 <snip> Resolving dependencies... selecting containers-0.2.0.1 (hackage) selecting array-0.2.0.0 (installed or hackage) and discarding array-0.1.0.0, 0.3.0.0 and 0.3.0.1 selecting base-3.0.3.1 (installed) and 4.1.0.0 (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-4.1.0.0 -> 3.0.3.1 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
participants (3)
-
Daniel Fischer
-
Ivan Lazar Miljenovic
-
Michael Lazarev