Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

haskell-platform fails on mountain lion #13519

Closed
paulmillr opened this issue Jul 20, 2012 · 59 comments
Closed

haskell-platform fails on mountain lion #13519

paulmillr opened this issue Jul 20, 2012 · 59 comments

Comments

@paulmillr
Copy link
Contributor

https://gist.github.com/9cca3b767cd39dfceab9

brew doctor gives no warns.

@mistydemeo
Copy link
Member

Can you try brew install haskell-platform --use-llvm?

@paulmillr
Copy link
Contributor Author

same

@nevinng
Copy link

nevinng commented Jul 23, 2012

Same here.

@janl
Copy link
Contributor

janl commented Jul 24, 2012

@dysinger tweeted:

crappy workaround for HUnit problems: tar f ~/.cabal/packages/hackage.haskell.org/00-index.tar --delete HUnit/1.2.5.0/HUnit.cabal

https://twitter.com/dysinger/statuses/227864197822824448

@dysinger
Copy link
Contributor

This was a fix for Ubuntu (Linux) - the same thing may or may not work on Mac. It's a temporary workaround also. I'll try the homebrew install today and see if it works.

@patrickdet
Copy link

has anyone found a solution yet?

@dysinger
Copy link
Contributor

no. I am banging my head on this today. haskell platform requires ghc 7.4.1 anyway. why is the recipe installing binary package of 7.4.2 and using a workaround flag to compile the haskell platform from source?

@dysinger
Copy link
Contributor

IMHO you should either compile BOTH ghc 7.4.1 & haskell platform 2012.2.0.0 from source or use the binary packages. Using a mix of the two with 7.4.2 instead of 7.4.1 is just asked for problems.

@patrickdet
Copy link

I am not sure that a build script that takes several hours is what
most people here are looking for. Might be nice to include that as a
'brew options' option though.

On 29.07.2012, at 01:17, Tim Dysinger
reply@reply.github.com
wrote:

BTW this is the script I am using personally. It requires several hours to build from scratch but it guarantees that it's a fit for the exact version of Mac you are on:

#!/bin/sh

ARCH=x86_64 ; GHC=7.4.2 ; PLATFORM=2012.2.0.0

[[ ! -d /usr/local/src ]] && mkdir -p /usr/local/src

BOOTSTRAP

cd /tmp
[[ ! -f ghc-${GHC}-${ARCH}-apple-darwin.tar.bz2 ]] &&
curl -O http://www.haskell.org/ghc/dist/${GHC}/ghc-${GHC}-${ARCH}-apple-darwin.tar.bz2
[[ ! -d ghc-${GHC} ]] && tar xf ghc-${GHC}-${ARCH}-apple-darwin.tar.bz2
cd /tmp/ghc-${GHC}
./configure --prefix=/tmp
make install
export PATH=/tmp/bin:$PATH

[[ ! -d /tmp/src ]] && mkdir -p /tmp/src
cd /tmp/src/
[[ ! -f haskell-platform-${PLATFORM}.tar.gz ]] &&
curl -O http://lambda.haskell.org/platform/download/${PLATFORM}/haskell-platform-${PLATFORM}.tar.gz
[[ ! -d haskell-platform-${PLATFORM} ]] && tar xf haskell-platform-${PLATFORM}.tar.gz
cd haskell-platform-${PLATFORM}
./configure --enable-unsupported-ghc-version
make
make install

GHC

cd /tmp/src/
[[ ! -d /tmp/src/ghc-${GHC} ]] &&
curl -O http://www.haskell.org/ghc/dist/${GHC}/ghc-${GHC}-src.tar.bz2 &&
tar xf ghc-${GHC}-src.tar.bz2
cd ghc-${GHC}
./configure --build=${ARCH}-apple-darwin
make
make install
export PATH=/usr/local/bin:$PATH

HASKELL-PLATFORM

cd /tmp/src/haskell-platform-${PLATFORM}
make clean
./configure
make
make install


Reply to this email directly or view it on GitHub:
#13519 (comment)

@tkho
Copy link

tkho commented Jul 29, 2012

As a workaround, on Mountain Lion, ghc 7.4.1 + haskell-platform 2012.2.0.0 worked for me:

brew rm ghc
git --work-tree=/usr/local/ checkout 3384702ff7b8f75a80613da6c4499a947bcd1c4d -- /usr/local/Library/Formula/ghc.rb
brew install haskell-platform --use-llvm
git --work-tree=/usr/local/ checkout HEAD -- /usr/local/Library/Formula/ghc.rb

@2bits
Copy link
Contributor

2bits commented Jul 29, 2012

If people can agree on the preferred versions, then someone should make a pull request to get things straightened out.

