simultaneous ghc versions

Wolfram Kahl kahl at
Fri Jul 31 22:04:18 UTC 2015

On Sat, Aug 01, 2015 at 06:31:38AM +1000, Erik de Castro Lopo wrote:
> I maintaing multiple versions of GHC on all the machines I use regularly
> for Haskell development. I have:
> * ghc-7.6.3 installed under /usr/lib/ghc-7.6/
> * ghc-7.8.4 installed under /usr/lib/ghc-7.8/
> * ghc-7.10.2 installed under /usr/lib/ghc-7.10/
> To switch between versions all I need to do is modify $PATH
> to remove say /usr/lib/ghc-7.6/bin and add /usr/lib/ghc-7.10/bin.
> This lets me have two terminal window side by side with different
> versions of GHC.

I use essentially the same setup,
but found that cabal-install does not play nicely with this:
No matter under which prefix I install cabal-install,
it always assumes the same global path for its configuration file.
This is a nuisance in particular when for some reason different versions
of GHC need different versions of cabal-install --- apparently older GHCs
don't work with newer versions of cabal-install?

I did experiment with cabal-install's -w and sandboxes,
and agree with what was previously mentioned:
It only helps if you never use GHC without cabal-install.

It would be nice if cabal-install had an installation-time option
to set its prefix directory FOR EVERYTHING.
The best cludge I found was scripts /usr/lib/ghc-*/bin/mycabal
that call /usr/lib/ghc-*/bin/cabal with appropriate options...


More information about the Glasgow-haskell-users mailing list