Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cabal install dependency error: "base-* was excluded because of the top level dependency base -any"

Here's the complete error:

$ cabal install hakyll
Resolving dependencies...
cabal: cannot configure snap-server-0.5.3.1. It requires base >=4.3 && <5
For the dependency on base >=4.3 && <5 there are these packages: base-4.3.0.0,
base-4.3.1.0 and base-4.4.0.0. However none of them are available.
base-4.3.0.0 was excluded because of the top level dependency base -any
base-4.3.1.0 was excluded because of the top level dependency base -any
base-4.4.0.0 was excluded because of the top level dependency base -any
$

How can versions of base-* be excluded due to some rule that appears to say that any version is fine?

like image 584
jameshfisher Avatar asked Sep 11 '11 01:09

jameshfisher


2 Answers

Every time I have run into this problem, it has been because I did all of the following things:

  1. Downloaded a package from Hackage with outdated dependencies.
  2. Updated the dependencies and observed that it built fine (or spent time fixing whatever errors occurred).
  3. Ran cabal install with the new dependencies.
  4. Didn't update the version number.

That last one is the real kicker. cabal install will assume that, if it knows of a package's version/dependencies pair from Hackage, that pair is canonical. If you want it to know about updated dependencies, change the package's version number before you install.

You will need to check that you've done this correctly for any of hakyll's dependencies that you have manually installed.

like image 99
Daniel Wagner Avatar answered Nov 11 '22 23:11

Daniel Wagner


Ran into the same problem. Solved it.

It was a clean haskell install. But it was a clean haskell install from the linux flavor's (in this case ubuntu) package manager which had older versions.

Had to remove the old packages & download the source & build & install it.

get the latest platform sources from:
http://hackage.haskell.org/platform/linux.html

get the ghc sources that are required for the platform. http://haskell.org/ghc/download_ghc_7_0_3#distros

an example for doing this: http://sporkcode.wordpress.com/2009/07/11/installing-the-haskell-platform-in-ubuntu/

like image 25
knowledge_is_power Avatar answered Nov 11 '22 22:11

knowledge_is_power