【问题标题】:ExitFailure 9 when trying to install ghc-mod using Cabal尝试使用 Cabal 安装 ghc-mod 时出现 ExitFailure 9
【发布时间】:2012-10-17 18:20:21
【问题描述】:

当我尝试用 cabal 安装它时,我得到了

~$ cabal install ghc-mod
Resolving dependencies...
[1 of 1] Compiling Main             ( /tmp/haskell-src-exts-1.13.5-21238/haskell-src-exts-1.13.5/Setup.hs, /tmp/haskell-src-exts-1.13.5-21238/haskell-src-exts-1.13.5/dist/setup/Main.o )

/tmp/haskell-src-exts-1.13.5-21238/haskell-src-exts-1.13.5/Setup.hs:1:1:
    Warning: In the use of `runTests'
             (imported from Distribution.Simple, but defined in Distribution.Simple.UserHooks):
             Deprecated: "Please use the new testing interface instead!"
Linking /tmp/haskell-src-exts-1.13.5-21238/haskell-src-exts-1.13.5/dist/setup/setup ...
Configuring haskell-src-exts-1.13.5...
Building haskell-src-exts-1.13.5...
Preprocessing library haskell-src-exts-1.13.5...

dist/build/Language/Haskell/Exts/InternalParser.hs:1:12:
    Warning: -fglasgow-exts is deprecated: Use individual extensions instead
[ 1 of 22] Compiling Language.Haskell.Exts.Annotated.Syntax ( src/Language/Haskell/Exts/Annotated/Syntax.hs, dist/build/Language/Haskell/Exts/Annotated/Syntax.o )
cabal: Error: some packages failed to install:
ghc-mod-1.11.1 depends on haskell-src-exts-1.13.5 which failed to install.
haskell-src-exts-1.13.5 failed during the building phase. The exception was:
ExitFailure 9
hlint-1.8.33 depends on haskell-src-exts-1.13.5 which failed to install.

我不确定从这里去哪里。我如何才能了解有关失败原因的更多信息?

编辑:我使用的是 GHC 版本 7.4.1 和 Cabal 版本 1.14.0

在详细模式下运行 Cabal 似乎没有给出任何提示,除了:

...

World file is already up to date.
cabal: Error: some packages failed to install:
ghc-mod-1.11.1 depends on haskell-src-exts-1.13.5 which failed to install.
haskell-src-exts-1.13.5 failed during the building phase. The exception was:
ExitFailure 9
hlint-1.8.33 depends on haskell-src-exts-1.13.5 which failed to install.

【问题讨论】:

  • 与大多数程序一样,cabal 有一个详细选项 (-v),如果您包含软件版本(即 GHC),它总是很有帮助
  • 除非我弄错了,ExitFailure 9 表示 GHC 收到了 SIGKILL(这可以解释没有任何错误消息的原因)。你在什么样的系统上运行这个?是否有某种正在运行的监控应用程序会因为使用过多的内存或类似的东西而杀死 GHC?
  • @hammar 我在 Amazon EC2 微型实例上运行 Ubuntu 服务器。我想你可能是对的。尝试安装 ghc-mod 时,它几乎使用了所有 613 MB RAM。有什么巧妙的方法可以解决这个问题吗?

标签: haskell cabal


【解决方案1】:

事实证明这是一个内存不足的问题,正如 hammar 所怀疑的那样。通过向系统添加一个 1GB 的交换文件,我能够安装它(尽管速度很慢):

dd if=/dev/zero of=/swapfile bs=1M count=1024
mkswap /swapfile
swapon /swapfile

显然 EC2 实例默认没有交换。

【讨论】:

  • 你拯救了我的一天 :) 我想知道我的微型实例上是否有同样的问题,你发布了完美的三行修复。谢谢!
  • 谢谢你们两个。我也遇到了这个问题。
  • 在资源有限的本地虚拟机上出现同样的问题;相同的解决方案。谢谢!
  • 这是一个很好的解决方案。 cabal update 也给了我这个问题。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-10-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-12-16
相关资源
最近更新 更多