What's the reason behind cabal (dependency) hell?

[亡魂溺海] 提交于 2019-11-29 10:06:48

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.

The problem is that you cannot link your program against those different versions of package C. A and B have to find a common version of C to use the same implementation of a certain function. One solution to this problem is OSGi but requires stuff like Classloaders which can be used to load different versions of package C in the same process w/o conflicts.

One way dependency hell happens is when several different projects you are working on interfere. While a single project has a solvable constraint set, two different project might not and since they're sharing a single package DB, there will be trouble. This variant of dependency hell is solved by cabal sandboxes.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!