Cabal Update and Package Installation Errors - haskell

When I do cabal install criterion
I get the following error regarding the package vector-algorithms
Warning: The package list for 'hackage.haskell.org' is 16 days old.
Run 'cabal update' to get the latest list of available packages.
Resolving dependencies...
Downloading vector-algorithms-0.4...
cabal: Error: some packages failed to install:
vector-algorithms-0.4 failed while downloading the package. The exception was:
connect: does not exist (Connection refused)
And when I run cabal update it again errors with
Downloading the latest package list from hackage.haskell.org
cabal: openTCPConnection: host lookup failure for ""
What is wrong?
I'm using Ubuntu 11.10 and GHC 7.0.4 from this PPA and my network connection is just fine in the rest of the system.

It was a proxy setting. It didn't suffice to unset ftp_proxy or http_proxy but also https_proxy. GNOME doesn't automatically remove terminal proxy configuraition when I disable it from system settings. Very annoying. I will write a shell-script that disables all proxy settings.
Sorry for bothering you all.

You may also force the proxy:
export http_proxy=hackage.haskell.org:80
cabal update
export http_proxy=

Related

Can't install sdl2 via cabal

I am trying to install helm. When I try to install it, however I get this error:
$ cabal install helm
Resolving dependencies...
Configuring sdl2-1.1.0...
cabal: The pkg-config package 'sdl2' version >=2.0.3 is required but it could
not be found.
Failed to install sdl2-1.1.0
cabal: Error: some packages failed to install:
helm-0.6.1 depends on sdl2-1.1.0 which failed to install.
sdl2-1.1.0 failed during the configure step. The exception was:
ExitFailure 1
When I go to install sdl2 by itself, I get a similar message.
$ cabal install sdl2
Resolving dependencies...
Configuring sdl2-1.1.0...
cabal: The pkg-config package 'sdl2' version >=2.0.3 is required but it could
not be found.
Failed to install sdl2-1.1.0
cabal: Error: some packages failed to install:
sdl2-1.1.0 failed during the configure step. The exception was:
ExitFailure 1
I don't understand. According to Hackage, sdl2 is at version 1.1, but installing it requires version 2.0.3? I've tried this in and out of a sandbox. Results of ghc-pkg list are here if you think they're relevant: http://pastebin.com/tFrsfPFe
I'm on Ubuntu btw.
Help?
Another thing which could happen (happened to me) for other installs is that the PKG_CONFIG_PATH variable might not point to the package config file (sdl2.pc, for me in the /usr/local/lib/pkgconfig directory). pkg-config uses some default directories ('/usr/lib/pkgconfig' and '/usr/share/pkgconfig'), but if the sdl.pc file isn't in one of these, you'll have to specify the directory in the environment variable. You can check this with echo $PKG_CONFIG_PATH
If it turns out you need to set the variable, just use export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig (or to whatever directory your sdl2.pc file lives in)
I ran into the same problem, and I just want to add my solution here for the record. The native sdl2 libraries need to be installed first by following the directions here: https://github.com/haskell-game/sdl2#building

Cabal install package fails weirdly

I access internet through a proxy and have appropriately set up the environment variables. The problem is that whenever I am trying to install any package through cabal, it fails with a
connect: does not exist (Connection Refused) error.
But if I run cabal update -v3, it successfully makes the connection and retrieves the update information.
$ cabal --version
cabal-install version 1.20.0.2
using version 1.20.0.1 of the Cabal library
Edit: I'm running Ubuntu 14.04.
Okay. The problem is solved by using -E with sudo command.
sudo -E cabal install <package>
Although, I don't understand why cabal update could work but not cabal install.

Failed installing dependencies with cabal

I am trying to install the dependencies for a project but I am running into this error:
Failed to install base-unicode-symbols-0.2.2.4
cabal: Error: some packages failed to install: base-unicode-symbols-0.2.2.4 failed during the final install step.
The exception was: /tmp/pkgConf-base-unicode-symbols-0.2.25614.4: hGetContents: invalid argument (invalid byte sequence)
I am running Debian 7 with the latest Haskell-Platform built from source.
How do I fix it?
Thanks,
James
I just had this problem and after search, found this solution: https://github.com/haskell/cabal/issues/1883
To summarize, the problem can be solved by setting your locale. On linux:
export LANG="en_US.UTF-8"
was good enough for me.

cabal failures, how to move to cabal-dev?

