Fail to build gem native extension on Mac OS X

962 views
Skip to first unread message

Steve Madsen

unread,
Jul 3, 2013, 9:11:49 AM7/3/13
to capybar...@googlegroups.com
I just updated to Ruby 2.0.0-p247 through rbenv and in the process of reinstalling all of a project's gems, cabybara-webkit is failing to build its native extension. The build failure looks like the same one that came up a couple of weeks ago.

g++ -c -include webkit_server -pipe -O2 -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -Wall -W -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Cellar/qt/4.8.4/mkspecs/macx-g++ -I. -I/usr/local/Cellar/qt/4.8.4/lib/QtCore.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.4/lib/QtCore.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.4/lib/QtNetwork.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.4/lib/QtNetwork.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.4/lib/QtGui.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.4/lib/QtGui.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.4/lib/QtWebKit.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.4/lib/QtWebKit.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.4/include -I. -F/usr/local/Cellar/qt/4.8.4/lib -o Version.o Version.cpp
error: unable to read PCH file webkit_server.gch: 'Is a directory'
make[1]: *** [Version.o] Error 1
make: *** [sub-src-webkit_server-pro-make_default-ordered] Error 2
Command 'make' failed

Mac OS X 10.8.4
Xcode 4.6.3 (command line tools are installed)
Qt 4.8.4 from Homebrew (bottle)
Ruby 2.0.0-p247

The biggest change I can think of since the last time I built this gem is that I have a copy of Xcode 5 DP installed on this system. Without completely breaking my NDA, Xcode 5 changes some things related to how the command line tools are managed. While gcc and g++ still find the old version of the tools, clang runs the newer version of the compiler.

$ g++ -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
Target: x86_64-apple-darwin12.4.0
Thread model: posix
$ clang -v
Apple LLVM version 5.0 (clang-500.1.61) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin12.4.0
Thread model: posix

I have a Qt 4.8.0 still installed (also through Homebrew), but otherwise no other versions. I'm reluctant to uninstall it, as that'll break my working gem under the older version of Ruby.

Removing Xcode 5 DP doesn't solve the issue, as it doesn't clean up the changes it made to the command line tools.

I realize this is somewhat pre-release stuff, but Xcode 5 is coming this fall and if there are incompatibilities with it and how capybara-webkit builds the native extension, perhaps it's better to fix it before the masses install it.

Joe Ferris

unread,
Jul 3, 2013, 9:41:41 AM7/3/13
to capybar...@googlegroups.com
Hey Steve,

I don't know enough about this stuff to make a good guess, and I won't be able to test on XCode 5 for a while.

My best suggestion is to try installing the official Qt packages (http://qt-project.org/downloads/) and try using actual gcc to compile instead of LLVM.

-Joe
--
You received this message because you are subscribed to the Google Groups "capybara-webkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capybara-webk...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Steve Madsen

unread,
Jul 3, 2013, 12:11:39 PM7/3/13
to capybar...@googlegroups.com
I tried installing the official Qt packages and that didn't help. Apple has made it quite difficult to get to the real GCC in recent years, but I'll see if I can get it through Homebrew.

I wouldn't have expected Xcode 5 DP to make such a mess of things. I've reported a bug to Apple, but the damage is already done here.

Steve Madsen

unread,
Jul 3, 2013, 3:43:38 PM7/3/13
to capybar...@googlegroups.com
For anyone else that runs into this problem, I have found a workaround of sorts.

Near the bottom of http://www.cocoanetics.com/2012/07/you-dont-need-the-xcode-command-line-tools/, the author mentions that older versions of the command line tools DMG are often found in ~/Library/Caches/com.apple.dt.Xcode/Downloads. Sure enough, there was one in there ending with 2013.4 that seemed to be about right for a recent point update to Xcode, prior to Xcode 5 DP's availability.

I reinstalled the .mpkg within and capybara-webkit successfully built the native extension.

This complicates my ability to do any work in Apple's new tools, but that seems an acceptable price to pay for a working Ruby environment.


On Wednesday, July 3, 2013 9:41:41 AM UTC-4, Joe Ferris wrote:
Reply all
Reply to author
Forward
0 new messages