时间:2018-11-15 02:00:30

标签: haskell cabal haskell-stack

我还没有尝试解决问题;首先,我想了解问题的出处:

TextTerra $ stack --nix test

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

In the dependencies for TextTerra-0.1.0.0:
    easytest-0.2 from stack configuration does not match ==0.2.1  (latest matching version is 0.2.1)
needed since TextTerra is a build target.

Some different approaches to resolving this:

  * Set 'allow-newer: true' to ignore all version constraints and build anyway.

  * Consider trying 'stack solver', which uses the cabal-install solver to attempt to find some working build configuration. This can be convenient when dealing with many complicated constraint
    errors, but results may be unpredictable.

  * Recommended action: try adding the following to your extra-deps in /home/brandon/workspace/TextTerra/stack.yaml:

- easytest-0.2.1

Plan construction failed.

现在没有其他提及easytest,尤其是easytest-0.2;唯一的参考就是我刚刚添加的内容:

TextTerra $ rg easytest
TextTerra.cabal
67:      , easytest == 0.2.1

但是,cabal.config中引用了easytest-0.2。我不知道此文件的相关性,因为快速搜索不会打开太多文件,并且删除文件对构建没有影响(特别是,我在上面得到了相同的错误消息)。

1 个答案:

答案 0 :(得分:2)

在...

  堆栈配置中的

easytest-0.2==0.2.1不匹配

...“堆栈配置”是指通过resolver指定的一组软件包(通常是Stackage快照-您可以在Stackage site的快照中找到软件包和版本的列表)和extra-deps中的stack.yaml,而==0.2.1文件要求的是.cabal约束。错误消息给出的建议(用.cabal忽略allow-newer上限,并将软件包添加到extra-deps)在需要或需要使用具体的解析器。如果不是这种情况(例如,如果您尝试将旧项目更新为最新的LTS快照),则还可以将解析程序更改为包含要查找的软件包和版本的文件(如果有这样的解析程序可用) )。

相关问题