【发布时间】:2020-06-04 23:58:33
【问题描述】:
我在使用 GHC 8.10 上的 proto-lens 库时遇到问题。 它没有得到支持。团队修复了问题,但没有发布关于 Hackage 的更新,我正在尝试仅从 github 标签中提取修复。
将以下部分添加到 stack.yaml 后,构建过程没有任何区别
allow-newer: true
extra-deps:
- github: google/proto-lens
commit: 0bef8c2f3da645f068b8a26ac168c1da41608182
subdirs: proto-lens
我想我错过了什么。 我不清楚 Stack 是如何看待这种自定义依赖的。 作为proto-len的来源的联想在哪里? 如果我在 subdirs 或 url 中打错了怎么办? 所以 Stack 可以得到别的东西,它甚至可以是一个正确的 Stack 库,但不是 proto-lens。
构建失败日志
Warning: Unknown/unsupported 'ghc' version detected (Cabal 3.0.2.0 supports
'ghc' version < 8.10): /opt/ghc/8.10.1/bin/ghc is version 8.10.1
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: megaexample-0.4.2 (user goal)
[__1] trying: base-4.14.0.0/installed-4.1... (dependency of megaexample)
[__2] trying: opentelemetry-extra-0.4.2 (user goal)
[__3] next goal: proto-lens (dependency of opentelemetry-extra)
[__3] rejecting: proto-lens-0.6.0.0 (conflict:
base==4.14.0.0/installed-4.1..., proto-lens => base>=4.10 && <4.14)
[__3] rejecting: proto-lens-0.5.1.0, proto-lens-0.5.0.1, proto-lens-0.5.0.0,
proto-lens-0.4.0.1 (conflict: base==4.14.0.0/installed-4.1..., proto-lens =>
另一个补充问题:堆栈中的库版本在哪里指定? 堆栈从 0.6 开始,但在源代码树中没有这样的文字。
我也应该调整 cabal 文件吗? cabal 文件中引用了 proto-lens 库。
executable eventlog-to-opentelemetry
import: options
main-is: Main.hs
hs-source-dirs: exe/eventlog-to-opentelemetry
other-modules: Console, Json, Resource, Attribute, Spans
build-depends:
aeson,
base,
bytestring,
clock,
filepath,
microlens,
microlens-th,
opentelemetry >= 0.4.0,
opentelemetry-extra,
opentelemetry-proto,
optparse-applicative,
proto-lens,
text,
unordered-containers,
default-language: Haskell2010
【问题讨论】:
-
你有
stack.yaml的lts版本吗?
标签: haskell protocol-buffers cabal haskell-stack