Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#5580 closed feature request (wontfix)

Make switching GHC versions easier on Mac OS

Reported by: pumpkin Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.2.1
Keywords: Cc: leather@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


The standard .pkg installer for GHC or the platform follow the Mac OS convention of keeping different versions in separate version folders in the framework, with a symlink from Current to the current version. However, the wrapper scripts (/usr/bin/ghc, runhaskell, ghci) all explicitly mention the full path to the GHC that was most recently installed, like


This prevents us from easily switching versions by just changing the symlink to an older version. Could the variables in the GHC script be changed to something like


so we can switch more easily?

Attachments (1)

ghc-ver (555 bytes) - added by spl 6 years ago.
Shell script to change Current symlink

Download all attachments as: .zip

Change History (4)

comment:1 Changed 6 years ago by pumpkin

Oh, it turns out the scripts are themselves symlinks. So the symlinks could just point to GHC.framework/Versions/Current rather than a specific version.

comment:2 Changed 6 years ago by igloo

Resolution: wontfix
Status: newclosed

There's no guarantee that different versions provide the same scripts.

I know nothing about how the Mac packaging system works, but switching versions ought to be done by asking the packaging system to change version.

Changed 6 years ago by spl

Attachment: ghc-ver added

Shell script to change Current symlink

comment:3 Changed 6 years ago by spl

Cc: leather@… added

There may be no guarantee that different version have the same executables, but the attached script works perfectly fine for me as long as the symlinks in /usr/bin point to the the appropriate location in Current and Current points to one of the versions. For example:

$ ll /usr/bin/ghc
lrwxr-xr-x  1 62B 26 Oct 17:40 /usr/bin/ghc@ -> /Library/Frameworks/GHC.framework/Versions/Current/usr/bin/ghc
$ ll /Library/Frameworks/GHC.framework/Versions/Current
lrwxr-xr-x  1 55B  8 Nov 19:11 /Library/Frameworks/GHC.framework/Versions/Current@ -> /Library/Frameworks/GHC.framework/Versions/7.2.1
Note: See TracTickets for help on using tickets.