Ticket #5390 (closed bug: fixed)

Opened 22 months ago

Last modified 12 months ago

Hard-coded /Developer path in Mac ghc

Reported by: Ahruman Owned by: pumpkin
Priority: low Milestone: 7.6.1
Component: Compiler Version: 7.0.3
Keywords: platform Cc:
Operating System: MacOS X Architecture: Unknown/Multiple
Type of failure: GHC doesn't work at all Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description (last modified by igloo) (diff)

The Haskell Platform package for Mac OS X installs a /usr/bin/ghc script which hard-codes the path to gcc as:

pgmgcc="/Developer/usr/bin/gcc"

This is incorrect, as Xcode tools can be installed at semi-arbitrary locations, and there may be several versions installed. The correct approach is:

developerpath=`xcode-select --print-path` # Produces "/Developer" or alternative path
pgmgcc="$developerpath/usr/bin/gcc"

Change History

Changed 21 months ago by igloo

  • description modified (diff)

Changed 19 months ago by igloo

  • owner set to pumpkin
  • milestone set to 7.4.1

Changed 16 months ago by igloo

  • priority changed from normal to low
  • milestone changed from 7.4.1 to 7.6.1

Changed 12 months ago by altaic

I believe this issue has been fixed; with Haskell Platform 2012.0.0 (OS X, 64 bit), my /usr/bin/ghc looks like the following (no references to /Developer, or even gcc, for that matter):

#!/bin/sh
exedir="/Library/Frameworks/GHC.framework/Versions/7.4.1-x86_64/usr/lib/ghc-7.4.1"
exeprog="ghc-stage2"
executablename="$exedir/$exeprog"
datadir="/Library/Frameworks/GHC.framework/Versions/7.4.1-x86_64/usr/share"
bindir="/Library/Frameworks/GHC.framework/Versions/7.4.1-x86_64/usr/bin"
topdir="/Library/Frameworks/GHC.framework/Versions/7.4.1-x86_64/usr/lib/ghc-7.4.1"
executablename="$exedir/ghc"
exec "$executablename" -B"$topdir" ${1+"$@"}

Changed 12 months ago by altaic

Oops, I meant to say: Haskell Platform 2012.2.0.0

Changed 12 months ago by simonmar

  • difficulty set to Unknown

We still have a gcc path in the settings file, I believe.

Changed 12 months ago by Ahruman

There is indeed a fixed path in settings, but it doesn’t have the same problem of relying on an Xcode install path. Instead, GHC requires the command line developer tools package, now a separate installation which doesn’t have the option of a custom path.

(The approach of using xcode-select --print-path is still valid, and produces /Applications/Xcode.app/Contents/Developer by default under the new regime, but there’s no clear advantage to doing that any longer.)

Changed 12 months ago by simonmar

Ok, so you're saying that now gcc is always in /usr/bin and is independent of the XCode installation path, it doesn't matter that we have a fixed path in our settings file?

Changed 12 months ago by Ahruman

Yes. Or close enough to yes for rock’n’roll.

Changed 12 months ago by simonmar

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.