cabal-dev 的重新安装行为
我一直在使用的最新的 cabal-install(0.13.3,来自 darcs repo)很好;它会让您知道何时可能会因重新安装而破坏 GHC 安装。我想知道的是:假设 cabal install foo
会执行重新安装,会破坏我的 GHC。如果我 cabal-dev install foo
会发生什么?我能避免破坏 GHC 吗?我真的可以在 cabal-dev 沙箱中使用 foo 包吗?或者它只是一个损坏的沙箱?
示例:yesod、GHC 7.4.1、从 github 源构建的 cabal-dev 0.9、Cabal 1.14.0 库。
The latest cabal-install that I've been using (0.13.3, from the darcs repo) is nice; it lets you know when you might break your GHC installation with reinstalls. What I want to know is this: suppose a cabal install foo
would perform a reinstall that would break my GHC. What would happen if I cabal-dev install foo
instead? Would I be able to avoid breaking GHC? Could I actually make use of the foo
package in a cabal-dev sandbox, or would it just be a broken sandbox?
Example: yesod, GHC 7.4.1, cabal-dev 0.9 built from github source, Cabal 1.14.0 library.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只是为了澄清,如果我理解正确的话,在任何一种情况下你都没有违反 GHC。我相信您指的是安装一个包,然后重新安装另一个包的底层依赖项之一,从而破坏其他包的依赖项链并阻止其在使用时正常工作/编译。只需从您的主文件夹中删除 .ghc 并重新进行 cabal 安装通常可以解决此问题,尽管这是一种非常痛苦的方式。
当您使用 cabal-dev 时,所有 cabal 安装步骤和 ghc-pkg 注册步骤都是在本地沙箱环境中完成的。您的全局/用户 ghc 包根本没有被触及。由于您通常为每个项目实例化一个 cabal-dev 沙箱,因此通常不会发生如上所述的冲突。
为了回答你的问题 - 这完全取决于特定的 cabal-dev 沙箱中已经安装的内容。如果没有冲突,就不会破坏任何东西。如果您强制执行
--reinstall
,您可能必须--reinstall
本地 cabal-dev 沙箱中依赖于您刚刚重新安装的软件包的任何软件包。无论如何,您的 GHC 安装本身都不会中断(或以任何方式更改),并且您始终可以在项目文件夹下
rm -rf cabal-dev
并重做cabal-dev install< /代码>。
希望这有帮助。
Just to clarify, if I am understanding you right, you are not breaking GHC in either case. I believe you are referring to installing a package, which then reinstalls one of the underlying dependencies of another package, therefore breaking that other package's dependency chain and preventing it from properly working/compiling when used. Simply removing .ghc from your home folder and re-doing cabal installs typically resolves this problem, albeit in a really painful way.
When you use cabal-dev, all the cabal install steps and ghc-pkg register steps are done in a local sandbox environment. Your global/user ghc packages are not at all touched. Since you typically instantiate one cabal-dev sandbox per project, clashes like described above don't typically happen.
To get to your question - it depends entirely on what is already installed in that particular cabal-dev sandbox. If there are no conflicts, it wouldn't break anything. If you are forcing a
--reinstall
, you might have to--reinstall
any packages in the local cabal-dev sandbox that depend on the package you just reinstalled.In any case, your GHC installation itself would not break (or be altered in any way) and you can always
rm -rf cabal-dev
under your project folder and redocabal-dev install
.Hope this helps.