尝试使用Cabal安装ghc-mod时ExitFailure 9 [英] ExitFailure 9 when trying to install ghc-mod using Cabal

查看:173
本文介绍了尝试使用Cabal安装ghc-mod时ExitFailure 9的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

 〜$ cabal install ghc-mod 
解决依赖...
[1的1]编译主(/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:
警告:使用`runTests'
(从Distribution.Simple导入,但在Distribution.Simple中定义。 UserHooks):
已弃用:请改用新的测试界面!
链接/tmp/haskell-src-exts-1.13.5-21238/haskell-src-exts-1.13.5/dist/setup/setup ...
配置haskell-src-exts-1.13 .5 ...
构建haskell-src-exts-1.13.5 ...
预处理库haskell-src-exts-1.13.5 ...

dist / build / Language / Haskell / Exts / InternalParser.hs:1:12:
警告:-fglasgow-exts不推荐使用:使用单个扩展代替
编译Language.Haskell.Exts.Annotated .Syntax(src / Language / Haskell / Exts / Annotated / Syntax.hs,dist / build / Language / Haskell / Exts / Annotated / Syntax.o)
cabal:错误:某些软件包安装失败:
ghc-mod-1.11.1取决于安装失败的haskell-src-exts-1.13.5。
haskell-src-exts-1.13.5在构建阶段失败。例外情况是:
ExitFailure 9
hlint-1.8.33取决于haskell-src-exts-1.13.5,它无法安装。

我不确定要从这里出发。

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

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

  ... 

世界文件已更新。
cabal:错误:某些软件包未能安装:
ghc-mod-1.11.1取决于haskell-src-exts-1.13.5安装失败。
haskell-src-exts-1.13.5在构建阶段失败。例外情况是:
ExitFailure 9
hlint-1.8.33取决于haskell-src-exts-1.13.5,它无法安装。


解决方案

原来是一个耗尽的内存问题,因为哈马尔怀疑。我可以通过在系统中添加一个1GB的交换文件来安装它(尽管速度很慢):

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

显然EC2实例在默认情况下不带交换。


When I try to install it with cabal, I get

~$ 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.

I'm not really sure where to go from here. How can I find out more about why it failed?

edit: I'm using GHC version 7.4.1 and Cabal version 1.14.0

Running Cabal in verbose mode doesn't seem to give any hints except:

...

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.

解决方案

It turned out to be a running-out-of-memory issue, as hammar suspected. I was able to get it to install (although it was painfully slow) by adding a 1GB swap file to the system:

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

Apparently EC2 instances come without swap by default.

这篇关于尝试使用Cabal安装ghc-mod时ExitFailure 9的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