Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Haskell Cabal: Mysterious missing or recursive dependencies

I try to install the jmacro package. It builds perfectly, and there are absolutely no issues.

However, when I want to use it or install packages like happstack-jmacro, which depend on jmacro, I get error messages like this:

<command line>: cannot satisfy -package-id jmacro-0.5.2-71bd40707d94b0e8eb6e70515ff6a5f4: 
    jmacro-0.5.2-71bd40707d94b0e8eb6e70515ff6a5f4 is unusable due to missing or recursive dependencies:
      haskell-src-meta-0.5-4bf46b12fb313927e18a04de209944de template-haskell-2.5.0.0-f0b857ddb066aae09d974e610edd228f
    (use -v for more information)

There are absolutely no recursive or missing dependencies. Is this a bug?

I am using template-haskell-2.5.0.0 (because the newer versions don't build) and haskell-src-meta-0.5. GHC is 7.0.4

like image 886
muxamilian Avatar asked Mar 15 '12 17:03

muxamilian


2 Answers

Looks like your packages are broken. ghc-pkg check might complain about some packages; if it does, you could ghc-pkg unregister <pkg> all of them. Otherwise, the best thing is probably to start afresh: save your ~/.cabal/config file, get rid of ~/.ghc and ~/.cabal, and reinstall cabal-install.

Cabal problems like this are fairly common, so you might want to look into mitigating the pain with cabal-dev.

like image 199
ehird Avatar answered Oct 07 '22 17:10

ehird


OK, solved it myself:

There is a bug and template-haskell-2.5.0.0 was installed in the system directory of cabal, as well as in my user directory.

When I forcedly unregistered template-haskell in my user directory, everything was fine.

like image 24
muxamilian Avatar answered Oct 07 '22 18:10

muxamilian