Advice on Multiple GHC installations
bayer at cpw.math.columbia.edu
Tue Apr 13 10:08:49 EDT 2010
On Apr 13, 2010, at 9:19 AM, Nils Anders Danielsson wrote:
> On 2010-04-12 22:28, Bradford Larsen wrote:
>> 2. If I cannot install multiple ghc versions from a different apt
>> repository, does anyone have advice for how to work with multiple
>> simultaneous installations? A how-to guide or anything like that?
> I install GHC under /usr/local/stow/ghc-<version>/ by using the --prefix
> flag when configuring the binary packages.
Why not just use symbolic links? I too have multiple installations of ghc (at the moment, only two), and I choose between them using a symbolic link:
book % ls -l /usr/local | grep ghc
lrwxr-xr-x 1 root wheel 10 Jan 12 00:05 ghc -> ghc-6.12.1
drwxr-xr-x 7 dave wheel 238 Dec 25 10:46 ghc-6.10.4
drwxr-xr-x 7 dave wheel 238 Jan 8 21:52 ghc-6.12.1
(/usr/local/ghc/bin is on my PATH.)
My install scripts use the --prefix flag. I also make the actual installations user-writeable, so that I DON'T have to use sudo at any point after setting up the directories. This gives me a nice proof that no script I then call is messing up other parts of my system. (One can still accidentally still do something "locally", creating an unannounced subdirectory of $HOME e.g. using cabal-install.)
I follow this strategy for pretty much any program that I care about. I only believe in scattering program parts through /usr/local/[bin,lib,doc] if I believe they will work, will never need upgrading for the life of my OS, and "La La La I can't hear you!" I'm going to pretend they don't even exist once I'm done installing.
GHC is way too important to be treated that way, so I follow (roughly) Nils' strategy.
More information about the Glasgow-haskell-users