ExitFailure 9 when trying to install ghc-mod using Cabal - haskell

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.

Related

cant install cabal package

I have a problem with installing quickcheck from cabal on ubuntu 14.4 LTS. I have updated cabal, but when i try to install quickcheck an error comes up:
:~$ cabal install quickcheck
Resolving dependencies...
Configuring primitive-0.6.1.0...
Building primitive-0.6.1.0...
Preprocessing library primitive-0.6.1.0...
ghc: ghc no longer supports single-file style package databases (dist/package.conf.inplace) use 'ghc-pkg init' to create the database with the correct format.
Failed to install primitive-0.6.1.0
Configuring random-1.1...
Building random-1.1...
Preprocessing library random-1.1...
ghc: ghc no longer supports single-file style package databases (dist/package.conf.inplace) use 'ghc-pkg init' to create the database with the correct format.
Failed to install random-1.1
cabal: Error: some packages failed to install:
QuickCheck-2.8.1 depends on random-1.1 which failed to install.
primitive-0.6.1.0 failed during the building phase. The exception was:
ExitFailure 1
random-1.1 failed during the building phase. The exception was:
ExitFailure 1
tf-random-0.5 depends on random-1.1 which failed to install.
I am pretty new ubuntu so I still dont know what to do in a situation like this. i really hope someone can help because it is for a school project which is do soon.
After spending hours on installing/removing, the best way to install and configure latest cabal, ghc...
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
This error occurs when you have a very old cabal binary compared to your version of ghc.
You could jump through the package manager routes, or you could use the linux binary download from https://www.haskell.org/cabal/download.html
That should suffice to get you off the ground...

Cabal couldnt figure out LLVM verison.

I am trying to install the repa-v4l2 package and I get an error I dont know how to fix:
kyle#Kyles-Comp:~$ sudo cabal install repa-v4l2
[sudo] password for kyle:
Resolving dependencies...
Configuring repa-v4l2-0.2.0.0...
Building repa-v4l2-0.2.0.0...
Preprocessing library repa-v4l2-0.2.0.0...
[1 of 2] Compiling Graphics.Webcam.Linux.Internal( src/Graphics/Webcam/Linux/Internal.hs, dist/build/Graphics/Webcam/Linux/Internal.o )
<no location info>:
Warning: Couldn't figure out LLVM version!
Make sure you have installed LLVM
ghc: could not execute: opt
Failed to install repa-v4l2-0.2.0.0
cabal: Error: some packages failed to install:
repa-v4l2-0.2.0.0 failed during the building phase. The exception was:
ExitFailure 1
How do you help LLVM figure out the verison?

How to install diagrams?

