Haskell 阴谋集团沙箱地狱:无法解决depdencies
我正在尝试使用沙箱构建我的包。如果没有它,它的编译和工作就像一个符咒。有一次我介绍了一个沙箱,尽管阴谋集团说它不能解决依赖关系。在我看来,这些冲突看起来不像冲突 项目结构如下:Haskell 阴谋集团沙箱地狱:无法解决depdencies,haskell,sandbox,cabal,Haskell,Sandbox,Cabal,我正在尝试使用沙箱构建我的包。如果没有它,它的编译和工作就像一个符咒。有一次我介绍了一个沙箱,尽管阴谋集团说它不能解决依赖关系。在我看来,这些冲突看起来不像冲突 项目结构如下: application (depends on library-base, library-impl1 and library-impl2) library ├ library-base ├ library-impl1 (depends on library-base) └ library-impl2 (depe
application (depends on library-base, library-impl1 and library-impl2)
library
├ library-base
├ library-impl1 (depends on library-base)
└ library-impl2 (depends on library-base)
这些是我按顺序运行的命令
rm -rf ~/.cabal
rm -rf ~/.ghc
cabal update
rm -f cabal.sandbox.config
rm -rf .cabal-sandbox
cabal sandbox init
cabal sandbox add-source $LIB_HOME/library-base
cabal sandbox add-source $LIB_HOME/library-impl1
cabal sandbox add-source $LIB_HOME/library-impl2
cabal install --only-dependencies --force-reinstalls && cabal build
cabal安装--仅依赖项--强制重新安装
生成以下输出:
Resolving dependencies...
cabal: Could not resolve dependencies:
next goal: lens (dependency of library-base-0.1.0.0)
rejecting: lens-4.15.4/installed-I5C... (conflict: bifunctors==5.4.2, lens =>
bifunctors==5.4.2/installed-Hs7...)
trying: lens-4.15.4
trying: unordered-containers-0.2.8.0/installed-1tq... (dependency of
lens-4.15.4)
next goal: text (dependency of lens-4.15.4)
rejecting: text-1.2.2.2/installed-3EN... (conflict: binary==0.8.5.1, text =>
binary==0.8.3.0/installed-0.8...)
trying: text-1.2.2.2
next goal: hashable (dependency of lens-4.15.4)
rejecting: hashable-1.2.6.1/installed-2nP... (conflict: text==1.2.2.2,
hashable => text==1.2.2.2/installed-3EN...)
rejecting: hashable-1.2.6.1, hashable-1.2.6.0, hashable-1.2.5.0,
hashable-1.2.4.0, hashable-1.2.3.3, hashable-1.2.3.2, hashable-1.2.3.1,
hashable-1.2.3.0, hashable-1.2.2.0, hashable-1.2.1.0, hashable-1.2.0.10,
hashable-1.2.0.9, hashable-1.2.0.8, hashable-1.2.0.7, hashable-1.2.0.6,
hashable-1.2.0.5, hashable-1.2.0.4, hashable-1.2.0.3, hashable-1.2.0.2,
hashable-1.2.0.1, hashable-1.2.0.0, hashable-1.1.2.5, hashable-1.1.2.4,
hashable-1.1.2.3, hashable-1.1.2.2, hashable-1.1.2.1, hashable-1.1.2.0,
hashable-1.1.1.0, hashable-1.1.0.0, hashable-1.0.1.1, hashable-1.0.1.0,
hashable-1.0.0 (conflict: unordered-containers =>
hashable==1.2.6.1/installed-2nP...)
Dependency tree exhaustively searched.
有人知道这里发生了什么吗?首先,我将解释错误消息的内容。然后我将尝试猜测一下为什么会出现错误。然后我将提出下一步的建议 错误显示:
cabalinstall
命令。如果这是真的(是吗?或者这是该工具的第二次运行吗?为什么您有--force reposts
?),它不能从您的沙箱中拾取已安装的版本,因此必须从您的全局包数据库中拾取它们。将东西安装到全局包数据库通常被认为是一个坏主意,因为要正确清除混乱/损坏的全局包数据库要困难得多。以后再考虑吧
现在,为了取得进展,我将尝试以下两种方法之一:
cabal install --only-dependencies --constraint 'unordered-containers installed' --constraint 'binary installed'
等等,对于它提到的试图重建但您不希望重建的任何其他包。或者,如果您不希望安装某个版本,可以在--constraint
中设置精确的版本约束。不包括——强制重新安装
,基本上永远不会首先,我将解释错误消息所说的内容。然后我将尝试猜测一下为什么会出现错误。然后我将提出下一步的建议 错误显示:
cabalinstall
命令。如果这是真的(是吗?或者这是该工具的第二次运行吗?为什么您有--force reposts
?),它不能从您的沙箱中拾取已安装的版本,因此必须从您的全局包数据库中拾取它们。将东西安装到全局包数据库通常被认为是一个坏主意,因为要正确清除混乱/损坏的全局包数据库要困难得多。以后再考虑吧
现在,为了取得进展,我将尝试以下两种方法之一: