haskell 如何处理阴谋集团中的从属冲突?

mznpcxlj  于 2023-01-26  发布在  其他
关注(0)|答案(1)|浏览(149)

当我尝试添加scotty包到我的多项目cabal文件,我得到以下依赖冲突。我不太确定这意味着什么。

harshal@Harshals-Linux hello-haskell % cabal build

Resolving dependencies...
Error: cabal: Could not resolve dependencies:
[__0] trying: playground-0.1.0.0 (user goal)
[__1] trying: scotty-0.12.1 (dependency of playground)
[__2] trying: warp-3.3.23 (dependency of scotty)
[__3] trying: unix-compat-0.6 (dependency of warp)
[__4] trying: unix-2.7.3/installed-2.7.3 (dependency of warp)
[__5] next goal: directory (dependency of playground)
[__5] rejecting: directory-1.3.7.1/installed-1.3.7.1 (conflict: playground =>
directory>=1.3.8.0)
[__5] rejecting: directory-1.3.8.0 (conflict: unix==2.7.3/installed-2.7.3,
directory => unix>=2.8.0 && <2.9)
[__5] rejecting: directory-1.3.7.1 (conflict: playground =>
directory>=1.3.8.0)
[__5] skipping: directory-1.3.7.0, directory-1.3.6.2, directory-1.3.6.1,
directory-1.3.6.0, directory-1.3.5.0, directory-1.3.4.0, directory-1.3.3.2,
directory-1.3.3.1, directory-1.3.3.0, directory-1.3.2.2, directory-1.3.2.1,
directory-1.3.2.0, directory-1.3.1.5, directory-1.3.1.4, directory-1.3.1.3,
directory-1.3.1.2, directory-1.3.1.1, directory-1.3.1.0, directory-1.3.0.2,
directory-1.3.0.1, directory-1.3.0.0, directory-1.2.7.1, directory-1.2.7.0,
directory-1.2.6.3, directory-1.2.6.2, directory-1.2.5.1, directory-1.2.5.0,
directory-1.2.4.0, directory-1.2.3.1, directory-1.2.3.0, directory-1.2.2.1,
directory-1.2.2.0, directory-1.2.1.0, directory-1.2.0.1, directory-1.2.0.0,
directory-1.1.0.2, directory-1.1.0.1, directory-1.1.0.0, directory-1.0.1.2,
directory-1.0.1.1, directory-1.0.1.0, directory-1.0.0.3, directory-1.0.0.0,
directory-1.2.6.1 (has the same characteristics that caused the previous
version to fail: excluded by constraint '>=1.3.8.0' from 'playground')
[__5] fail (backjumping, conflict set: directory, playground, unix)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: directory, unix, playground,
unix-compat, warp, unix-compat:portable, scotty
Try running with --minimize-conflict-set to improve the error message.

如何解决此依赖项冲突?

9jyewag0

9jyewag01#

这说明:

  • playground-0.1.0.0依赖于
  • directory-1.3.8.0directory >= 1.3.8.0的唯一表观解
  • directory-1.3.8.0依赖于unix >= 2.8.0 && <2.9
  • 我们已经提交了unix==2.7.3,它不满足该约束

因此,您可以尝试的一件事是,通过添加一个顶级约束来给予它您想要选择一个较新的unix

% cabal build --constraint `unix >=2.8.0 && <2.9`

顶层约束比通过搜索依赖项找到的约束更早“可用”,因此可以更好地约束更早的选择。(我相信这个属性--约束以某种不完全用户可见的顺序得到解决和提交--是为了使依赖项解析算法更有效。真扫兴。)

相关问题