I seem to have so many problems with broken dependency graphs in cabal, that I am finally trying to follow SO advice to move to cabal-dev, but for similar reasons it won't install.
Skipping the many pages of the original install attempts, here is the current status:
C:\Users\me>cabal --force-reinstalls install cabal-dev
Resolving dependencies...
Warning: Note that reinstalls are always dangerous. Continuing anyway...
Configuring network-2.3.1.0...
configure: WARNING: unrecognized options: --with-compiler, --with-gcc
configure: error: cannot find sources (include/HsNet.h) in /e/plang/Libraries/wx
Widgets2.9 or ..
cabal: Error: some packages failed to install:
HTTP-4000.2.5 depends on network-2.3.1.0 which failed to install.
cabal-dev-0.9.1 depends on network-2.3.1.0 which failed to install.
network-2.3.1.0 failed during the configure step. The exception was:
ExitFailure 1
I did just re-install network (current version seems to be 2.4.0.1), but that did not help.
It is also interesting that although one finds various strong declarations NOT to use cabal, many /most/ tutorials and books recommend it (by default?).
It's not a good idea to ever install different versions of packages coming with Platform.
In this case you are trying to reinstall network. You should do the following: run ghc-pkg list network. If you have more than one version installed use ghc-pkg unregister to unregister all but the oldest version.
Then perform cabal install cabal-dev network-2.3.0.13 or whatever version was shipped with latest platform.

installing reactive banana-wx or wx on redhat based linux with ghc 7.0.4

hi i'm trying to install, (without having to update or install the latest compiler),reactive-banana-wx and one of the requirement's are failing
cabal install reactive-banana-wx
and heres the error
Configuring wxc-0.90.0.4...
setup: failed
cabal: Error: some packages failed to install:
reactive-banana-wx-0.6.0.1 depends on wxc-0.90.0.4 which failed to install.
wx-0.90.0.1 depends on wxc-0.90.0.4 which failed to install.
wxc-0.90.0.4 failed during the configure step. The exception was:
ExitFailure 1
wxcore-0.90.0.3 depends on wxc-0.90.0.4 which failed to install
when i try to cabal install wxcore ,wx or wxc they all say failed and point towards wxc being required.
here's the error
cabal install wxc
Resolving dependencies...
[1 of 1] Compiling Main ( /tmp/wxc-0.90.0.419410/wxc-0.90.0.4/Setup.hs, /tmp/wxc-0.90.0.419410/wxc-0.90.0.4/dist/setup/Main.o )
Linking /tmp/wxc-0.90.0.419410/wxc-0.90.0.4/dist/setup/setup ...
Configuring wxc-0.90.0.4...
setup: failed
cabal: Error: some packages failed to install:
wxc-0.90.0.4 failed during the configure step. The exception was:
ExitFailure 1
here's my compiler info if it would be useful
ghc -v
Glasgow Haskell Compiler, Version 7.0.4, for Haskell 98, stage 2 booted by GHC version 7.0.4
I've got the same error trying to install phooey with ghc 7.4.1 on Debian tonight. The reason is a bug in the package wxc-0.90.0.4 and it should affect all wxHaskell-based packages. You can fix it, there is no need to downgrade your wxc package...
The easiest way to reproduce it is to do
cabal install wxc
or
cabal install glade
It might be a good idea to make sure that all prerequisites are in place, before you do it. wxc depends on a number of cabal and Linux packages and all of them should be installed and compiled... I did it in the most stupid way possible, just by running
cabal install wxc
and reading error messages which it spills out. This sweetie usually tells you what it wants... For instance, if it complains about cabal package x, just do cabal install x. If it complains about Linux package y, then use your Linux package manager and install the development version of this package, which is called normally lib<y>-dev in Debian. So, for instance, if
cabal install wxc
gives you an error saying that package gtk+2.0 is missing, you want to do
apt-get install libgtk2.0-dev
The same story with cairo, glade2 and other GTK-related libraries
When you are green with all prerequisites, you want to install wxWidgets-2.9, which is currently in the Development stage... so, it doesn't have any binaries for Linux and you should build it yourself. Download the source code from wxWidgets website and build it. It is pretty easy to do, just:
untar/unzip the source code to your favorite directory
run ./config
run ./make
If you are on wxc-0.90.0.4, at this moment you should encounter our little bug... To keep the long story short, it is in the file eljpen.cpp, which you can find in
~/.cabal/packages/hackage.haskell.org/wxc/0.90.0.4/wxc-0.90.0.4.tar.gz
Open the archive, go to the line 159 in the file and replace *_ref = NULL; with _ref = NULL or anything else what makes more sense. Then recreate the archive in the same place with the fixed eljpen.cpp file in it.
run ./make
It should work now.
run sudo make install (normally, you should have root privileges to insatll wxWidgets library...).
after it is done try to do
cabal install wx
again. It should be working now. I guess, after that you can enjoy your reactive-banana-wx, wxHaskell, phooey, etc.
PS http://sourceforge.net/tracker/index.php?func=detail&aid=3576397&group_id=73133&atid=536845. Why didn't I find it earlier? :/
I'v solved this problem on Lubuntu 12.10 so:
sudo cabal info wx
Synopsis: wxHaskell
Versions available: 0.11.1.2, 0.12.1.4, 0.12.1.5, 0.12.1.6, 0.13.2,
0.13.2.1, 0.13.2.3, 0.90, 0.90.0.1 (and 11 others)
I picked out different versions of wxHaskell, but only 0.13.2.3 was right.
sudo cabal install wx-0.13.2.3
...and everything has compiled and installed. Then I could install:
sudo cabal install reactive-banana-wx -fbuildExamples
That's no depends on the version of your Glasgow Haskell Compiler or the sort of your Linux.

Resources