使用Cabal安装HTF时出现问题 [英] Trouble Installing HTF with Cabal

查看:125
本文介绍了使用Cabal安装HTF时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图安装HTF。然而,在我 cabal install HTF 后,我得到了这个结果:

 解决依赖关系。 .. 
配置HTF-0.10.0.7 ...
警告:此包间接依赖于同一
包的多个版本。这很可能导致编译失败。
包regex-base-0.93.2需要mtl-2.0.1.0
包aeson-0.6.0.2需要mtl-2.1.2
包HTF-0.10.0.7需要mtl-2.1.2
包mtl-2.0.1.0需要变压器-0.2.2.0
包变压器-base-0.4.1需要变压器-0.3.0.0
包mtl-2.1.2需要变压器-0.3.0.0
包monad-control-0.3.1.4需要变压器-0.3.0.0
构建HTF-0.10.0.7 ...
预处理库HTF-0.10.0.7 ...
ghc :无法执行:cpphs
cabal:错误:某些软件包未能安装:
HTF-0.10.0.7在构建阶段失败。例外情况是:
ExitFailure 1

我尝试安装其他版本,但已变得不同问题。例如,
cabal install'HTF <= 0.1'我会得到以下结果:

 解决依赖关系... 
下载QuickCheck-1.2.0.1 ...
配置QuickCheck-1.2.0.1 ...
构建QuickCheck-1.2.0.1 ...
预处理库QuickCheck-1.2.0.1 ...
编译Test.QuickCheck(Test / QuickCheck.hs,dist / build / Test / QuickCheck.o)
[2/8]编译Test.QuickCheck.Batch(Test / QuickCheck / Batch.hs,dist / build / Test / QuickCheck / Batch.o)
编译Test.QuickCheck.Utils(Test /QuickCheck/Utils.hs,dist / build / Test / QuickCheck / Utils.o)
编译Test.QuickCheck.P​​oly(Test / QuickCheck / Poly.hs,dist / build / Test / QuickCheck /Poly.o)
编译Debug.QuickCheck.P​​oly(Debug / QuickCheck / Poly.hs,dist / build / Debug / QuickCheck / Poly.o)
[6/8]编译Debug.QuickCheck.Utils(Debug / QuickCheck / Utils.hs,dist / build / Debug / QuickCheck / Utils.o)
编译Debug.QuickCheck(D编译Debug.QuickCheck.Batch(Debug / QuickCheck / Batch.hs,dist / build / Debug / QuickCheck / Batch。)编译Debug.QuickCheck.Batch(Debug / QuickCheck / Batch.hs,dist / build / Debug / QuickCheck.hs,dist / build / Debug / QuickCheck.o) o)
注册QuickCheck-1.2.0.1 ...
在/home/xxx/.cabal/lib/QuickCheck-1.2.0.1/ghc-7.4.1中安装库
注册QuickCheck- 1.2.0.1 ...
下载HTF-0.1 ...
配置HTF-0.1 ...
构建HTF-0.1 ...
预处理库HTF-0.1 .. 。
编译Test.Framework.Utils(Test / Framework / Utils.hs,dist / build / Test / Framework / Utils.o)
[8 of 8]编译Test.Framework .Process(Test / Framework / Process.hs,dist / build / Test / Framework / Process.o)

