Homebrew and Xcode 4.2 #6852
Comments
There are currently 91 formulae that have |
Is it possible to remove the XCode dependency and recommend osx-gcc-installer instead? I've been using it exclusively and so far, so good. |
👍 I'd love to see this as well. |
@sorin-ionescu that's disappointing. Requiring a 3Gig download for a C compiler is intolerable. |
Buy an Apple computer, play by Apple's rules. |
@adamv the rules are stupid. 3Gb for a C compiler is stupid. It's a consequence of OSX's lack of a decent package manager. Developers getting annoyed is the raw fuel that powers open-source, in case you didn't know. ;-) |
I guess if OSS had produced UI as good as OS X on Linux, we wouldn't be griping about this right now. |
@adamv, while OSS has never been able to produce a decent GUI, it has certainly produced decent package managers, including great ones, like Arch Linux' Pacman. The problem is GPL; so, Apple will never touch them. The BSD community does not have a package manager worth taking. @alassek, I would not expect Apple to ever release the compiler without Xcode. Apple is a hardware company. Whatever software they create must sell hardware, and whatever software 3rd party developers create must sell hardware. From the business point of view, it makes no sense for Apple to spend resources to help web developers create apps that can be and will be, due to low marketshare, consumed on competitors' hardware. |
@sorin-ionescu creating a decent OSX package manager would benefit everyone, Apple included. But I've already resigned myself to the reality that they're probably too myopic to care. |
A few people in the Arch Linux forum were trying to port Pacman to Mac OS X. I don't know what has come of it. Why don't you look into package managers? Then send Apple a feedback letter urging them to adopt something. On Aug 16, 2011, at 1:35, alassekreply@reply.github.com wrote:
|
@sorin-ionescu I wish I were more knowledgable about package management. If there's an effort underway to port Pacman I'll help out any way I can. |
Well, Apple released Xcode 4.2 GM yesterday, so this therotical problem has become reality. I ran into the issue after doing a clean install of Lion. Since I didn't have any previous Xcode version installed, GCC 4.2 was missing on my computer. It took me more than 4 hours to figure that out (it's really the last thing you would expect to happen) and copy the missing binaries out of the Xcode 4.1 package. I guess more and more developers will find themselves in this very situation during the next few months and since Xcode 4.1 will not be available for download much longer, I think we need to find a solution quickly. I tried to compile the GCC 4.2 source code from opensource.apple.com with LLVM-GCC, but of course that didn't work. I'm not a license expert, but shouldn't the binaries in the Xcode 4.1 package also be licensed under GPL? In that case we could put up a 'gcc-4.2' formula simply containing these files, couldn't we? |
Perhaps a better alternative is to simply make GCC (a newer version, say 4.6.1) itself a formula in mainline homebrew, and possibly let any packages that absolutely need it have it as a dependency? There are active maintainers of the Darwin port of GCC, and I myself have 4.6 installed on my machine for performance testing. Clang itself reportedly builds GCC quite capably and has been able to do so for a while, but I haven't confirmed this any time recently. (Full disclosure: I'm not yet running Lion and only have XCode 4.0.2 still.) Long term I think this is absolutely the best route if Apple is going to discontinue shipping it. Since they're doing that (truthfully they have no reason to support it - they will never upgrade past GCC 4.2, because later version are GPLv3) there's likely not a whole lot we can do about it legitimately, that won't be a burden on users (breakage in future OS X versions, being a PITA to install) and people who want things working. I see any sort of attempts to keep GCC 4.2 alive as completely futile, and likely to cause much disturbance in the Force. Modern XCode is required in order to install certain OS X frameworks and headers properly, and they will probably not like people using a redistribution of that en masse. I would advise making a recent GCC formula that either is keg-only, or safely sets the program suffix of GCC to something like '4.6' via EDIT: I'll also go ahead and mention that GCC 4.6 is in any case far ahead of GCC 4.2 in terms of performance, features and speed, so honestly it's a win in any case if you ask me. Further, this seems like a completely logical step from the Homebrew perspective IMO, because GCC is clearly no longer going to be under Apple control or distributed with the system. Thus I feel in the same vein it should be excluded from Homebrew's "package exemptions" - it has now just become an ordinary piece of software we should let people install if they need it. |
One potentially major problem with non-Apple GCC (such as 4.6.x) is that they don't build universal binaries. On has to recompile multiple times, track the binaries down, pair them up, and stich the whole mess together using The |
You are absolutely right @thoughtpolice, But this task takes time and much expertise: Testing each formula, finding compiling errors, reporting them to the project mantainers and waiting for the fixes to be released. In the meantime people won't be able to compile these formulas or other software which isn't on brew: rvm Ruby versions, gems, python modules. Developers using Lion need a legacy solution for legacy software version anyway and only the Apple GCC version 4.2 can guarantee that everything will compile without any problems, at the moment. Maybe someone more skilled in compiling than me, could have a look at http://www.opensource.apple.com/tarballs/gcc/gcc-5666.3.tar.gz. Compiling Apple GCC 4.2 with Clang or LLVM-GCC should be possible somehow, somehow, don't you think? |
It could be distributed as a bottled formula (built with gcc-4.2 itself), so users of Xcode 4.2+ don't have to compile it themselves. However, I think that making clang the default compiler should be a priority as well, otherwise we'll have the same problem when LLVM-GCC gets discontinued. Maybe create a new |
We'll probably add |
Xcode 4.2 has been released. |
I just upgraded to Lion, which zorched my old Xcode, and then installed it again from the App Store. It's 4.2, and now a just about everything fails with /usr/bin/cc not found. I considered symlinking, but wonder if there will be tertiary failures as a result. Have I shot myself in the foot? Is there any way to recover or is my homebrew doomed to failure? :) (My currently installed utilities still work, so I guess being stuck in time is tolerable, but not ideal :) Thanks, |
That sounds odd. "Installing" from the App Store just downloads an XCode installer to |
Ah, OK I'd seen that mentioned (needing to run an additional I'll try that, thanks! On Wed, Oct 26, 2011 at 12:20 PM, Charlie Sharpsteen
Christopher Patti - Geek At Large | GTalk: cpatti@gmail.com | AIM: |
I think I've got it fixed. The trick is to first install Xcode 4.1 and then upgrade to Xcode 4.2. More details can be found here: https://gist.github.com/1324955 Please let me know how this works out for you. |
Oy this was stupid user syndrome. Just in case anyone else is similarly myopic and needs exact instructions, when you 'install' Xcode from the app store (I know others have said this :) it puts an "Install Xcode.app" or similar into your /Applications folder. Until you run this it's not really installed. Go figure. |
for me the fix was to add
to the formula below
|
How are we doing on this? Are there any actionable items in here or can we close this issue? |
One thing I have found is a full build of Apple GCC 4.2.1 for Lion that supports i386 and x86_64 architectures: http://r.research.att.com/tools/gcc-42-5666.3-darwin11.pkg Currently the GFortran formula uses this package but throws away the C compilers. It would be easy to post a full install as an Then there would be an easy way for users of XCode 4.2+ to obtain a vanilla GCC installation if they absolutely need it. |
I just added an
The installation downloads precompiled binaries of the compilers that were dropped from XCode 4.2:
The compilers were built from Apple's GCC 4.2.1-5666.3 sources and are capable of creating i386/x86_64 universal binaries. Moving forward, it would be nice to get everything compiling cleanly under Clang as the Apple GCC is going to fade into history. However, this should provide a crutch for those who absolutely need it and we don't have to go through the effort required to maintain a source build. @adamv @jacknagel @mxcl @MikeMcQuaid @mistydemeo We can probably close this issue now, unless anyone has something else to add. |
How can I use this to compile formulas? it seems like Homebrew only checks /usr/bin for gcc-4.2 |
None of the team have access to the beta so I suggest you either downgrade, write a patch or donate money for a developer license :) |
@MikeMcQuaid I think he's talking about Charlie's new apple-gcc42 formula, which is meant to be used with release versions of Xcode 4.2. If Homebrew isn't checking in prefix/bin/gcc-4.2, that needs to be updated. |
Ah. We'll have a similar problem in Xcode 4.3 hence the confusion. Thanks @mistydemeo. |
Is there anything actionable here in this issue? Things that need to move to a wiki page? |
I believe so... |
@igorbernstein See #9384. |
I stand corrected |
I've managed to install the alternative gcc to /usr/local/bin, but how do I now make brew find it? The #9384 thing is probably not yet included in brew? --use-gcc flag is not recognized if I try brew upgrade --use-gcc. Thanks from a non-git-wizard! |
Probably can close this one since Xcode 4.2 came out and things seem okay. |
Hm, not for me - but I had erased Xcode 4.1 before installing XCode 4.2. Somebody else mentioned that it works if you install 4.1 first and then 4.2, so maybe in that case it just keeps the compilers from 4.1 around? |
Correct. GCC isn't in 4.2 but Clang is much better so we should fall back to that instead (and probably prioritise it over llvm-gcc). |
I thought llvm-gcc was the better choice since it has the same CLI as gcc? Regarding closing this ticket, we need specific tickets for formula that break, and I expect we have them. |
Reopening. LLVM-GCC is removed as-of LLVM 3. The version included with Xcode 4.2 is based on LLVM 2336. Clang will be remaining and the version included with Xcode 4.2 is based on LLVM 3.0svn. It also (in my limited tests, soon to be expanded) compiles more code and optimises better than LLVM-GCC does. |
Sharpie's comment
failed for me with the almost amusing "Error: undefined method `lion?' for MacOS:Module" furtunately it did successfully download the .pkg which, after installing, seems to have fixed the epic breakage in my homebrew. cheers |
@evilrob666 Have you |
Hmm... something is wrong with your Homebrew installation if the https://github.com/mxcl/homebrew/blob/master/Library/Homebrew/utils.rb#L394-396 I agree with Misty---the most likely cause is that you are somehow stuck on an ancient version of Homebrew that predates OS X 10.7. |
I'm quite prepared to believe there's something screwy with my homebrew. I don't know how it could've got that way though. (fwiw, yesterday I did brew update and brew upgrade each a few times, and neither seemed to do anything) Today I tried a brew update and got "error: Your local changes to 'Library/Formula/dirac.rb' would be overwritten by merge. Aborting. rather disturbingly; #[Tue Jan 24 11:19:58] simurgh:/usr/local/Library/Formula:master+$ git status | wc (rather a lot of modified + deleted lines - none of which, as far as I know my doing (i.e. I've not consciously modified any of those) trying a few git checkout -- dirac.rb just uncovered more probs - eventually I stashed the whole thing and was able to brew update, but I don't understand how brew got itself into that state... :-/ ) after that I was able to brew update, but brew upgrade now fails with; #[Tue Jan 24 11:22:07] simurgh:/usr/local/Library/Formula:master$ brew upgrade |
I'm not quite sure why, but this is a problem that's come up a few times. (Often enough we included it in the FAQ!) If you haven't made any local changes to Homebrew you want to keep, you can do this to remove all the extra files:
|
Can we close this now that focus has shifted to 4.3, in #9179? |
Yep, definitely. |
Yeah, I wish we could figure why the git history ends up in a weird state like that. Sorry Rob. |
The GCC 4.2 compiler will be discontinued with the Xcode 4.2 release this fall. This means that all formulae marked as 'fails_with_llvm' will no longer compile. There are currently 86 such formulae in homebrew.
Clang 3.0 will also become the default compiler on Xcode 4.2, with LLVM-GCC being downgraded to 'legacy' compiler. It's safe to assume LLVM will also be removed on a later Xcode release, so it might be interesting to consider using Clang as the default compiler for homebrew if Xcode 4.2 is installed.
The text was updated successfully, but these errors were encountered: