Cabal semantics for multiple compilers

Yitzchak Gale gale at
Sun Mar 9 19:37:57 EDT 2008

I wrote:
>> I currently have GHC 6.8.2 installed via MacPorts
>> in /opt/local. When I use Cabal to install packages
>> manually, they install into /usr/local...
>> Now, what will happen when I install a second
>> copy of GHC 6.8.2 into /usr/local using the installer?
>> First question: What will --with-compiler=ghc-6.8.2
>> now mean if I forget to specify the full path?

Duncan Coutts wrote:
> It will use whichever is the ghc-6.8.2 on the $PATH.

They'll both be in $PATH. So do you mean the first
one? Will that work consistently throughout the install

>> Second question: When I install packages, both copies
>> of GHC 6.8.2 will want to install them into /usr/local. Cabal
>> uses directory names like "ghc-6.8.2" to keep installations
>> for different compilers separate from each other. But what
>> if both of the compilers are called "ghc-6.8.2"?

> Then they will clash. Don't do that :-)

Ouch. I was afraid of that. This is going to be tricky.

> You can have two instances of the same version
> of GHC installed (though quite why you'd want to
> do that I'm not sure)

Well, a MacPorts port and a binary install each have their
advantages and disadvantages. (Think ebuild vs. apt/yum/rpm
on linux.) It is certainly conceivable that you'd want both,
each configured differently. I will definitely need both
to coexist at least for a while as I transition from
MacPorts back to the binary install when it is ready.

Another example: if we adopt Simon's idea of GHC
distributions - and I think we should - then we are likely
to see several such distributions, tailored for different
needs, and some people installing more than one of them.


More information about the Libraries mailing list