cabal-dev 的重新安装行为

发布于 2025-01-03 07:56:02 字数 386 浏览 6 评论 0原文

我一直在使用的最新的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

狼亦尘 2025-01-10 07:56:02

只是为了澄清,如果我理解正确的话,在任何一种情况下你都没有违反 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 redo cabal-dev install.

Hope this helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文