尝试构建 Cabal 库时 GHC 构建错误
我正在尝试在我的系统上构建/安装 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
GHC 附带了一组已安装的库。当您运行上面的构建命令时,cabal 想要“重新安装”GHC 附带的一些旧版本的库。出于显而易见的原因,这很糟糕。
如果您确实需要这样做,可以使用
cabal-dev
而不是Cabal
。顺便说一句,使用Setup.hs
会调用编译器附带的Cabal
库版本,而运行cabal
命令会调用cabal-install
程序。cabal-dev
是cabal-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 ofCabal
. By the way, usingSetup.hs
invokes the version of theCabal
library that shipped with your compiler, where as running thecabal
command invokes thecabal-install
program.cabal-dev
is a wrapper aroundcabal-install
(and thusCabal
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 ofcabal-install
. The benefits of sandboxing are many and strongly outweigh the risk ofcabal-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.