gpt4 book ai didi

haskell - Cabal 沙箱正在使用全局依赖项。无法解决

转载 作者:行者123 更新时间:2023-12-02 16:55:12 28 4
gpt4 key购买 nike

我正在尝试将 timerep 添加到现有应用程序中。我无法让它解决我的依赖关系。看起来它正在使用全局安装的 time == 1.4.2 版本,而 >= 1.5 对于我的应用程序来说是理想的选择。

我怎样才能让 cabal 使用时间1.5?我已经研究过 unix、tls、process、timerep,如果只使用 time >= 1.5,它们似乎都能正常工作。

错误如下:

serials> cabal install --only-dependencies
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: serials-0.1.0.2 (user goal)
trying: mandrill-0.2.2.0 (dependency of serials-0.1.0.2)
trying: http-client-tls-0.2.2 (dependency of mandrill-0.2.2.0)
trying: tls-1.2.17 (dependency of http-client-tls-0.2.2)
trying: x509-validation-1.5.2 (dependency of tls-1.2.17)
trying: process-1.2.0.0/installed-487... (dependency of x509-validation-1.5.2)
next goal: unix (dependency of process-1.2.0.0/installed-487...)
rejecting: unix-2.7.0.1/installed-299... (conflict: unix =>
time==1.4.2/installed-bf9..., serials => time>=1.5)
rejecting: unix-2.7.1.0, 2.7.0.1, 2.7.0.0, 2.6.0.1, 2.6.0.0, 2.5.1.1, 2.5.1.0,
2.5.0.0, 2.4.2.0, 2.4.1.0, 2.4.0.2, 2.4.0.1, 2.4.0.0, 2.3.2.0, 2.3.1.0,
2.3.0.0, 2.2.0.0, 2.0 (conflict: process => unix==2.7.0.1/installed-299...)
Dependency tree exhaustively searched.
<小时/>

Cabal file :

-- Initial serials.cabal generated by cabal init.  For further
-- documentation, see http://haskell.org/cabal/users-guide/

name: serials
version: 0.1.0.2
synopsis: serials
description: serials
license: MIT
license-file: LICENSE
author: Sean Hess
maintainer: Sean Hess
-- copyright:
category: Web Scraper
build-type: Simple
extra-source-files: README.md
cabal-version: >=1.10
Source-repository head
type: git
location: git@github.com:seanhess/serials.git

executable serials
main-is: Main.hs
hs-source-dirs: server
ghc-options: -fcontext-stack=36
-- other-modules:
-- other-extensions:
default-language: Haskell2010
build-depends:
base >=4.7 && <5,
tagsoup,
text,
scalpel,
containers,
network-uri,
monad-loops,
wreq,
lens,
bytestring,
parsec,
utf8-string,
tagsoup,
xml,
feed,
regex-pcre,
aeson,
network,
wai,
wai-extra,
wai-cors,
wai-middleware-static,
warp,
servant-server >= 0.4,
rethinkdb >= 1.16,
transformers,
either,
unordered-containers,
mtl,
http-types,
safe,
hashable,
resource-pool,
time >= 1.5,
pooled-io,
shelly,
string-conversions,
bcrypt,
random,
jwt,
cookie,
entropy,
mandrill == 0.2.2.0,
email-validate,
blaze-markup,
blaze-html,
iso8601-time,
scotty == 0.10.0,
timerep >= 2.0.0

最佳答案

cabal-install 很难对安装问题的相互不兼容性产生完整的描述。相反,它决定打印第一个失败路径。

但是,它会打印Dependency tree详尽搜索。,这表明实际上没有解决给定问题的方法。

通常有帮助的一件事是查看 cabal-install 所做的选择,找到一个看起来不太理想的选择,然后添加一个显式约束来更改它。这可能会产生更好的错误消息。

让我们尝试一下[注意,我不确定我是否拥有与您完全相同的包数据库,因此它可能会在您的系统上产生不同的结果]。

您有(已安装软件包的模哈希):

$ cabal install --only-dependencies
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: serials-0.1.0.2 (user goal)
trying: mandrill-0.2.2.0 (dependency of serials-0.1.0.2)
trying: http-client-tls-0.2.2 (dependency of mandrill-0.2.2.0)
trying: tls-1.2.17 (dependency of http-client-tls-0.2.2)
trying: x509-validation-1.5.2 (dependency of tls-1.2.17)
trying: process-1.2.0.0/installed-06c... (dependency of x509-validation-1.5.2)
next goal: unix (dependency of process-1.2.0.0/installed-06c...)
rejecting: unix-2.7.0.1/installed-f86... (conflict: unix =>
time==1.4.2/installed-9b3..., serials => time>=1.5)
rejecting: unix-2.7.1.0, 2.7.0.1, 2.7.0.0, 2.6.0.1, 2.6.0.0, 2.5.1.1, 2.5.1.0,
2.5.0.0, 2.4.2.0, 2.4.1.0, 2.4.0.2, 2.4.0.1, 2.4.0.0, 2.3.2.0, 2.3.1.0,
2.3.0.0, 2.2.0.0, 2.0 (conflict: process => unix==2.7.0.1/installed-f86...)
Dependency tree exhaustively searched.

通过这个查看,错误发生在unix上,它是process的依赖项。因此,选择process的已安装实例会导致麻烦。那么如果我们不允许选择 process 的实例怎么办?

$ cabal install --only-dependencies --constraint="process source"
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: serials-0.1.0.2 (user goal)
next goal: time (dependency of serials-0.1.0.2)
rejecting: time-1.4.2/installed-9b3... (conflict: serials => time>=1.5)
trying: time-1.5.0.1
next goal: rethinkdb (dependency of serials-0.1.0.2)
rejecting: rethinkdb-1.16.0.0 (conflict: time==1.5.0.1, rethinkdb =>
time==1.4.*)
rejecting: rethinkdb-1.15.2.1, 1.15.2.0, 1.15.1.0, 1.15.0.0, 1.8.0.5, 1.8.0.4,
1.8.0.3, 1.8.0.2, 1.8.0.1, 1.8.0.0, 0.1.0.0 (conflict: serials =>
rethinkdb>=1.16)
Dependency tree exhaustively searched.

啊哈!因此,rethinkdb(它是 serials 的直接依赖项)对 time == 1.4.* 具有显式依赖项。这与 serialstime >= 1.5 的依赖关系直接冲突。

这并不容易解决。您需要让 rethinkdb 使用较新的 time 库,或者让 serials 使用较旧的库。

我们现在进入推测领域:rethinkdb 有可能(但不能保证)实际上适用于较新版本的 time。我们可以尝试指示 cabal-install 考虑这样的安装计划:

$ cabal install --only-dependencies --allow-newer=time

这实际上在我的机器上生成了一个安装计划。我没有尝试构建它,我不知道它是否有效。但也许值得一试。

关于haskell - Cabal 沙箱正在使用全局依赖项。无法解决,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30718440/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com