Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/haskell/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Haskell stack install使用哪个stackage快照?_Haskell_Haskell Stack - Fatal编程技术网

Haskell stack install使用哪个stackage快照?

Haskell stack install使用哪个stackage快照?,haskell,haskell-stack,Haskell,Haskell Stack,试图逃跑 stack install git-mediate (每) 我收到一条关于依赖程序包版本的错误消息: Error: While constructing the build plan, the following exceptions were encountered: In the dependencies for git-mediate-1.0.8: Diff-0.3.4 from stack configuration does not match >=0.4

试图逃跑

stack install git-mediate
(每)

我收到一条关于依赖程序包版本的错误消息:

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

In the dependencies for git-mediate-1.0.8:
    Diff-0.3.4 from stack configuration does not match >=0.4  (latest matching version is 0.4.0)
needed since git-mediate is a build target.

Some different approaches to resolving this:

  * Set 'allow-newer: true' in /Users/yairchu/.stack/config.yaml to ignore all version constraints and build anyway.

  * Recommended action: try adding the following to your extra-deps in /Users/yairchu/.stack/global-project/stack.yaml:

- Diff-0.4.0@sha256:b5cfbeed498f555a18774ffd549bbeff7a24bdfe5984154dcfc9f4328a3c2847,1275

Plan construction failed.
奇怪的是,堆栈配置具有
Diff-0.3.4
,目前包括LTS和夜间堆栈快照(
LTS-16.8
nightly-2020-10-13


这个堆栈配置是什么?为什么它被固定到旧版本的库中?

堆栈
隐式使用它,它在
~/.stack/global project/stack.yaml
中定义。要控制正在使用的堆栈快照,可以编辑此文件(或删除此文件以使用最新的LTS)

堆栈安装
堆栈生成的别名--复制bin
,因此它实际上只是
堆栈生成
以及将生成的可执行文件复制到
~/.local/bin
的附加步骤

因此,真正的问题是“如何
堆栈构建
决定使用哪个解析器?”如果在命令行中提供,它将使用该解析器,如:

stack install --resolver lts-16.18 git-mediate
如果不提供显式解析器,则默认值取决于build命令的运行位置。如果在堆栈项目中运行它,它将默认为项目的
stack.yaml
文件中指定的解析器。例如:

stack new --resolver lts-16.0 exampleproject  # create project with lts-16.0 resolver
cd exampleproject
stack build git-mediate   # this will build git-mediate using lts-16.0
如果您在任何项目之外构建它,那么它将使用全局项目设置,这将是
~/.stack/global project/stack.yaml
中设置的任何
解析器

请注意,
堆栈安装
别名将始终将可执行文件复制到“全局”
~/.local/bin
,而不管它构建在何处。因此,如果您在
exampleproject
目录中运行
stack install git mediate
,如上所述,您将获得以
lts-16.0
作为全局安装版本构建的版本

太好了。。。运行
堆栈安装时要小心


请注意,关于
git mediate
,最近有一个bug版本发布到Stackage,如文档所示。错误消息与您得到的消息略有不同,但潜在的问题可能是相同的。因此,如果您还没有解决构建问题,那么只要运行
堆栈更新
而不必修改解析器设置,就可以解决构建问题。

上有一些关于
堆栈的“全局项目”的文档。您可以在
/Users/yairchu/.stack/global project/stack.yaml
@sjakobi中编辑“全局项目”中使用的快照,谢谢!这就解释了解析器的来源。你想把你的评论变成我可以接受的答案吗?我很清楚git mediate最近的问题-我在修复同一个问题的过程中问了这个问题:)哈!我没有发现这种联系。如果有人在搜索这个bug时偶然发现了这个问题,那么这个注释可能会有所帮助。