cabal(依赖)地狱背后的原因是什么? [英] What's the reason behind cabal (dependency) hell?
问题描述
在Cabal-install中如何发生依赖关系?
我在 Cabal / Survival - HaskellWiki :
1。 Cabal-install造成的困难是什么?
Cabal的主要困难是被称为'dependency hell',其中
cabal-install会无法为
或其他原因安装所需的软件包,从而导致大量手动工作。作为这个难题的
例子,考虑用户希望
安装软件包A和B的情况。这两种软件都可以使用软件包C,但不能使用相同版本的C而不是
。
我明白为什么这样做通常会有意义,但不能用Cabal-install / ghc-pkg,因为您可以有多个版本安装相同的软件包。
就好像每个版本都是完全不同的软件包,在很多方面它的版本成为软件包名称的一部分(例如 mustaches-0.1 .0.0
) - 也许它确实适用于ghc-pkg(我并不完全熟悉它,但它有道理)。
您有这样的场景:
在B和C都依赖于A的情况下。但是,如果它们安装在不同的时间,它们可能会取决于不同的版本o例如,版本1导出类型T = Int
,但在版本2中导出 type T = Bool
。
只有当您尝试构建D时,您是否会暴露B和C针对不同版本的A构建的问题,并且您无法比较 T版本1
与 T版本2
。
How does dependency hell happen in Cabal-install?
I read the following at Cabal/Survival - HaskellWiki:
1. What is the difficulty caused by Cabal-install?
The main difficulty with Cabal is otherwise known as 'dependency hell', in which the cabal-install does not manage to install a desired package for a reason or another, leading to large amount of manual work. As an example of this difficulty, consider a case where the user wishes to install packages A and B. Both of these work with package C, but not with the same version of C.
I understand why this would make sense generally, but not with Cabal-install/ghc-pkg, because you can have multiple versions of the same package installed.
It's as if every version is an entirely different package, with how that in many respects the version becomes a part of the package name (e.g. mustaches-0.1.0.0
) -- and maybe it really is for ghc-pkg (I'm not entirely familiar with it, but it would make sense).
You have scenarios like this:
Where both B and C depend on A. However, if they were installed at different times, they may depend on different versions of A. For example, A version 1 export type T = Int
, but in version 2 it exports type T = Bool
.
Only when you try to build D do you expose the problem that B and C were build against different versions of A, and you can't compare T version 1
against T version 2
.
这篇关于cabal(依赖)地狱背后的原因是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!