DJG*_*DJG 4 haskell ghc cabal htf
我正在尝试安装HTF.但是在cabal install HTF我得到这个之后:
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
Run Code Online (Sandbox Code Playgroud)
我尝试过安装其他版本,但遇到了不同的问题.例如,cabal install 'HTF <= 0.1'我得到以下内容:
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
Run Code Online (Sandbox Code Playgroud)
我也得到了与第一个相似的结果cabal install 'HTF <= 0.9'.我试过ghc-pkg check给了我一个破损的包裹清单.我重新安装了软件包并重复尝试再次安装HTF,结果相同.
第一个问题是你已经regex-base建立了反对mtl-2.0.1.0,因此
package regex-base-0.93.2 requires mtl-2.0.1.0
package aeson-0.6.0.2 requires mtl-2.1.2
Run Code Online (Sandbox Code Playgroud)
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
Run Code Online (Sandbox Code Playgroud)
如果仍然存在冲突,那么应该检测它们,并且您可以通过取消注册其他包来帮助解决它们.
下一个问题是
ghc: could not execute: cpphs
Run Code Online (Sandbox Code Playgroud)
这看起来好像你有没有cpphs在你的PATH.要么你没有安装它,在这种情况下你需要在安装之前完成它HTF,或者安装它的目录需要添加到PATH.
| 归档时间: |
|
| 查看次数: |
1020 次 |
| 最近记录: |