Cabal complains that cabal-dev “indirectly depends on multiple versions of the same package”, even though it (apparently) does not

Hi all, I've just asked this on SO as well ( http://stackoverflow.com/questions/9301122/haskell-cabal-package-indirectly-...), but to repeat the question: After clearing out all of my cabal installed packages, I ran this following session: $ cabal update Downloading the latest package list from hackage.haskell.org james@bast:~/.cabal/packages$ cabal install cabal-dev Resolving dependencies... Downloading cabal-dev-0.9.1... [1 of 1] Compiling Main ( /tmp/cabal-dev-0.9.124882/cabal-dev-0.9.1/Setup.hs, /tmp/cabal-dev-0.9.124882/cabal-dev-0.9.1/dist/setup/Main.o ) Linking /tmp/cabal-dev-0.9.124882/cabal-dev-0.9.1/dist/setup/setup ... Configuring cabal-dev-0.9.1... Warning: This package indirectly depends on multiple versions of the same package. This is highly likely to cause a compile failure. package containers-0.4.2.1 requires array-0.4.0.0 package Cabal-1.14.0 requires array-0.4.0.0 package text-0.11.1.13 requires array-0.4.0.0 package deepseq-1.3.0.0 requires array-0.4.0.0 package containers-0.4.2.1 requires array-0.4.0.0 package HTTP-4000.2.2 requires array-0.4.0.0 package cabal-dev-0.9.1 requires containers-0.4.2.1 package Cabal-1.14.0 requires containers-0.4.2.1 package template-haskell-2.7.0.0 requires containers-0.4.2.1 Building cabal-dev-0.9.1... Preprocessing executable 'ghc-pkg-6_8-compat' for cabal-dev-0.9.1... <command line>: cannot satisfy -package-id Cabal-1.14.0-4af45d3c8d10dc27db38ae0e7e5a952b: Cabal-1.14.0-4af45d3c8d10dc27db38ae0e7e5a952b is unusable due to missing or recursive dependencies: array-0.4.0.0-46f61f5fd9543ebf309552ef84dccc86 containers-0.4.2.1-98f9aa15f9c08b13673dc9d89385f449 (use -v for more information) cabal: Error: some packages failed to install: cabal-dev-0.9.1 failed during the building phase. The exception was: ExitFailure 1 $ So the reason I can't install cabal-dev is apparently either that - it "indirectly depends on multiple versions of the same package." However, cabal does not name the package that it claims cabal-dev requires multiple versions of. - Cabal-1.14.0 has "missing or recursive dependencies", specifically somehow involving array-0.4.0.0 and containers-0.4.2.1. A graph of the dependencies it lists confirms that neither of these claims are true (or the dependencies it lists are false or incomplete): [image: claimed dependency graph of cabal-dev-0.9.1] *So: what am I missing? Who or what is incorrect: me, cabal, or one or more packages?* I am running: $ cabal --version cabal-install version 0.10.2 using version 1.10.1.0 of the Cabal library $ ghc --version The Glorious Glasgow Haskell Compilation System, version 7.4.1 $ Any help with this would be greatly appreciated. I get errors from cabal fairly often and I usually end up giving up because I don't understand the error. James

On Wed, Feb 15, 2012 at 16:15, James Fisher
$ cabal update Downloading the latest package list from hackage.haskell.org james@bast:~/.cabal/packages$ cabal install cabal-dev Resolving dependencies... Downloading cabal-dev-0.9.1... [1 of 1] Compiling Main ( /tmp/cabal-dev-0.9.124882/cabal-dev-0.9.1/Setup.hs, /tmp/cabal-dev-0.9.124882/cabal-dev-0.9.1/dist/setup/Main.o ) Linking /tmp/cabal-dev-0.9.124882/cabal-dev-0.9.1/dist/setup/setup ... Configuring cabal-dev-0.9.1... Warning: This package indirectly depends on multiple versions of the same package. This is highly likely to cause a compile failure. package containers-0.4.2.1 requires array-0.4.0.0 package Cabal-1.14.0 requires array-0.4.0.0 package text-0.11.1.13 requires array-0.4.0.0 package deepseq-1.3.0.0 requires array-0.4.0.0 package containers-0.4.2.1 requires array-0.4.0.0 package HTTP-4000.2.2 requires array-0.4.0.0 package cabal-dev-0.9.1 requires containers-0.4.2.1 package Cabal-1.14.0 requires containers-0.4.2.1 package template-haskell-2.7.0.0 requires containers-0.4.2.1
I think you'll need -v to see what's going on, but my guess is you somehow have multiple versions of either array or containers with the same version number but different hashes, or that one of the packages depends on a no longer installed package with the right version but had a different hash. My guess is it's containers, because the containers -> array dependency is listed twice --- making me suspicious that those are two separate instances with the same version but different hashes (which aren't normally shown there).
Cabal-1.14.0-4af45d3c8d10dc27db38ae0e7e5a952b is unusable due to missing or recursive dependencies: array-0.4.0.0-46f61f5fd9543ebf309552ef84dccc86 containers-0.4.2.1-98f9aa15f9c08b13673dc9d89385f449
This shows the hashes for one of those sets, but not the other.
-- brandon s allbery allbery.b@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms

