6

I'm trying to install hspec, but I'm getting this:

$ cabal install hspec
Resolving dependencies...                                                                                                                                               
cabal: dependencies conflict: ghc-7.2.2 requires containers ==0.4.2.0 however                                                                                           
containers-0.4.2.0 was excluded because ghc-7.2.2 requires containers                                                                                                   
==0.4.1.0                                                  

What does this even mean?

Also, using ghc 7.2.2, cabal 10.2.

Clark Gaebel
  • 17,280
  • 20
  • 66
  • 93
  • What is the output of `ghc-pkg check`? – dflemstr Feb 11 '12 at 21:04
  • Warning: haddock-interfaces: /home/clark/.cabal/share/doc/InternalLibrary4-0.2/html/InternalLibrary4.haddock doesn't exist or isn't a file Warning: haddock-html: /home/clark/.cabal/share/doc/InternalLibrary4-0.2/html doesn't exist or isn't a directory Warning: include-dirs: /usr/include/libpng14 doesn't exist or isn't a directory Warning: include-dirs: /usr/include/libpng14 doesn't exist or isn't a directory Warning: include-dirs: /usr/include/libpng14 doesn't exist or isn't a directory – Clark Gaebel Feb 11 '12 at 21:07

1 Answers1

2

It sounds like you somehow broke your GHC install. GHC 7.2.2 comes with containers-0.4.1.0 (the version of which is the same as for GHC 7.2.1). It might be possible to fix it, but if the global package setup is broken then it would probably be easiest to re-install GHC.

What does ghc-pkg list containers say?

If containers-0.4.2.2 is found only in the per-user install (i.e. the /home/clark/.ghc/${arch}-${os}-7.2.2/package.conf.d output), then rm'ing /home/clark/.ghc/ and re-installing all the packages you installed with cabal install will fix it.

ivanm
  • 3,927
  • 22
  • 29
  • Output of `ghc-pkg list containers` => `/usr/lib/ghc-7.2.2/package.conf.d containers-0.4.1.0 /home/clark/.ghc/x86_64-linux-7.2.2/package.conf.d containers-0.4.2.0 ` – Clark Gaebel Feb 12 '12 at 03:47
  • @ClarkGaebel: so you could try "ghc-pkg unregister containers-0.4.2.0" and see if that fixes it. – ivanm Feb 12 '12 at 04:50
  • It says it would break a huge number of packages if I did. Should I --force it? – Clark Gaebel Feb 13 '12 at 18:57
  • @ClarkGaebel Yes, then rebuild those packages. You should *never* upgrade the boot libraries that come with GHC (base, containers, array, bytestring, etc.; Cabal is the only library that comes with GHC that you can safely install a newer version of in parallel). – ivanm Feb 13 '12 at 21:46
  • I just did a full install of my system (`rm -rf .ghc .cabal`), reinstalled everything. Turns our there were two versions of containers installed thanks to a recent hashmap update. Thanks for your help! Have some bounty. – Clark Gaebel Feb 13 '12 at 22:55