@29decibel
Copy link

same problem

@alinpopa
Copy link
Contributor

Same problem to me

@dysinger
Copy link
Contributor

Let's pause a minute on this. I just installed the binary package of 7.4.1 w/ haskell platform 2012.2.0.0 on my mac. I had some problems last night & this morning though. I am building GHC & HP from scratch right now to see if that fixes it. The binaries that exist were for Lion (not Mt Lion) and they switch the GCC up a bit in Mt. Lion. My hunch is that everything is not perfect with using the Lion binaries for GHC.

@dysinger
Copy link
Contributor

More later today. I can do the patch/pull request tonight. It might require 1-2 hours of compiling though unless we can host a tarball somewhere. GHC is a lengthy build.

@aboehrnsen
Copy link

@tkho Thanks for your suggestion. that gave me a good starting point.

Actually it could not find the commit you suggested.
So what worked for me was simply:

brew rm ghc
brew install haskell-platform --use-llvm

@noprompt
Copy link

@tkho I'd like to say thanks too. It worked for me.

@alinpopa
Copy link
Contributor

Hey, that worked for me too, but only after I removed already installed ghc. Thanks.

@dysinger
Copy link
Contributor

I don't think you'll be happy with it though. I had major bugs yesterday & today from the binary GHC package. You may or may not be digging into concurrent haskell enough to see them but they are there with the binaries. If it stays as is, I just wont use the homebrew recipe.

@2bits
Copy link
Contributor

2bits commented Jul 30, 2012

Make a small reproducible error case and explain exactly how to use it. Once we can verify the problem, then we will adjust the ghc formula as necessary.

@dysinger
Copy link
Contributor

Here's my final script that completely bootstraps & compiles haskell from scratch on Mtn Lion using the new llvm gcc.

https://gist.github.com/3211447

This version works great with the above project.

@patrickdet
Copy link

how long does it take to compile with this script? what kind of machine are you on?

thanks for the script. will try it should i run into any issues with the brew rm ghc; brew install haskell-platform --use-llvm option.

we still need a more permanent solution than removing ghc and then installing with llvm.

@dysinger are you going to submit a pull-request with your install script then?

On Tuesday, July 31, 2012 at 12:59 AM, Tim Dysinger wrote:

Here's my final script that completely recompiles haskell from scratch on Mtn Lion using the clang gcc.

https://gist.github.com/3211447

This version works great with the above project.


Reply to this email directly or view it on GitHub:
#13519 (comment)

@dysinger
Copy link
Contributor

I don't know. My script takes about 1+ hours on a new 4core macbook air 13" w/ 8gb ram. That may be "too much" for some people. I spend a lot of time on Haskell development so 1hr+ is nothing to me to make sure that it's correct & built for my mac.

What do others think?

@2bits
Copy link
Contributor

2bits commented Jul 31, 2012

Having a working tool you can be confident in is critical. Homebrew can bottle ghc if it has a long compile.

Homebrew can fix the formulas if you can show a reproducible error that is reported upstream so it can be linked in the formula comments. The sooner that gets done, the sooner this works better for everyone.

@noprompt
Copy link

@dysinger It's well worth the wait. The script worked perfectly for me. Thanks!

@dysinger
Copy link
Contributor

awesome!

@patrickdet
Copy link

alright, i tried it as well and it worked nicely. i'd say the long compile time is worth the wait so it would be good if you made a pull request with the updated formula.

On Tuesday, July 31, 2012 at 9:47 PM, Tim Dysinger wrote:

awesome!


Reply to this email directly or view it on GitHub:
#13519 (comment)

@tomekw
Copy link

tomekw commented Aug 2, 2012

+1 for the PR! Thanks!

@dysinger
Copy link
Contributor

dysinger commented Aug 2, 2012

I can work on it this weekend. If anyone gets a chance first, the script is right there (above).

@InvisibleTech
Copy link

So far so good, compiled... little over an hour. Ran ghci and used cabal to install yesod. Will keep using it. Thanks!

@2bits
Copy link
Contributor

2bits commented Aug 24, 2012

I converted my ghc.rb to be the equivalent of @dysinger's gist. I'll make a pull request at some point, but I can't find the file I edited. Then you'll have something to bottle. I'm painting the house. So I don't have a lot of time.

@fsvehla
Copy link

fsvehla commented Aug 24, 2012

There is a Spotlight Importer for Ruby which might help you help us.

Sent from my iPhone

On 24.08.2012, at 17:54, 2bits notifications@github.com wrote:

