不同的编程语言使用不同的打包系统
在各种方法中,Java Maven看起来对我来说是最好的选择,因为它在单独版本的文件夹中维护不同版本的jar文件,因此,没有办法最终会出现库的冲突版本.
接下来是python.Python pip将其软件包放入其中/usr/local/lib/python/dist-packages/site-packages.当存在版本冲突时,可以使用它virtualenv并使用它.
Nodejs支持在本地文件夹和全局文件夹中安装软件包.直到我的日期,我从未在全球图书馆中发生依赖冲突.
然后我对haskell的风格着迷并开始使用cabal.首先,我在里面安装我的库/home/user1/.cabal.然后当包装系统坏了,一位朋友建议我删除两个文件夹 - /home/user1/.cabal && /home/user1/.ghc.现在,我的第一个困惑出现了,为什么cabal的库文件位于两个文件夹中.cabal && .ghc.我清理了库文件夹,~/.ghc and ~/.cabal并cabal install从包源获取cabal-db-0.1.12.现在,出现了一个新的错误,我很惊讶,因为我已经清理了所有本地存储库.错误是,
Configuring Cabal-1.22.2.0...
Building Cabal-1.22.2.0...
Installed Cabal-1.22.2.0
cabal: Error: some packages failed to install:
ansi-terminal-0.6.2.1 failed during the configure step. The exception was:
user error (The package 'ansi-terminal' requires Cabal library version -any &&
>=1.6 but no suitable version is installed.)
Run Code Online (Sandbox Code Playgroud)
然后我尝试了最安全的赌注 - sandbox对cabal-db.有效.然后我重复沙盒换另一个pacakge,ghc-pkg-autofix.我做到了,
cd ghc-pkg-autofix-0.2.0.1
cabal sandbox init
cabal install
Run Code Online (Sandbox Code Playgroud)
对于那些绝对没有外部依赖关系的沙箱,再次出现错误,
cabal: Could not resolve dependencies:
trying: ghc-pkg-autofix-0.2.0.1 (user goal)
trying: Cabal-1.22.2.0 (dependency of ghc-pkg-autofix-0.2.0.1)
next goal: process (dependency of ghc-pkg-autofix-0.2.0.1)
rejecting: process-1.2.0.0/installed-06c..., 1.2.3.0, 1.2.2.0, 1.2.1.0,
1.2.0.0, 1.1.0.2, 1.1.0.1, 1.1.0.0 (conflict: ghc-pkg-autofix => process>=1.0
&& <1.1)
rejecting: process-1.0.1.5, 1.0.1.4, 1.0.1.3, 1.0.1.2, 1.0.1.1, 1.0.0.0
(conflict: Cabal => process>=1.1.0.1 && <1.3)
Dependency tree exhaustively searched.
Note: when using a sandbox, all packages are required to have consistent
dependencies. Try reinstalling/unregistering the offending packages or
recreating the sandbox.
Run Code Online (Sandbox Code Playgroud)
我做错了什么(或)这种依赖性冲突在cabal中很常见?我知道,管理其他语言的依赖关系要简单得多.
注意:我使用cabal-install version 1.22.0.0&&The Glorious Glasgow Haskell Compilation System, version 7.8.4
"对于那些绝对没有外部依赖关系的沙箱",这不是真的.沙箱仍然依赖于全局包数据库.像Cabal,GHC,进程这样的东西通常安装在全局包数据库中.在这里,您要安装需要进程1.0的ghc-pkg-autofix,但您已安装了更新版本的进程.你确定你需要ghc-pkg-autofix,它似乎很老了.