未找到cabal沙箱依赖项

时间:2015-08-21 13:31:55

标签: haskell sandbox cabal

当我使用cabal沙箱时遇到问题,我为'hello world'应用程序创建了一个沙箱但是当我尝试运行cabal install --only-dependencies时出现以下错误:

$ cabal install --only-dependencies
Resolving dependencies... cabal: Could not resolve dependencies:
trying: haskeline-0.7.2.1/installed-dad... (user goal) next goal:
helloworld (user goal) rejecting: helloworld-0.1.0.0 (conflict:
haskeline => base==4.7.0.2/installed-918..., helloworld => base>=4.8
&& <4.9) Dependency tree exhaustively searched.

Note: when using a sandbox, all packages are required to have
consistent dependencies. Try reinstalling/unregistering the offending
packages or recreating the sandbox.

我想提一下,如果我尝试在此沙箱上运行 cabal repl ,我会收到错误。

$ cabal repl
Package has never been configured. Configuring with default flags. If
this fails, please run configure manually. Resolving dependencies...
Configuring helloworld-0.1.0.0... cabal: At least the following
dependencies are missing: base ==4.8.*

如果我在沙盒之外运行cabal repl,一切正常。

如果你们有任何想法请与我分享:),

感谢 索林

1 个答案:

答案 0 :(得分:1)

看起来您的版本限制要求您使用GHC 7.10-捆绑基础版本4.8-而您使用GHC 7.8和基础4.7。你可以:

  • 修改cabal文件及其基本版本边界
  • 切换到不同版本的GHC
  • 尝试使用stack进行构建,这将在堆栈初始化期间自动检测这些类型的事物,然后为您安装适当的GHC。