Hi Brandon
On Wed, Feb 15, 2012 at 9:25 PM, Brandon Allbery
I think you'll need -v to see what's going on
This seems to provide no more information. There's some extra junk in the output, but it still gives me the same message about a dependency on multiple versions (of *what*? if it knows there exists such a package, presumably it knows *which*?), and despite cabal telling me that -v will provide more information on the missing or recursive dependency (what, are "missing" and "recursive" so similar we can't tell them apart? They seem like totally different problems to me), there is no such extra information with -v. but my guess is you somehow have multiple versions of either array or
containers with the same version number but different hashes, or that one of the packages depends on a no longer installed package with the right version but had a different hash.
My guess is it's containers, because the containers -> array dependency is listed twice --- making me suspicious that those are two separate instances with the same version but different hashes (which aren't normally shown there).
ghc-pkg tells me I have two array versions installed. I unregistered the earlier array-0.3.0.3, but I still get the same error when trying to install cabal-dev.
Cabal-1.14.0-4af45d3c8d10dc27db38ae0e7e5a952b is unusable due to missing or recursive dependencies:
array-0.4.0.0-46f61f5fd9543ebf309552ef84dccc86 containers-0.4.2.1-98f9aa15f9c08b13673dc9d89385f449
This shows the hashes for one of those sets, but not the other.
Sorry, what sets do you mean? I see one hash for array-0.4.0.0, another for containers-0.4.2.1, and another for Cabal-1.14.0. I guess another thing I don't understand is: why is there both a version number and a hash? I'm told by Hackage that "Re-uploading a package with the same version number is not permitted" ( http://hackage.haskell.org/packages/upload.html), so how could I have a package with two different hashes? Unless one or both came from somewhere other than Hackage, perhaps? Yet another thing I don't properly understand is the relationship between all these Haskell packaging organizations and programs. cabal seems to have some pseudo-official relationship with Hackage. And how do cabal and ghc-pkg interact? Where are things on my system apart from in ~/.cabal? Thanks James

On Wed, Feb 15, 2012 at 09:55:32PM +0000, James Fisher wrote:
I guess another thing I don't understand is: why is there both a version number and a hash? I'm told by Hackage that "Re-uploading a package with the same version number is not permitted" ( http://hackage.haskell.org/packages/upload.html), so how could I have a package with two different hashes? Unless one or both came from somewhere other than Hackage, perhaps?
Yet another thing I don't properly understand is the relationship between all these Haskell packaging organizations and programs. cabal seems to have some pseudo-official relationship with Hackage. And how do cabal and ghc-pkg interact? Where are things on my system apart from in ~/.cabal?
For answers to all these questions (and more), see http://www.vex.net/~trebla/haskell/sicp.xhtml -Brent

On Wed, Feb 15, 2012 at 10:09 PM, Brent Yorgey
For answers to all these questions (and more), see
Wow, that article is clear and succinct. I'll give it a closer read. Thanks James

On Thu, Feb 16, 2012 at 12:27 AM, James Fisher
On Wed, Feb 15, 2012 at 10:09 PM, Brent Yorgey
wrote: For answers to all these questions (and more), see
Wow, that article is clear and succinct. I'll give it a closer read.
Yes, this article is fantastic and should be required reading before messing with GHC and package installation ! -- Jedaï
participants (4)
-
Brandon Allbery
-
Brent Yorgey
-
Chaddaï Fouché
-
James Fisher