繁体   English   中英

对于 haskell 堆栈,我无法安装 Spock

[英]For haskell stack I can't install Spock

对于堆栈,当我尝试为 Spock 使用堆栈安装时,它给了我这个错误(见下文)。

我试图自己安装每一个(单独的包),但没有用。 我试图遵循Haskell Stack 包安装错误中的答案,但也没有奏效。

Error: While constructing the build plan, the following exceptions were encountered:

In the dependencies for Spock-0.13.0.0:
    Spock-core must match >=0.13, but the stack configuration has no specified version  (latest
               matching version is 0.13.0.0)
    reroute must match >=0.5, but the stack configuration has no specified version  (latest matching
            version is 0.5.0.0)
    stm-containers must match >=0.2 && <0.3, but the stack configuration has no specified version
                   (latest matching version is 0.2.16)
needed since Spock is a build target.

Some different approaches to resolving this:

  * Consider trying 'stack solver', which uses the cabal-install solver to attempt to find some
    working build configuration. This can be convenient when dealing with many complicated
    constraint errors, but results may be unpredictable.

  * Recommended action: try adding the following to your extra-deps
    in C:\Windows\system32\stack.yaml:

Spock-core-0.13.0.0@sha256:06e007f23c47bdda52d2927da54160d73f1b6f51a977f3ca9087275698db8f0a
reroute-0.5.0.0@sha256:3360747cdc700c9808a38bff48b75926efa443d4af282396082329a218a8d9d3
stm-containers-0.2.16@sha256:e98efa8dcf0045ea8a78a04b4e2763cf2d8bc33aad0750e2f30a67f8f4e933b1

Plan construction failed.

我想安装没有错误。

此错误中的重要部分如下:

Spock-0.13.0.0的依赖中:Spock-core必须匹配>=0.13,但是栈配置没有指定版本

基本上,这就是正在发生的事情:主要的 Haskell 包存储库是Hackage 然而,Stack 从它自己的存储库中获取它的包,称为Stackage 正如头版所说:

Stackage 快照包括来自 Hackage 的固定包版本……它是一组精心策划的包,可以很好地协同工作

然而,Stackage 有一个主要问题:它没有包含 Hackage 中的每个包。 这表明该软件包在您使用的 Stackage 快照中没有指定版本。 但这就是 Stack 的错误消息所说的! 所以用简单的英语,来自 Stack 的错误表明Spock-core不包含在您选择的快照中。

那么,我们如何解决这个问题? 好吧,可以手动告诉 Stack 要使用哪个包版本。 事实上,这样做的说明包含在错误消息中:

 * Recommended action: try adding the following to your extra-deps in C:\\Windows\\system32\\stack.yaml: - Spock-core-0.13.0.0@sha256:06e007f23c47bdda52d2927da54160d73f1b6f51a977f3ca9087275698db8f0a - reroute-0.5.0.0@sha256:3360747cdc700c9808a38bff48b75926efa443d4af282396082329a218a8d9d3 - stm-containers-0.2.16@sha256:e98efa8dcf0045ea8a78a04b4e2763cf2d8bc33aad0750e2f30a67f8f4e933b1

这里, C:\\Windows\\system32\\stack.yaml是全局 Stack 配置文件的路径。 要消除错误,您需要打开该文件并找到以extra-deps:开头的行。 然后,删除该行并将其替换为从错误消息中获取的以下信息:

extra-deps:
- Spock-core-0.13.0.0@sha256:06e007f23c47bdda52d2927da54160d73f1b6f51a977f3ca9087275698db8f0a
- reroute-0.5.0.0@sha256:3360747cdc700c9808a38bff48b75926efa443d4af282396082329a218a8d9d3
- stm-containers-0.2.16@sha256:e98efa8dcf0045ea8a78a04b4e2763cf2d8bc33aad0750e2f30a67f8f4e933b1

这会通知 Stack 您要使用Spock-core 0.13.0.0 版、 reroute 0.5.0.0 版stm-containers 0.2.16 版。 通常,Stack 可以使用相应 Stackage 快照中的信息自行计算出此信息,但在这种情况下,快照不包含有关这三个包的信息,这就是您必须自己指定此信息的原因。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM