GHC on Snow Leopard: best practices?

Is there any consensus about what needs to be done to get a working
ghc installation on a Snow Leopard (Mac OS X 10.6) system? The Mac OS
X wiki page[1] currently links to a blog post[2] that recommends
manually patching /usr/bin/ghc, but I have also seen recommendations
that people patch ghci, runhaskell, runghc, and hsc2hs. Is that also
recommended? If so, there should probably be an updated how-to on the
wiki.
I expect most Haskell users are capable of patching the scripts
themselves, given instructions, but it's hardly convenient. Would it
be practical to repackage the current ghc installer with updated
scripts for Snow Leopard? If not, will there be updated scripts
available for the forthcoming releases of GHC or the Haskell Platform?
[1] http://www.haskell.org/haskellwiki/Mac_OS_X
[2] http://obvioushints.blogspot.com/2009/09/running-haskell-ghc-on-snow-leopard...
--
Dave Menendez

I'm back in Cambridge now. Snowdonia was great, and just as wet as expected. As far as I'm aware, nobody's got a fully functioning Snow Leopard GHC yet. Just before going away, I tried to use my partly-functioning 64- bit GHC to build 6.10, but found that the stage 1 compiler segfaulted. My plan now is to get 6.8.3 fully working so that we all have something, if a little old, that works. (This is because I need it for another project.) Once I've managed this, I'll post a full set of instructions to get everyone else going too. Then I plan to attempt to get 6.12 working, and provide a binary that can be used for bootstrapping. (I may need some pointers for this.) Incidentally, 6.12 doesn't appear to be in http://www.haskell.org/ghc/dist/ , only in the Darcs repo. Was that intentional? So far, the sticking point has been getting the interactive linker to work. Snow Leopard has much tighter security than its predecessors, so we have to use mmap. Unfortunately, the mmap version of GHC's linker also requires mremap, which is a Linux-only extension that Snow Leopard doesn't have. See you, Barney.

Hello Barney, Thursday, October 8, 2009, 12:58:01 AM, you wrote:
Incidentally, 6.12 doesn't appear to be in http://www.haskell.org/ghc/dist/ , only in the Darcs repo. Was that intentional?
it's not yet released: http://haskell.org/ghc/ -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Barney Stratford:
So far, the sticking point has been getting the interactive linker to work. Snow Leopard has much tighter security than its predecessors, so we have to use mmap. Unfortunately, the mmap version of GHC's linker also requires mremap, which is a Linux-only extension that Snow Leopard doesn't have.
Did you mean to say that Snow Leopard in 64-bit mode has tighter security? After all, a Leopard-compiled 32-bit version of ghci works just fine on SL. Manuel

On 07/10/2009 21:58, Barney Stratford wrote:
I'm back in Cambridge now. Snowdonia was great, and just as wet as expected.
As far as I'm aware, nobody's got a fully functioning Snow Leopard GHC yet. Just before going away, I tried to use my partly-functioning 64-bit GHC to build 6.10, but found that the stage 1 compiler segfaulted.
My plan now is to get 6.8.3 fully working so that we all have something, if a little old, that works. (This is because I need it for another project.) Once I've managed this, I'll post a full set of instructions to get everyone else going too. Then I plan to attempt to get 6.12 working, and provide a binary that can be used for bootstrapping. (I may need some pointers for this.)
Incidentally, 6.12 doesn't appear to be in http://www.haskell.org/ghc/dist/ , only in the Darcs repo. Was that intentional?
So far, the sticking point has been getting the interactive linker to work. Snow Leopard has much tighter security than its predecessors, so we have to use mmap. Unfortunately, the mmap version of GHC's linker also requires mremap, which is a Linux-only extension that Snow Leopard doesn't have.
I believe we fixed the mremap dependency in 6.10, and that was also when we added support for libffi. I expect you'll have a much easier time getting GHCi to work with 6.10 or 6.12, so use 6.8.x for bootstrapping only. Cheers, Simon

David Menendez:
Is there any consensus about what needs to be done to get a working ghc installation on a Snow Leopard (Mac OS X 10.6) system? The Mac OS X wiki page[1] currently links to a blog post[2] that recommends manually patching /usr/bin/ghc, but I have also seen recommendations that people patch ghci, runhaskell, runghc, and hsc2hs. Is that also recommended? If so, there should probably be an updated how-to on the wiki.
Patching /usr/bin/ghc is sufficient to get a version of GHC that passes the regression tests suite in "fast" mode (the same setting that the validate script uses). If you want to use hsc2hs, you need to patch that, too. I haven't found a need to patch the interpreter, though. Manuel

On Thu, 2009-10-08 at 18:32 +1100, Manuel M T Chakravarty wrote:
David Menendez:
Is there any consensus about what needs to be done to get a working ghc installation on a Snow Leopard (Mac OS X 10.6) system? The Mac OS X wiki page[1] currently links to a blog post[2] that recommends manually patching /usr/bin/ghc, but I have also seen recommendations that people patch ghci, runhaskell, runghc, and hsc2hs. Is that also recommended? If so, there should probably be an updated how-to on the wiki.
Patching /usr/bin/ghc is sufficient to get a version of GHC that passes the regression tests suite in "fast" mode (the same setting that the validate script uses). If you want to use hsc2hs, you need to patch that, too. I haven't found a need to patch the interpreter, though.
And they almost certainly do want hsc2hs (even if they don't know it) because it's used by all sorts of other libs. The first one people hit is the zlib binding which is used by cabal-install. It appears to compile ok but then fails the version check performed by the zlib C library (eg when someone does cabal update). Duncan
participants (6)
-
Barney Stratford
-
Bulat Ziganshin
-
David Menendez
-
Duncan Coutts
-
Manuel M T Chakravarty
-
Simon Marlow