[Haskell-cafe] Switching GHC Version
Austin Seipp
mad.one at gmail.com
Tue Feb 7 00:40:20 CET 2012
Personally I prefer just using 'virthualenv' these days, which
installs copies of GHC locally that you can then activate with your
shell, similar to 'virtualenv' in python. It's how I test packages on
multiple copies of GHC.
http://hackage.haskell.org/package/virthualenv
The nicest part is that it sandboxes cabal packages, but because it
works via shell scripts, the workflow for any version of GHC remains
the same: you can invoke ghci, cabal, etc all as you would expect, but
it only takes place in the virtual environment if you have activated
it.
On Mon, Feb 6, 2012 at 5:27 PM, HASHIMOTO, Yusaku <nonowarn at gmail.com> wrote:
> Hi, I wrote a simple shell function for switching GHC version on the
> system. It works only under Mac OSX, and only switch GHCs installed
> via .pkg installers. It's useful to experiment newer features without
> worrying breaking environment.
>
> GHC_BASE_DIR=/Library/Frameworks/GHC.framework/Versions/
>
> ghcs () {
> VERSION=$1
> sudo $GHC_BASE_DIR/$VERSION/Tools/create-links . /Library/Frameworks /
> }
>
> Usage:
> ~/work/today 08:21 ghcs 7.4.0.20111219-x86_64
> Password:
> ~/work/today 08:21 ghc --version
> The Glorious Glasgow Haskell Compilation System, version 7.4.0.20111219
> ~/work/today 08:21 ghcs 7.4.1-x86_64
> ~/work/today 08:22 ghc --version
> The Glorious Glasgow Haskell Compilation System, version 7.4.1
>
> Now I'm curious of better way to achieve this. This have limitations
> described above. Even it requires sudo because it modified symbolic
> links under `/usr`.
>
> Suggestions?
> -nwn
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
--
Regards,
Austin
More information about the Haskell-Cafe
mailing list