I converted my ghc.rb to be the equivalent of @dysinger's gist. I'll make a pull request at some point, but I can't find the file I edited. Then you'll have something to bottle. I'm painting the house. So I don't have a lot of time.


Reply to this email directly or view it on GitHub.

@2bits
Copy link
Contributor

2bits commented Aug 24, 2012

I think there was an unexpected Homebrew update to ghc that I let overwrite my file. I'll have to recreate it because I don't back up /usr/local

@dysinger
Copy link
Contributor

Sharpie: it is a pain in the butt to bootstrap from a binary. We could build binaries for 7.4.2 on each OS X platform and then just stick it on s3 or something. The build could use that to compile GHC. This is usually what's done elsewhere. I'm doing it for SmartOS right now.

@dysinger
Copy link
Contributor

It might just be easier if we just nudged the people that build the binaries that exist on the GHC page to just update for mountain lion. Then the recipe doesn't have to change other than paying attention to the OS X platform version and downloading the right binary.

@MikeMcQuaid
Copy link
Member

This sounds exactly what bottles are for. We make the formula a time consuming pain and bottle it so it only needs done once per release.

@Sharpie
Copy link
Contributor

Sharpie commented Aug 24, 2012

Sharpie: it is a pain in the butt to bootstrap from a binary. We could build binaries for 7.4.2 on each OS X platform and then just stick it on s3 or something.

Yeah, that's what I ment by bottling the final product. We maintain binary distributions of many things that are either tough to build right or take a long time:

http://sourceforge.net/projects/machomebrew/files/Bottles

GHC would fit the bill nicely as it has no dependencies outside of XCode---to there are no linker snafus to worry about.

It might just be easier if we just nudged the people that build the binaries that exist on the GHC page to just update for mountain lion.

The problem is that upstream seems to maintain only one binary version at a time so a simple update to Mountain Lion would probably break 10.6 and 10.7. What we really need are versions for Snow Leopard, Lion and Moutain Lion.

@2bits
Copy link
Contributor

2bits commented Aug 25, 2012

I rewrote a new ghc.rb in #14455 following @dysinger's gist nearly exactly. The build locations were changed from /tmp and /usr/local/src so that everything uses the Homebrew cache system and is cleaned up if there is an early exit.

45min with 3 cores on my 8GB iMac i5
39min with 4 cores.

Feel free to suggest modifications.

@2bits
Copy link
Contributor

2bits commented Sep 16, 2012

Where I'm at is testing my PR using the new env :std this weekend to see how it affects the tests, as 7.4.2 is getting 9 error atm. Also I'll see if I can get to examining each test that failed and reporting them.

2bits pushed a commit to 2bits/homebrew that referenced this issue Oct 3, 2012
Following the discussion in Homebrew#13519, ghc gets a major overhaul:

* Add a subformula that installs the ghc binary like before
* Use the ghc binary to build ghc from source
* Force ENV['LD'] = 'ld' to stop an assertion linking with llvm
* Add an option to run the testsuite. 9 unexpected fails atm
* Add a `j1` for an occasional install race
* Remove the patch which was fixed in two commits in Apr 2011.
        47ac5d859493ae0cd8dd02e1b4848f993acc3d5c
        a8d4731456ac3da0a70399e4ab821a763a4c04fb

Fixes Homebrew#13519
allenhuang pushed a commit to allenhuang/homebrew that referenced this issue Oct 11, 2012
Following the discussion in Homebrew#13519, ghc gets a major overhaul:

* Add a subformula that installs the ghc binary like before
* Use the ghc binary to build ghc from source
* Force ENV['LD'] = 'ld' to stop an assertion linking with llvm
* Add an option to run the testsuite. 9 unexpected fails atm
* Add a `j1` for an occasional install race
* Remove the patch which was fixed in two commits in Apr 2011.
        47ac5d859493ae0cd8dd02e1b4848f993acc3d5c
        a8d4731456ac3da0a70399e4ab821a763a4c04fb

Fixes Homebrew#13519

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
snakeyroc3 pushed a commit to snakeyroc3/homebrew that referenced this issue Dec 17, 2012
Following the discussion in Homebrew#13519, ghc gets a major overhaul:

* Add a subformula that installs the ghc binary like before
* Use the ghc binary to build ghc from source
* Force ENV['LD'] = 'ld' to stop an assertion linking with llvm
* Add an option to run the testsuite. 9 unexpected fails atm
* Add a `j1` for an occasional install race
* Remove the patch which was fixed in two commits in Apr 2011.
        47ac5d859493ae0cd8dd02e1b4848f993acc3d5c
        a8d4731456ac3da0a70399e4ab821a763a4c04fb

Fixes Homebrew#13519

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
@Homebrew Homebrew locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.