Haskell Cabal: Mysterious missing or recursive dependencies

*爱你&永不变心* 提交于 2019-12-06 03:09:26

问题


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


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/9725378/haskell-cabal-mysterious-missing-or-recursive-dependencies

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!