为什么我在“堆栈测试”工作时遇到运行“stack haddock”的构建计划错误?

时间:2015-09-05 19:31:07

标签: haskell haddock haskell-stack

我正在Windows 8上使用Stack 0.1.3.1创建一个新的Haskell项目。我的stack.yaml文件如下所示:

flags: {}
packages:
- 'lazy-engine'
extra-deps: []
resolver: lts-3.4

当我运行stack buildstack test时,一切都很顺利。我可以从命令行手动运行haddock,这也可以。但是当我运行stack haddock时,我得到这样的输出:

Setting codepage to UTF-8 (65001) to ensure correct output from GHC
NOTE: the haddock command is functionally equivalent to 'build --haddock'
While constructing the BuildPlan the following exceptions were encountered:

--  Failure when adding dependencies:
      base: needed (>=4.5 && <4.9), latest is 4.8.1.0, but not present in build plan
    needed for package: array-0.5.1.0

--  While attempting to add dependency,
    Could not find package base in known packages

--  Failure when adding dependencies:
      array: needed (-any), latest is 0.5.1.0, but couldn't resolve its dependencies
      base: needed (>=4.2 && <5), latest is 4.8.1.0, but not present in build plan
      deepseq: needed (>=1.2 && <1.5), latest is 1.4.1.2, but couldn't resolve its dependencies
      ghc-prim: needed (-any), latest is 0.4.0.0, but not present in build plan
    needed for package: containers-0.5.6.2

--  Failure when adding dependencies:
      array: needed (>=0.3 && <0.6), latest is 0.5.1.0, but couldn't resolve its dependencies
      base: needed (==4.3.* || >=4.5 && <4.9), latest is 4.8.1.0, but not present in build plan
    needed for package: deepseq-1.4.1.1

--  While attempting to add dependency,
    Could not find package ghc-prim in known packages

--  Failure when adding dependencies:
      base: needed (>=4.7 && <5), latest is 4.8.1.0, but not present in build plan
      containers: needed (==0.5.*), latest is 0.5.6.3, but couldn't resolve its dependencies
    needed for package: lazy-engine-0.1.0.0

Recommended action: try adding the following to your extra-deps in 
    C:\Users\Aaron\Documents\GitHub\lazy-engine\stack.yaml
- base-4.8.1.0
- ghc-prim-0.4.0.0

You may also want to try the 'stack solver' command

显然这是胡说八道 - 我不应该将base添加到我的extra-deps,特别是因为我正在使用LTS套装!这是怎么回事?

更新:正如the answer below中所讨论的,这似乎是堆栈中的错误,应该在较新版本中修复。请参阅https://github.com/fpco/minghc/issues/85

2 个答案:

答案 0 :(得分:4)

猜测:您使用的GHC安装不包含文档,或者至少不是堆栈期望它被发现。你可以试试&#34; - install-ghc --no-system-ghc&#34;?我可能有特定的标志名称错误。

另外,如何在您的系统上安装GHC?

答案 1 :(得分:2)

我通过安装ghc-doc包(大多数包管理器都可用)解决了这个问题。