Cabal:安装软件包和更新时出现问题

时间:2020-03-30 14:20:14

标签: haskell cabal cabal-install

我试图使用cabal安装threadscope软件包,但收到关于cabal太过时的错误:

cabal: Error: some packages failed to install:
cairo-0.13.8.0 failed during the configure step. The exception was:
user error (The package 'cairo' requires Cabal library version -any && >=1.24
but no suitable version is installed.)
gio-0.13.8.0 depends on glib-0.13.8.0 which failed to install.
glib-0.13.8.0 failed during the configure step. The exception was:
user error (The package 'glib' requires Cabal library version -any && >=1.24
but no suitable version is installed.)
gtk-0.14.7 depends on glib-0.13.8.0 which failed to install.
pango-0.13.8.0 depends on glib-0.13.8.0 which failed to install.
threadscope-0.2.11.1 depends on glib-0.13.8.0 which failed to install.

但是当我尝试cabal install cabal-install时,我得到了:

Resolving dependencies...
Configuring Cabal-3.0.0.0...
Failed to install Cabal-3.0.0.0
Build log ( /home/ignacio/.cabal/logs/Cabal-3.0.0.0.log ):
cabal: Error: some packages failed to install:
Cabal-3.0.0.0 failed during the configure step. The exception was:
user error ('/usr/bin/ghc' exited with an error:

/tmp/cabal-tmp-19678/Cabal-3.0.0.0/Distribution/Parsec.hs:134:0:
error: missing binary operator before token "("
#if !(MIN_VERSION_base(4,13,0))
^
)
cabal-install-3.0.0.0 depends on Cabal-3.0.0.0 which failed to install.
hackage-security-0.5.3.0 depends on Cabal-3.0.0.0 which failed to install.

我正在使用Ubuntu 16.04

cabal安装版本1.22.6.0 使用Cabal库的1.22.5.0版

如果您能提供任何帮助,我将非常感谢。 (对不起,如果我写了一些奇怪的东西,英语不是我的母语,并且我是ubuntu的新手)

2 个答案:

答案 0 :(得分:1)

问题是我使用的是ghc的过时版本,重新安装了所有内容以进行更新,现在它可以工作了。

答案 1 :(得分:0)

您看到的错误...

error: missing binary operator before token "("
#if !(MIN_VERSION_base(4,13,0))
^
)

...提到了MIN_VERSION_ CPP宏](https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/phases.html#standard-cpp-macros)之一,仅适用于GHC 8及更高版本。大概您的系统中有较旧的版本,这就是为什么更新可以解决问题的原因。有关其他地方的类似报告,请参见cabal issue #4092