– we create awesome web applications

There seems to be quite a few issues with Homebrew compilation after upgrade to Yosemite.

While some of them are easily fixed by upgrading relevant GCC packages, one problem kept me from upgrading my macvim for a while.

Short version: if after upgrading all the gcc related packages you still get errors on Yosemite, try upgrading python as well.

Compiling macvim produced the following error:

✗ brew upgrade macvim                                                                                                                                                                             ruby-2.1.2
==> Upgrading 1 outdated package, with result:
macvim 7.4-73_1
==> Upgrading macvim
==> Downloading https://github.com/b4winckler/macvim/archive/snapshot-73.tar.gz
Already downloaded: /Library/Caches/Homebrew/macvim-7.4-73.tar.gz
==> ./configure --with-features=huge --enable-multibyte --with-macarchs=x86_64 --enable-perlinterp --enable-rubyinterp --enable-tclinterp --with-tlib=ncurses --with-compiledby=Homebrew --with-local-dir=/usr/l
checking for gcc... clang
checking whether the C compiler works... no
configure: error: in `/private/tmp/macvim-YQsceV/macvim-snapshot-73/src':
configure: error: C compiler cannot create executables
See `config.log' for more details

READ THIS: http://git.io/brew-troubleshooting

These open issues may also help:
macvim failed to build on 10.9 because of x11 (https://github.com/Homebrew/homebrew/issues/30253)

That issue #30253 turned out not to be relevant.

On the surface it looked like its a common yosemite gcc problem, but even after upgrading all to latest it didn't work.

Next I tried 'brew upgrade -v macvim'

✗ brew upgrade -v macvim
...
==> ENV
HOMEBREW_CC: clang
...
LDFLAGS: -L/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config -ldl -framework CoreFoundation -lpython2.7 -u _PyMac_Error Python.framework/Versions/2.7/Python
...
Error: macvim 7.4-73 did not build
Logs:
     /Users/vitaly/Library/Logs/Homebrew/macvim/01.configure
     /Users/vitaly/Library/Logs/Homebrew/macvim/01.configure.cc

Looking in the 01.configure.cc I found the following:

clang called with: -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -arch x86_64 -L/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config -ldl -framework CoreFoundation -lpython2.7 -u _PyMac_Error Python.framework/Versions/2.7/Python conftest.c
superenv executed: clang -pipe -Os -march=native -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -arch x86_64 -L/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config -ldl -framework CoreFoundation -lpython2.7 -u _PyMac_Error Python.framework/Versions/2.7/Python conftest.c -isystem/usr/local/include -isystem/usr/include/libxml2 -isystem/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers -L/usr/local/lib -L/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries -Wl,-headerpad_max_install_names

so I just created a very simple foo.c file and tried to compile it with the same gcc arguments:

✗ clang -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -arch x86_64 -L/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config -ldl -framework CoreFoundation -lpython2.7 -u _PyMac_Error Python.framework/Versions/2.7/Python foo.c
clang: error: no such file or directory: 'Python.framework/Versions/2.7/Python'

Note the Python.framework/Versions/2.7/Python part. it seems to be relative and not the full path. Digging a bit on the internet python turned out to be the problem.

After removing and re-installing python all turned out to work. The same part 01.configure.cc after python upgrade:

clang called with: -I/usr/local/Cellar/python/2.7.8_2/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/usr/local/Cellar/python/2.7.8_2/Frameworks/Python.framework/Versions/2.7/include/python2.7 -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -L/usr/local/Cellar/python/2.7.8_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config -ldl -framework CoreFoundation -lpython2.7 conftest.c
superenv executed: clang -pipe -Os -march=native -I/usr/local/Cellar/python/2.7.8_2/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/usr/local/Cellar/python/2.7.8_2/Frameworks/Python.framework/Versions/2.7/include/python2.7 -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -L/usr/local/Cellar/python/2.7.8_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config -ldl -framework CoreFoundation -lpython2.7 conftest.c -isystem/usr/local/include -isystem/usr/include/libxml2 -isystem/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers -L/usr/local/lib -L/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries -Wl,-headerpad_max_install_names

Have fun!