haskell - 当指定超出依赖项的版本范围的额外dep时,堆栈无法在快照中找到包
问题描述
我有一个package.yaml
包含
dependencies:
- aeson >= 0.8 && < 1.5
- base >= 4.7 && < 5
- time >= 1.5 && < 1.10
我想使用time
比lts-14.4
快照中更新的版本,所以我创建了一个stack.yaml
:
resolver: lts-14.4
packages:
- .
extra-deps:
- time-1.9.2
但是,当我运行时stack build
,我得到了输出
WARNING: Ignoring aeson's bounds on time (>=1.4 && <1.9); using time-1.9.2.
Reason: trusting snapshot over cabal file dependency information.
Error: While constructing the build plan, the following exceptions were encountered:
In the dependencies for base-compat-0.10.5:
unix needed, but the stack configuration has no specified version (latest matching version is 2.7.2.2)
needed due to tmphaskell-0.1.0.0 -> base-compat-0.10.5
Some different approaches to resolving this:
* Recommended action: try adding the following to your extra-deps in /Users/will/src/tmphaskell/stack.yaml:
- unix-2.7.2.2@sha256:e69269a17b9fa26cb77f3f55e86c39d0a4940ccfa0c4bc20826919d2572076ad,3496
Plan construction failed.
unix-2.7.2.2
快照中确实存在我对此不了解的内容,lts-14.4
那么为什么无法堆栈找到指定的版本?
在我将它升级到2.1.3
. 我不确定我之前运行的是哪个版本。
解决方案
aeson
(via base-compat
) 依赖于unix
and astime
并且unix
是 ghc 引导包,两者都需要添加 as extra-deps
。
原因?引导库不必匹配它们的 hackage 版本,因此如果您覆盖引导包,您还必须明确覆盖您使用的任何其他包。
来源:https ://www.snoyman.com/blog/2019/01/mismatched-global-packages
(编辑固定错误;误读精确错误)。
推荐阅读
- java - 将 ServerValue.TIMESTAMP 保存为实时数据库中的字符串
- android - 在第一次运行时初始化数据库
- java - 我们是否需要 Observable.just(..) 或 Observable.fromCallable{...},因为我们已经有了 Single.just(..) 或 Single.fromCallable{...}?
- c++ - 看不懂learnopengl.com漫射辐照度教程中的captureViews
- node.js - 如何在 express 中包含 api 路由器的 css 文件?
- eclipse - 在 pom .xml 中显示错误:Failure to transfer org.apache.maven.shared:file-management:pom:3.0.0
- file - 使用 fancybox 和 google doc viewer 查看 j2ee web 应用程序中的文件
- php - PHP中的多个数据库选择,但分别打印ID
- r - 在 R 中的模拟退火算法中添加约束
- android - Android与iOS中ble扫描率的差异