#1540: GHC on Macs
--------------------------------+-------------------------------------------
    Reporter:  guest            |        Owner:  thorkilnaur
        Type:  support request  |       Status:  new        
    Priority:  high             |    Milestone:  6.8        
   Component:  Build System     |      Version:  6.6.1      
    Severity:  normal           |   Resolution:             
    Keywords:                   |   Difficulty:  Unknown    
          Os:  MacOS X          |     Testcase:             
Architecture:  x86              |  
--------------------------------+-------------------------------------------
Changes (by chak):

  * component:  Compiler => Build System

Comment:

 I had a closer look at how to create an installer package today.

 === gcc and friends ===

 As Malcolm said, we don't just need gcc, but many of the unix tools
 included in the Apple developer bundle Xcode.  Among those is the linker,
 which is not GNU's linker, but Apple's own linker for Mach object files.
 The linker, like all the other Apple-specific core tools, is open source
 (under the APSL); so, we would be legally allowed to re-distribute it.
 However, unlike windows, macos is a unix system, so all these tools and
 libraries have a place where they belong.  Now, if we just install them to
 wherever they should go, we risk breaking an existing Xcode installation
 (or conversely a later Xcode installation may break the ghc installation).
 If instead, we keep the tools and libraries in our own private location,
 developers will end up with two versions of gcc, make, ld, all library
 headers, etc.  This will get anybody in trouble who builds programs
 involving both C and Haskell code.  A call to gcc will invoke the Xcode
 gcc and a call to ghc will invoke ghc's gcc both of which will use
 different versions of libraries.  This may break at link time or just give
 rise to subtle runtime errors.

 The only remaining option would be to build a package that
 '''conditionally''' installs gcc and friends if Xcode is not already
 installed.  The only caveat here is that if somebody wants to install
 Xcode after ghc, they probably will have to remove ghc first (which I'd
 hope the Xcode installer would detect).  Nevertheless, building an install
 package that does (conditionally or not) installs gcc and friends is quite
 a bit more work than building a package that just installs ghc.  (You need
 to create a ''distribution bundle'' which contains the various components
 as sub-packages, and we cannot just reuses Apple's sub-packages as some of
 them contain code that is not under the APSL; e.g., the package with
 `make` in it contains the Xcode gui if I am not mistaken.)

 === gmp and readline ===

 In contrast to gcc and friends, I see no problem to including them in a
 package.

 === Nightly builds ===

 The macos package builder has a fully featured CLI, so packing in build
 scripts should come for free.

 === x86/ppc ===

 The Right Thing on macos is to build a universal binary that includes
 support for both architectures.  However, that is not possible without
 extra support from ghc, most notably support for cross-compilation.  (So,
 universal binaries are not going to happen anytime soon.)

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1540>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to