Test / Framework / Process.hs:45:48:
不明确的类型变量
(显示a0)
在Test / Framework / Process.hs:45:48-51
(Control.Exception。例外a0)在Test / Fr使用`Control.Exception.handle'
引起的
amework / Process.hs:45:5-28
可能的修复:添加一个修复这些类型变量的类型签名
在表达式中:show e
在第一个参数`返回',即
`([],show e,error(show e))'
在表达式中:return([],show e,error(show e))
cabal :错误:某些软件包未能安装:
HTF-0.1在构建阶段失败。例外情况是:
ExitFailure 1

我也得到类似于 cabal install'HTF <= 0.9'。我试过 ghc-pkg check ,它给了我一个破包的列表。我重新安装了软件包,并重复尝试再次安装HTF,结果相同。

第一个问题是,您有 regex-base 针对 mtl-2.0.1.0 构建,因此



package regex-base-0.93.2需要mtl-2.0.1.0
package aeson-0.6.0.2 require mtl-2.1.2

HTF 会取决于在 mtl 的多个版本上。这很少有效。



解决方案是 $ ghc-pkg unregister regex-base 。如果 ghc-pkg 警告会打破其他软件包,那么您也必须重新构建这些软件包。如果手动执行的太多,可以考虑删除整个用户软件包-db(我希望这些软件包都是用户安装的,如果它们是全局安装的,则不能删除整个全局数据库)并重建所有内容与 cabal install world



regex-base 被删除了,什么都不会取决于 mtl-2.0.1.0 ,并且依赖关系不应该引起冲突。在实际安装 HTF 之前,您应该使用

  cabal install HTF --dry-run 

如果仍然存在冲突,应该检测它们,你可以通过注销更多的包来帮助解决它们。



接下来的问题是:

  ghc:无法执行:cpphs 

看起来好像您的 PATH 中没有 cpphs 。或者你没有安装它,在这种情况下,你需要在安装 HTF 之前完成它,或者它的安装目录需要添加到 PATH


I am trying to install HTF. However after I cabal install HTF I get this:

Resolving dependencies...
Configuring HTF-0.10.0.7...
Warning: This package indirectly depends on multiple versions of the same
package. This is highly likely to cause a compile failure.
package regex-base-0.93.2 requires mtl-2.0.1.0
package aeson-0.6.0.2 requires mtl-2.1.2
package HTF-0.10.0.7 requires mtl-2.1.2
package mtl-2.0.1.0 requires transformers-0.2.2.0
package transformers-base-0.4.1 requires transformers-0.3.0.0
package mtl-2.1.2 requires transformers-0.3.0.0
package monad-control-0.3.1.4 requires transformers-0.3.0.0
Building HTF-0.10.0.7...
Preprocessing library HTF-0.10.0.7...
ghc: could not execute: cpphs
cabal: Error: some packages failed to install:
HTF-0.10.0.7 failed during the building phase. The exception was:
ExitFailure 1

I have tried installing other versions, but have gotten different problems. For example, with cabal install 'HTF <= 0.1' I get the following:

Resolving dependencies...
Downloading QuickCheck-1.2.0.1...
Configuring QuickCheck-1.2.0.1...
Building QuickCheck-1.2.0.1...
Preprocessing library QuickCheck-1.2.0.1...
[1 of 8] Compiling Test.QuickCheck  ( Test/QuickCheck.hs, dist/build/Test/QuickCheck.o )
[2 of 8] Compiling Test.QuickCheck.Batch ( Test/QuickCheck/Batch.hs, dist/build/Test/QuickCheck/Batch.o )
[3 of 8] Compiling Test.QuickCheck.Utils ( Test/QuickCheck/Utils.hs, dist/build/Test/QuickCheck/Utils.o )
[4 of 8] Compiling Test.QuickCheck.Poly ( Test/QuickCheck/Poly.hs, dist/build/Test/QuickCheck/Poly.o )
[5 of 8] Compiling Debug.QuickCheck.Poly ( Debug/QuickCheck/Poly.hs, dist/build/Debug/QuickCheck/Poly.o )
[6 of 8] Compiling Debug.QuickCheck.Utils ( Debug/QuickCheck/Utils.hs, dist/build/Debug/QuickCheck/Utils.o )
[7 of 8] Compiling Debug.QuickCheck ( Debug/QuickCheck.hs, dist/build/Debug/QuickCheck.o )
[8 of 8] Compiling Debug.QuickCheck.Batch ( Debug/QuickCheck/Batch.hs, dist/build/Debug/QuickCheck/Batch.o )
Registering QuickCheck-1.2.0.1...
Installing library in /home/xxx/.cabal/lib/QuickCheck-1.2.0.1/ghc-7.4.1
Registering QuickCheck-1.2.0.1...
Downloading HTF-0.1...
Configuring HTF-0.1...
Building HTF-0.1...
Preprocessing library HTF-0.1...
[1 of 8] Compiling Test.Framework.Utils ( Test/Framework/Utils.hs, dist/build/Test/Framework/Utils.o )
[2 of 8] Compiling Test.Framework.Process ( Test/Framework/Process.hs, dist/build/Test/Framework/Process.o )

Test/Framework/Process.hs:45:48:
    Ambiguous type variable `a0' in the constraints:
      (Show a0)
        arising from a use of `show' at Test/Framework/Process.hs:45:48-51
      (Control.Exception.Exception a0)
        arising from a use of `Control.Exception.handle'
        at Test/Framework/Process.hs:45:5-28
    Probable fix: add a type signature that fixes these type variable(s)
    In the expression: show e
    In the first argument of `return', namely
      `([], show e, error (show e))'
    In the expression: return ([], show e, error (show e))
cabal: Error: some packages failed to install:
HTF-0.1 failed during the building phase. The exception was:
ExitFailure 1

I also get results similar to the first one after cabal install 'HTF <= 0.9'. I tried ghc-pkg check which gave me a list of broken packages. I reinstalled the packages and repeated trying to install HTF again with the same results.

解决方案

The first problem is that you have regex-base built against mtl-2.0.1.0, thus

package regex-base-0.93.2 requires mtl-2.0.1.0
package aeson-0.6.0.2 requires mtl-2.1.2

HTF would depend on multiple versions of mtl. That very rarely works.

The solution to that would be to $ ghc-pkg unregister regex-base. If ghc-pkg warns that that would break other packages, you would have to rebuild those too. If there are too many to do it manually, you may consider deleting your entire user package-db (I hope the packages all are user-installed, if they are globally installed, you can't delete your entire global db) and rebuild everything with cabal install world.

After the regex-base is removed, nothing would depend on mtl-2.0.1.0 anymore, and the dependencies should cause no conflict; before actually installing HTF, you should check that with

cabal install HTF --dry-run

If there would still be conflicts, that should detect them, and you could help resolving them by unregistering further packages.

The next problem is

ghc: could not execute: cpphs

That looks as if you have no cpphs in your PATH. Either you haven't installed it, in which case you need to do it before installing HTF, or the directory it is installed in needs to be added to the PATH.

这篇关于使用Cabal安装HTF时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