如何解决Cabal中破碎的依赖关系? [英] How to resolve broken dependencies in cabal?

查看:79
本文介绍了如何解决Cabal中破碎的依赖关系?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Haskell的初学者,我一直在用cabal安装我认为可能需要的所有东西,假设它可以像port或homebrew一样工作,为我解决所有依赖关系并保持最新他们不会中断,等等。但是,现在,当尝试安装 lens 库时,我收到以下消息:

I'm a beginner at Haskell, and I've been merrily using cabal to install everything that I thought I might need, assuming it would work like port or homebrew, resolving all dependencies for me and keeping things up to date so they won't break, etc. However, now when trying to instal the lenses library I get this message:

In order, the following would be installed:
base-orphans-0.5.4 (new package)
distributive-0.5.0.2 (new version)
comonad-5 (new version)
bifunctors-5.4.1 (new package)
mtl-2.2.1 (reinstall) changes: transformers-0.5.2.0 -> 0.4.3.0
exceptions-0.8.3 (new package)
prelude-extras-0.4.0.3 (new package)
profunctors-5.2 (new package)
reflection-2.1.2 (new package)
semigroupoids-5.1 (new package)
free-4.12.4 (new package)
adjunctions-4.3 (new package)
kan-extensions-5.0.1 (new package)
lens-4.14 (new package)
cabal: The following packages are likely to be broken by the reinstalls:
parsec-3.1.11
network-uri-2.6.1.0
hackage-security-0.5.2.2
HTTP-4000.3.3
Use --force-reinstalls if you want to install anyway.

好吧,打破HTTP和所谓的安全性听起来不是一个好主意,代码依赖于Parsec。解决这种情况的正确方法是什么?我应该使用-force-reinstalls 并期望事情不会真正中断吗?还是假设这些HTTP程序包损坏了,让那些程序包破裂然后重新安装它们?还是我必须对要安装或不安装的软件包做出自己的选择,知道有些软件包会相互冲突?

Well, breaking HTTP and something called "security" doesn't sound like a good idea, and my code relies on Parsec. What's the proper way to resolve this situation? Should I use --force-reinstalls and expect things to not really break? Or let those packages break and then reinstall them, assuming that's possible if the HTTP package is broken? Or do I have to make my own choices about which packages to install or not to install, knowing that some will conflict each other?

部分问题可能是我最初并没有意识到某些关于黑客的软件包并不是真正的生产质量代码,因此我确实有很多我不需要的依赖项。也许解决方案是卸载那些软件包及其依赖项。但是 cabal --help 不会显示任何类型的卸载命令,因此我对如何执行此操作有些迷失。

Part of the problem might be that I initially didn't realise that some of the packages on hackage aren't really production-quality code, so I do have a lot of dependencies that I don't really need. Perhaps the solution is to uninstall those packages and their dependencies. However cabal --help doesn't reveal any kind of uninstall command, so I'm a bit lost with how to do that.

推荐答案

标准方法是告诉cabal您不介意重新安装会损坏的软件包。您可以使用

The standard technique is to tell cabal that you don't mind reinstalling the packages that would be broken. You can do this with something like

cabal install lenses parsec-3.1.11 network-uri-2.6.1.0 hackage-security-0.5.2.2 HTTP-4000.3.3

有关关于阴谋法包的详尽介绍,尤其是标有 The Pigeon Drop Con的部分。

There are further details on what's happening here on this fine introduction to cabal packages, especially the section labeled "The Pigeon Drop Con".

这篇关于如何解决Cabal中破碎的依赖关系?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