如何使容器包在堆栈中匹配我想要的版本?
How do I make the containers package match in stack for the version I want?
在我的 cabal 文件中,我有以下构建依赖项:
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 文件,我如何告诉堆栈我想要更新版本的容器?
我也尝试了 运行ning 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
请注意,目前只有 0.5.7.1 在 Stackage 的 lts 中可用。
除了@Sibi 的出色回答外,我发现此命令会自动解决我的依赖性问题:
stack solver --update-config
在我的 cabal 文件中,我有以下构建依赖项:
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 文件,我如何告诉堆栈我想要更新版本的容器?
我也尝试了 运行ning 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
请注意,目前只有 0.5.7.1 在 Stackage 的 lts 中可用。
除了@Sibi 的出色回答外,我发现此命令会自动解决我的依赖性问题:
stack solver --update-config