I am trying to install the diagrams package. If I do
cabal install diagrams
I get (towards the end)
Configuring lens-4.2...
Building lens-4.2...
Preprocessing library lens-4.2...
src/Control/Lens/Internal/Zoom.hs:47:8:
Could not find module `Control.Monad.Trans.Except'
It is a member of the hidden package `transformers-0.4.1.0'.
Perhaps you need to add `transformers' to the build-depends in your .cabal file.
Use -v to see a list of the files searched for.
Failed to install lens-4.2
cabal: Error: some packages failed to install:
diagrams-1.2 depends on lens-4.2 which failed to install.
diagrams-contrib-1.1.2 depends on lens-4.2 which failed to install.
diagrams-core-1.2.0.1 depends on lens-4.2 which failed to install.
diagrams-lib-1.2.0.1 depends on lens-4.2 which failed to install.
diagrams-svg-1.1 depends on lens-4.2 which failed to install.
force-layout-0.3.0.4 depends on lens-4.2 which failed to install.
lens-4.2 failed during the building phase. The exception was:
ExitFailure 1
So then I try
$cabal install lens transformers diagrams
And I get (towards the end)
In-place registering diagrams-lib-1.2.0.1...
Installing library in /home/theking/.cabal/lib/diagrams-lib-1.2.0.1/ghc-7.6.3
Registering diagrams-lib-1.2.0.1...
Installed diagrams-lib-1.2.0.1
cabal: Error: some packages failed to install:
cairo-0.12.5.3 failed during the configure step. The exception was:
ExitFailure 1
diagrams-0.3 depends on glib-0.12.5.4 which failed to install.
diagrams-cairo-1.2 depends on glib-0.12.5.4 which failed to install.
glib-0.12.5.4 failed during the configure step. The exception was:
ExitFailure 1
pango-0.12.5.3 depends on glib-0.12.5.4 which failed to install.
So I tried one more thing
$ cabal install glib
Resolving dependencies...
[1 of 2] Compiling SetupWrapper ( /tmp/glib-0.12.5.4-9179/glib-0.12.5.4/SetupWrapper.hs, /tmp/glib-0.12.5.4-9179/glib-0.12.5.4/dist/setup/SetupWrapper.o )
[2 of 2] Compiling Main ( /tmp/glib-0.12.5.4-9179/glib-0.12.5.4/Setup.hs, /tmp/glib-0.12.5.4-9179/glib-0.12.5.4/dist/setup/Main.o )
Linking /tmp/glib-0.12.5.4-9179/glib-0.12.5.4/dist/setup/setup ...
[1 of 2] Compiling Gtk2HsSetup ( Gtk2HsSetup.hs, dist/setup-wrapper/Gtk2HsSetup.o )
[2 of 2] Compiling Main ( SetupMain.hs, dist/setup-wrapper/Main.o )
Linking dist/setup-wrapper/setup ...
Configuring glib-0.12.5.4...
setup: The program gtk2hsC2hs version >=0.13.8 is required but the version
found at /usr/bin/gtk2hsC2hs is version 0.13.6
Failed to install glib-0.12.5.4
cabal: Error: some packages failed to install:
glib-0.12.5.4 failed during the configure step. The exception was:
ExitFailure 1
And I got stuck here. So how do I install diagrams. I don't really care how it gets installed (getting a little fed up with cabal) as long as it gets installed.
Notes: I am on linux. I also tried cabal install gtk2hs-buildtools.
The second error block says that:
diagrams-0.3 depends on glib-0.12.5.4 which failed to install.
diagrams-0.3 is a very old version of diagrams, and in normal circumstances cabal shouldn't be trying to install it. Recent versions of diagrams do not even depend on diagrams-cairo, so as long as you don't need the Cairo backend you can work around the Cairo/GTK issues by asking for the current version of diagrams, as in:
cabal install diagrams-1.2
Ideally, it would be good to find out why your cabal is pulling the old version. cabal install diagrams --dry-run (which only show the packages that would be pulled without actually installing them) and ghc-pkg list (which shows the packages currently in your system) might help figuring that out.
As for the Cairo-related issues, as Daniel Wagner suggests a PATH issue might be preventing cabal from using the latest versions of the gtk2hs-buildtools you have installed. For instance, you might have a global installation of the tools, which is overriding the local one you have done with cabal. ghc-pkg list allows you to verify that. Also, check this relevant question.

Cabal Cabal-Install not working, strange error

I need to install Yesod and dependancies trough Cabal, unfortunately I'm not able to update cabal. Shell output:
...$ sudo cabal install cabal-install
Resolving dependencies...
Configuring cabal-install-1.18.0.2...
/tmp/24453.c:1:12:
warning: control reaches end of non-void function [-Wreturn-type]
int foo() {}
^
1 warning generated.
Building cabal-install-1.18.0.2...
Preprocessing executable 'cabal' for cabal-install-1.18.0.2...
<command line>: cannot satisfy -package-id HTTP-4000.2.8-cdf033f9d7051824f52cd5101df67509
(use -v for more information)
Failed to install cabal-install-1.18.0.2
cabal: Error: some packages failed to install:
cabal-install-1.18.0.2 failed during the building phase. The exception was:
ExitFailure 1
Anyone knows how to fix it? Nothing really makes sense to me.
The solution can be found here: Installing & Building GHC with OSX Mavericks GHC
The commandline tools from apple are required!
Thanks!

yesod install fails

I generally find that cabal install's for more than half of big packages fail, rather a fatal flaw to new users!
This time I am trying to install yesod, any hints?
> cabal install yesod
...
Loading package time-1.2.0.5 ...
GHCi runtime linker: fatal error: I found a duplicate definition for symbol
_get_current_timezone_seconds
whilst processing object file
C:\Users\guthrie\AppData\Roaming\cabal\time-1.2.0.5\ghc-7.4.1\HStime-1.2.0.5.o
This could be caused by:
* Loading two different object files which export the same symbol
* Specifying the same object file twice on the GHCi command line
* An incorrect `package.conf' entry, causing some object to be
loaded twice.
GHCi cannot safely continue in this situation. Exiting now. Sorry.
cabal: Error: some packages failed to install:
authenticate-1.3.1.1 depends on http-conduit-1.6.1.1 which failed to install.
http-conduit-1.6.1.1 failed during the building phase. The exception was:
ExitFailure 1
yesod-1.1.1.2 depends on yesod-core-1.1.2.1 which failed to install.
yesod-auth-1.1.1.1 depends on yesod-core-1.1.2.1 which failed to install.
yesod-core-1.1.2.1 failed during the building phase. The exception was:
ExitFailure 1
yesod-form-1.1.3 depends on yesod-core-1.1.2.1 which failed to install.
yesod-json-1.1.0 depends on yesod-core-1.1.2.1 which failed to install.
yesod-persistent-1.1.0 depends on yesod-core-1.1.2.1 which failed to install.
yesod uses a different version of alex package than the Haskell platform. I always install alex and happy from my distro's package manager apart from ghc and then use cabal. Alternatively, you can always use
cabal update && cabal install alex happy
cabal install yesod-platform
This most likely occurs due to trying to install with two versions of the time package simultaneously. Can you try running cabal install yesod-platform and see if the problem persists?
And as #Inaimathi said, this might be due to an older version of cabal. Perhaps also try cabal update && cabal install cabal-install.

Resources