Cabal semantics for multiple compilers

In anticipation of the upcoming release of the Mac OS X Tiger installer for GHC 6.8.2, the following questions arise: 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. I think that is the correct behavior - if that package someday becomes a supported port, the port will install into /opt/local and I don't want to conflict with that. In general, I leave the entire /opt/local tree under the control of the automated port system. 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? Will Cabal do something reasonable and not get confused? (Will it not get confused if I do remember to specify the full path?) 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"? Thanks, Yitz

On Sun, 2008-03-09 at 12:12 +0200, Yitzchak Gale wrote:
In anticipation of the upcoming release of the Mac OS X Tiger installer for GHC 6.8.2, the following questions arise:
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. I think that is the correct behavior - if that package someday becomes a supported port, the port will install into /opt/local and I don't want to conflict with that. In general, I leave the entire /opt/local tree under the control of the automated port system.
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? Will Cabal do something reasonable and not get confused? (Will it not get confused if I do remember to specify the full path?)
It will use whichever is the ghc-6.8.2 on the $PATH. Alternatively you can specify the full path. It'll also look for a ghc-pkg-6.8.2 in the same directory in which it found ghc-6.8.2 (unless you override using --with-hc-pkg=). It'll use that to discover what packages are registered. So it's quite possible to have multiple installations of ghc of various versions and indeed of other Haskell implementations.
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 :-) 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) but you will have to ensure that you use different places to install packages for each or they will clash and you will get mysterious linker errors or worse. Duncan

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 process?
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. Thanks, Yitz

On Mon, 2008-03-10 at 01:37 +0200, Yitzchak Gale wrote:
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 process?
Yep.
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.
Remember of course that you can do per-user installs. Indeed it's much easier, cabal-install does that by default. Duncan

I wrote:
When I install packages, both copies of GHC 6.8.2 will want to install them into /usr/local.
Duncan Coutts wrote:
Then they will clash. Don't do that :-)
Ouch. I was afraid of that. This is going to be tricky.
Remember of course that you can do per-user installs. Indeed it's much easier, cabal-install does that by default.
Thanks for the tip. I'll think about that. -Yitz

I wrote:
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"?
Duncan Coutts wrote:
Then they will clash. Don't do that :-)
Ouch. I was afraid of that. This is going to be tricky.
Added http://hackage.haskell.org/trac/hackage/ticket/263 Regards, Yitz
participants (2)
-
Duncan Coutts
-
Yitzchak Gale