
Hi everyone, I'm having Cabal problems. Any help would really be appreciated. When I try: "cabal install soegtk" or "cabal install gtk" or "cabal install glib" I get the error (abridged): " Cannot find gtk2hsC2hs Please install `gtk2hs-buildtools` first and check that the install directory is in your PATH (e.g. HOME/.cabal/bin). [...] gio-0.12.0 depends on glib-0.12.0 which failed to install. glib-0.12.0 failed during the configure step. The exception was: exit: ExitFailure 1 [...] " But: gtk2hsC2hs and gtk2hs-buildtools ARE where they're supposed to be (gtk2hsC2hs is in ~/.cabal/bin, and gtk2hs-buildtools is in ~/.cabal/share). A possibly related issue is that when I run "cabal update" it tells me my Cabal isn't the newest version. I successfully run "cabal install cabal-install", then do "cabal update" and get the same message again. As a side question, is there a good resource about Cabal in greater detail than a how-to? I'm looking for, say, what ARE the executables in .cabal/bin? How do they relate to packages loaded in ghci? Thanks for your time! Tom

Hi Tom.
Please install `gtk2hs-buildtools` first and check that the install directory is in your PATH (e.g. HOME/.cabal/bin).
The most likely explanation for your problems seems to be that while you have the buildtools installed, you haven't actually added $HOME/.cabal/bin to your search path, so it isn't found by cabal. This might also hold for the new version of cabal-install you installed, which installs a "cabal" binary to $HOME/.cabal/bin. But if you don't have that in your search path, and have another "cabal" binary installed in, say /usr/bin, then you'll still run the old version and get the message about the newer version again. Cheers, Andres

On Saturday 12 March 2011 22:53:27, Andres Loeh wrote:
Hi Tom.
Please install `gtk2hs-buildtools` first and check that the install directory is in your PATH (e.g. HOME/.cabal/bin).
The most likely explanation for your problems seems to be that while you have the buildtools installed, you haven't actually added $HOME/.cabal/bin to your search path, so it isn't found by cabal.
A common mistake would be to add it in the form export PATH="~/.cabal/bin:$PATH" Many (most, I think) shells don't do tilde expansion in quoted strings, so you'd have a literal '~' in your PATH. That's no problem if it's passed to a shell, but other programmes usually don't do expansion for such strings. If that's the case here, possible fixes are - spelling it out - using $HOME instead of ~ - not quoting
This might also hold for the new version of cabal-install you installed, which installs a "cabal" binary to $HOME/.cabal/bin. But if you don't have that in your search path, and have another "cabal" binary installed in, say /usr/bin, then you'll still run the old version and get the message about the newer version again.
Also if the other cabal is in a place before $HOME/.cabal/bin in the PATH.

Here's my new error message (the "does not export" errors are new):
"
Resolving dependencies...
/var/folders/+p/+pUVycVKFDWsYP8YiYnM3k+++TM/-Tmp-/cairo-0.11.159995/cairo-0.11.1/Gtk2HsSetup.hs:25:0:
warning: #warning Setup.hs is guessing the version of Cabal. If
compilation of Setup.hs fails use -DCABAL_VERSION_MINOR=x for Cabal
version 1.x.0 when building (prefixed by --ghc-option= when using the
'cabal' command)
[1 of 2] Compiling Gtk2HsSetup (
/var/folders/+p/+pUVycVKFDWsYP8YiYnM3k+++TM/-Tmp-/cairo-0.11.159995/cairo-0.11.1/Gtk2HsSetup.hs,
/var/folders/+p/+pUVycVKFDWsYP8YiYnM3k+++TM/-Tmp-/cairo-0.11.159995/cairo-0.11.1/dist/setup/Gtk2HsSetup.o
)
/var/folders/+p/+pUVycVKFDWsYP8YiYnM3k+++TM/-Tmp-/cairo-0.11.159995/cairo-0.11.1/Gtk2HsSetup.hs:48:2:
Module
`Distribution.Simple.PackageIndex'
does not export
`lookupPackageId'
/var/folders/+p/+pUVycVKFDWsYP8YiYnM3k+++TM/-Tmp-/glib-0.11.259995/glib-0.11.2/Gtk2HsSetup.hs:25:0:
warning: #warning Setup.hs is guessing the version of Cabal. If
compilation of Setup.hs fails use -DCABAL_VERSION_MINOR=x for Cabal
version 1.x.0 when building (prefixed by --ghc-option= when using the
'cabal' command)
[1 of 2] Compiling Gtk2HsSetup (
/var/folders/+p/+pUVycVKFDWsYP8YiYnM3k+++TM/-Tmp-/glib-0.11.259995/glib-0.11.2/Gtk2HsSetup.hs,
/var/folders/+p/+pUVycVKFDWsYP8YiYnM3k+++TM/-Tmp-/glib-0.11.259995/glib-0.11.2/dist/setup/Gtk2HsSetup.o
)
/var/folders/+p/+pUVycVKFDWsYP8YiYnM3k+++TM/-Tmp-/glib-0.11.259995/glib-0.11.2/Gtk2HsSetup.hs:48:2:
Module
`Distribution.Simple.PackageIndex'
does not export
`lookupPackageId'
cabal: Error: some packages failed to install:
cairo-0.11.1 failed during the configure step. The exception was:
exit: ExitFailure 1
gio-0.11.1 depends on glib-0.11.2 which failed to install.
glib-0.11.2 failed during the configure step. The exception was:
exit: ExitFailure 1
gtk-0.11.2 depends on glib-0.11.2 which failed to install.
pango-0.11.2 depends on glib-0.11.2 which failed to install.
soegtk-0.11.1 depends on glib-0.11.2 which failed to install.
"
Also, here's my $PATH:
"
cm-macbookpro-3:bin colinmurphy$ $PATH
-bash: /.cabal/bin:~/.cabal/bin:/Users/colinmurphy/.cabal/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:
No such file or directory
"
Thanks for the help!
Tom
On Sat, Mar 12, 2011 at 5:33 PM, Daniel Fischer
On Saturday 12 March 2011 22:53:27, Andres Loeh wrote:
Hi Tom.
Please install `gtk2hs-buildtools` first and check that the install directory is in your PATH (e.g. HOME/.cabal/bin).
The most likely explanation for your problems seems to be that while you have the buildtools installed, you haven't actually added $HOME/.cabal/bin to your search path, so it isn't found by cabal.
A common mistake would be to add it in the form
export PATH="~/.cabal/bin:$PATH"
Many (most, I think) shells don't do tilde expansion in quoted strings, so you'd have a literal '~' in your PATH. That's no problem if it's passed to a shell, but other programmes usually don't do expansion for such strings.
If that's the case here, possible fixes are - spelling it out - using $HOME instead of ~ - not quoting
This might also hold for the new version of cabal-install you installed, which installs a "cabal" binary to $HOME/.cabal/bin. But if you don't have that in your search path, and have another "cabal" binary installed in, say /usr/bin, then you'll still run the old version and get the message about the newer version again.
Also if the other cabal is in a place before $HOME/.cabal/bin in the PATH.
participants (3)
-
Andres Loeh
-
Daniel Fischer
-
Tom Murphy