haskell - 如何使容器包装在堆栈中匹配所需的版本?

标签 haskell dependency-management haskell-stack

在我的集团文件中,我具有以下构建依赖性:

  build-depends:       base >= 4.7 && < 5,
                       containers >= 0.5.10 && < 0.6

当我尝试运行stack build时,出现以下错误:
Error: While constructing the build plan, the following exceptions were encountered:

In the dependencies for server-0.1.0.0:
    containers-0.5.7.1 must match >=0.5.10 && <0.6 (latest applicable is 0.5.10.2)

我在cabal中遇到了这个问题,我通过使用cabals的沙箱解决了它。我不知道如何通过查看--help文档,错误,堆栈文档和搜索来解决堆栈问题。如果不通过cabal文件,如何告诉堆栈我想要较新版本的容器?

我也尝试运行stack install containers-0.5.7.1,但没有达到我的预期。我在安装列表中看到一个容器。我注意到documentation说堆栈默认情况下是沙盒,但是由于容器的依赖性,让它构建这个简单的源文件非常痛苦。

我注意到此命令报告了旧版本的容器,而不是我想要的版本:
$ stack list-dependencies
array 0.5.1.1
base 4.9.1.0
containers 0.5.7.1
deepseq 1.4.2.0
ghc-prim 0.5.0.0

最佳答案

尝试将以下内容放入stack.yaml:

extra-deps:
- containers-0.5.10.2

使其起作用的另一种方法是更改​​您的阴谋约束。使它像这样应该使其工作:
 build-depends:       base >= 4.7 && < 5,
                      containers >= 0.5.7 && < 0.6

请注意,目前Stackage中只有0.5.7.1可用。

关于haskell - 如何使容器包装在堆栈中匹配所需的版本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44793106/

相关文章:

Haskell:如何解开数据中嵌套的可能

haskell - 实现 Reader monad(来自 Real World Haskell 书)

maven - Maven 依赖项中类型 "bundle"的含义是什么?

haskell-stack - '在路径 :' when running stack 上找不到名为 git 的可执行文件

haskell - 将 Haste 集成到 Stack 工具链中

gcc - 在 Windows 上将 c++ dll 与 Haskell-Platform 链接,输出 'undefined reference'

haskell - 严格声明的意义何在?

maven - 如何在gradle中使可传递依赖项也使用依赖项的原始来源?

包含项目中的 Java Netbeans 循环依赖

haskell - 堆栈安装可执行文件到自定义位置