【问题标题】:Cabal: problems installing packages and updatingCabal:安装包和更新的问题
【发布时间】:2020-03-30 14:20:14
【问题描述】:

我尝试使用 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 有点陌生)

【问题讨论】:

  • 您使用的是哪个 GHC 版本? (使用ghc --version查看。)
  • 就是这样,谢谢你我更新了 ghc 并重新安装了 cabal,现在它可以工作了
  • 不客气。我添加了一个答案来写下问题的可能根源。

标签: haskell cabal cabal-install


【解决方案1】:

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

【讨论】:

    【解决方案2】:

    你看到的错误...

    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

    【讨论】:

      猜你喜欢
      • 2011-12-10
      • 1970-01-01
      • 1970-01-01
      • 2023-03-20
      • 2011-01-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多