尝试构建 Cabal 库时 GHC 构建错误

发布于 2024-10-07 05:47:35 字数 433 浏览 0 评论 0原文

我正在尝试在我的系统上构建/安装 Cabal,但遇到以下依赖项错误:

SDGL0990Z464C:Cabal-1.8.0.4 cflynn$ ghc --make Setup
SDGL0990Z464C:Cabal-1.8.0.4 cflynn$ ./Setup configure
Configuring Cabal-1.8.0.4...
Setup: At least the following dependencies are missing:
base >=4 && <3 && >=1 && <5, filepath >=1 && <1.2

我安装了 GHC 7.0.1,据我所知 GHC 6.6.1 及更高版本附带“filepath”包?我不清楚“基地”到底指的是什么?

I'm attempting to build/install Cabal on my system and I'm running into the following dependency error:

SDGL0990Z464C:Cabal-1.8.0.4 cflynn$ ghc --make Setup
SDGL0990Z464C:Cabal-1.8.0.4 cflynn$ ./Setup configure
Configuring Cabal-1.8.0.4...
Setup: At least the following dependencies are missing:
base >=4 && <3 && >=1 && <5, filepath >=1 && <1.2

I have GHC 7.0.1 installed, as far as I know GHC 6.6.1 and later come with the 'filepath' package? And I'm unclear on exactly what 'base' is referring to?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

蹲墙角沉默 2024-10-14 05:47:35

GHC 附带了一组已安装的库。当您运行上面的构建命令时,cabal 想要“重新安装”GHC 附带的一些旧版本的库。出于显而易见的原因,这很糟糕。

如果您确实需要这样做,可以使用 cabal-dev 而不是 Cabal。顺便说一句,使用 Setup.hs 会调用编译器附带的 Cabal 库版本,而运行 cabal 命令会调用cabal-install 程序。

cabal-devcabal-install(以及 Cabal 库)的包装器,提供沙盒构建。可以安全地安装需要 GHC 附带的不同版本库的程序。剩下的问题是那些旧的库是否会针对新的 GHC 进行构建。在许多情况下,构建会失败。

我强烈建议您使用 cabal-dev 进行日常软件包构建,而不是 cabal-install。沙箱的好处很多,并且远远超过了通过升级已安装的依赖链中间某个位置的包而导致 cabal-install 损坏包数据库的风险。

有关使用cabal-dev的更多信息,我推荐这个reddit 帖子

base 是一组 Haskell 模块,提供每个 GHC 安装附带的大部分功能。它是大多数 Haskell 用户想要和需要的有用库的集合。

GHC ships with a certain set of libraries already installed. When you run the build command above cabal wants to "reinstall" some older versions of the libraries that ship with GHC. This is bad for obvious reasons.

If you really need to do this, it may work to use cabal-dev instead of Cabal. By the way, using Setup.hs invokes the version of the Cabal library that shipped with your compiler, where as running the cabal command invokes the cabal-install program.

cabal-dev is a wrapper around cabal-install (and thus Cabal the library) that provides sandboxed builds. Making it safe to install programs that need different versions of the libraries that ship with GHC. The remaining question would be whether or not those older libraries would build against the newer GHC. In many cases the build will fail.

I highly recommend you use cabal-dev for your day-to-day package building instead of cabal-install. The benefits of sandboxing are many and strongly outweigh the risk of cabal-install corrupting your package database by upgrading a package somewhere in the middle of a dependency chain for something you already have installed.

For more information about using cabal-dev, I recommend this reddit post.

base is a set of Haskell modules that provide much of the functionality that ships with every GHC install. It's a collection of useful libraries that most Haskell users will want and need.

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