2
votes

I am currently trying to update Cabal (1.14.0, cabal-install at version 0.14.0) by doing

cabal install cabal-install

However, this gives me an ExitFailure1 with the error

setup: The program ghc version >=6.4 is required but the 
version of /usr/bin/ghc could not be determined.

But I'm definitely running a version of GHC that is greater than that.

$ /usr/bin/ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.4.2

It might be important that I'm on OSX 10.8 and that I installed Haskell through the Haskell Platform download for Mac.

Does anyone have advice on how to fix or work around this issue? I haven't been able to find any documentation on this problem.

1
Does running cabal with -v, -v2 or -v3 give any hints? - bennofs
@bennofs -v3 revealed how it's supposed to be getting the version, using the --numeric-version flag, but this confuses me even more since running /usr/bin/ghc --numeric-version gives back the output "7.4.2". - akbiggs
what happens when you try cabal update? can you also give us output to your $PATH directory? you might need to point to your ghc location - katychuang
You could also grab the bootstrap.sh script from here and run it. That installs cabal without depending on cabal. Maybe that works. - bennofs
@katychuang Running "cabal update" just tells me that my cabal-install is out of date. Also, I think the output from -v3 implies that this isn't a pathing issue, since it's finding the correct executable for ghc. - akbiggs

1 Answers

1
votes

Since you're on a Mac, why not try installing the excellent Homebrew package manager? Add /usr/local/bin to your PATH, and then it's just brew install cabal-install.

You can even brew install ghc haskell-platform.

To upgrade the package list, use brew upgrade, then you can see what needs updating with brew outdated and update them with brew update.

Of course, you can name individual packages to update also, and specify versions of packages. Homebrew keeps the "recipes" (Ruby scripts) for package management in its own git repository (by default in /usr/local).

Then you can get on with what you really wanted to do in the first place...write some code! (or build, in your case)