Weird error message ('Cannot determine version of GHC')

Duncan Coutts duncan.coutts at
Sun Dec 2 17:08:24 EST 2007

On Sat, 2007-12-01 at 01:52 +0000, Anthony Chaumas-Pellet wrote:
> Hello,
> I've just run across a fairly confusing error message when running
> 'cabal install':
>   Warning: cannot determine version of /usr/local/bin/ghc :
>   ""
>   cabal: ghc version >=6.2 is required but the version of
>   /usr/local/bin/ghc could not be determined.
> This error only appears with the install command, apparently when
> Cabal is run from a directory where it cannot write files (I was under
> /sys/, but the same goes for e.g. /usr/ as a non-root user).

Good point. This was a bug in the code we use to run a program and
capture its stdout. Due to portability limitations we have to do this by
redirecting the stdout to a file rather than using pipes and getting the
stdout directly. For some reason we were creating that temporary file in
the current directory rather than in the temp directory.

I've applied a patch in the Cabal HEAD branch.


More information about the cabal-devel mailing list