25

当我尝试用 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.
4

1 回答 1

44

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

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

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

于 2012-10-28T03:45:46.937 回答