Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ExitFailure 9 when trying to install ghc-mod using Cabal

Tags:

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. 
like image 554
user316146 Avatar asked Oct 27 '12 22:10

user316146


Video Answer


1 Answers

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.

like image 61
user316146 Avatar answered Oct 11 '22 15:10

user316146