我向Haskell的蛇眼项目提交了一个更改,这是我正在进行的一个项目所需要的。更改在版本0.6.7003.1中,该版本尚未传播到nixos存储库(nixos.org显示其当前版本为0.6.7001.0)。
由于这个所需的依赖项与解析器的LTS版本不同,我在stack.yaml中标记了额外的依赖项
packages:
- git@github.com:tomjaguarpaw/haskell-opaleye.git
- commit: cf3296c5ffef58d36dd6b386ae53dff519ee47e9我还在我的build-depends文件project.cabal中标记了这个版本:
build-depends: opaleye >= 0.6.7003.1 && < 1然后,当我试图构建时,我得到了以下错误:
$ stack build
Error: While constructing the build plan, the following exceptions were encountered:
In the dependencies for taskmaster-0.1.0.0:
opaleye must match >=0.6.7003.1 && <1, but the stack configuration has no specified version (latest matching version is 0.6.7003.1)
needed since taskmaster is a build target.
Some different approaches to resolving this:
* 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/matthew/backup/taskmaster/taskmaster/stack.yaml:
opaleye-0.6.7003.1@sha256:914ac99c6f7ceea050df843ac31c33be0f6340bc0f05753c8fdfc18074fa9e5b
Plan construction failed.(我不明白这个长(>40个字符) sha256散列来自何处)。我遵循了这个建议,并在我的stack.yaml中添加了以下内容。
extra-deps:
- opaleye-0.6.7003.1@sha256:914ac99c6f7ceea050df843ac31c33be0f6340bc0f05753c8fdfc18074fa9e5b当我运行$ stack build来构建我的项目时,编译器会尝试构建,而不会显示任何依赖错误。但是,如果它使用包含我的更改的Opaleye版本,则会产生一个类型错误。而且,当我运行$ stack ghci并导入相关的opaleye模块时,我的更改是不存在的。似乎堆栈仍然在使用较旧的opaleye版本。如何才能让堆栈使用包含更改的较新版本的蛋白石眼?我的尝试似乎已经用尽了haskell堆栈文档中提到的选项。
发布于 2019-01-04 03:09:48
原来堆栈的extra-deps建议是不正确的。我注意到了此堆栈github问题下的另一种格式,给了它一次尝试,它碰巧对我有用。下面列出了工作的extra-deps格式。
extra-deps:
- github: tomjaguarpaw/haskell-opaleye
commit: cf3296c5ffef58d36dd6b386ae53dff519ee47e9发布于 2019-01-08 14:42:39
hackage选项通常比github外挂更好。
您最初尝试的正确语法是
extra-deps:
- git: https://github.com/tomjaguarpaw/haskell-opaleye.git
commit: cf3296c5ffef58d36dd6b386ae53dff519ee47e9而github: tomjaguarpaw/haskell-opaleye版本只是一条捷径。
sha256散列是与该版本(和修改版)对应的阴谋文件的sha256sum。
考虑到opaleye的版本是已经被黑客攻击了,您应该能够添加堆栈建议的行。您可能希望在进行更改后尝试一个stack clean (尽管它不应该是必要的)。
如果你提供更多的信息,我会更新这个答案。
https://stackoverflow.com/questions/54000712
复制相似问题