Bjo*_*orn 2 haskell dependency-management haskell-stack
在我的集团文件中,我具有以下构建依赖性:
build-depends: base >= 4.7 && < 5,
containers >= 0.5.10 && < 0.6
Run Code Online (Sandbox Code Playgroud)
当我尝试运行时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)
Run Code Online (Sandbox Code Playgroud)
我遇到了这个问题,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
Run Code Online (Sandbox Code Playgroud)
尝试将以下内容放入stack.yaml:
extra-deps:
- containers-0.5.10.2
Run Code Online (Sandbox Code Playgroud)
使它起作用的另一种方法是更改您的阴谋约束。使它像这样应该使其工作:
build-depends: base >= 4.7 && < 5,
containers >= 0.5.7 && < 0.6
Run Code Online (Sandbox Code Playgroud)
请注意,目前Stackage中只有0.5.7.1可用。