cabal, ghc-pkg, PATH

Isaac Jones ijones at
Sun Aug 21 23:18:50 EDT 2005

Frederik Eaton <frederik at> writes:

> Hi,
> Does cabal use the version of ghc and ghc-pkg from PATH? I have ones
> which are locally installed, and sometimes it seems like cabal is
> using the ones in /usr/bin/ instead. For instance, it is complaining
> about packages which are only visible to the versions installed in
> /usr/bin/. However, cabal wouldn't be messing up consistently since it
> shows the correct 'ghc' path for compilations, when I run it with
> '-v'.

Check which version of ghc and ghc-pkg it discovers during the
configure phase.  Yes, it looks for it in PATH, or you can tell it
where to find the executable.  If it finds the correct
/path/to/ghc-pkg, then use /path/to/ghc-pkg -l to see if the broken
packages are visable to this ghc.

When you compile it with -v, it'll show the path, as you say.  Then
you can look for the command its running and track down the error that
way.  If you get the error when you run the correct /path/to/ghc by
hand, then I guess it's that ghc's package database that has the
broken packages.



More information about the Libraries mailing list