我如何使容器包在堆栈中匹配我想要的版本? [英] How do I make the containers package match in stack for the version I want?

查看:74
本文介绍了我如何使容器包在堆栈中匹配我想要的版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的cabal文件中,我有以下的build-depends:

  build-depends:base> = 4.7& &安培; < 5,
货柜> = 0.5.10&& < 0.6

当我尝试运行 stack build 我得到以下错误:

 错误:在构建构建计划时,遇到以下异常:

在server-0.1.0.0的依赖关系中:
containers-0.5.7.1必须匹配> = 0.5.10&& < 0.6(最新适用的是0.5.10.2)

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



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



我注意到这个命令报告的是旧版本的容器,而不是我想要的版本:

  $ 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,
容器> = 0.5.7&& < 0.6

请注意,现在在Stackage中只有0.5.7.1可用。


In my cabal file I have the following build-depends:

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

When I try to run stack build I get the following error:

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)

I had this problem with cabal I resolved it by using cabals's sandboxes. I don't know how to resolve this problem with stack by looking at the --help documentation, the error, the stack documentation and searching. How do I tell stack I want the newer version of containers if not via the cabal file?

I also tried running stack install containers-0.5.7.1 which did not do what I expected it to. I see a containers in my list of installs. I noticed the documentation says stack is sandboxed by default, but it's been very painful getting it to build this simple source file due to the containers dependency.

I noticed that this command reports the old version of containers, not the version I want:

$ 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

解决方案

Try putting the following in stack.yaml:

extra-deps:
- containers-0.5.10.2

Another way to make it work is change your cabal constraints. Making it something like this should make it work:

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

Note that right now only 0.5.7.1 is available in lts in Stackage.

这篇关于我如何使容器包在堆栈中匹配我想要的版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