2
votes

I recently upgraded from snow leopard to lion. I've got the latest version of Homebrew running (e.g. I ran 'brew update'). I'm trying to install mysql but I get the error below.

Googling for how to fix this has turned up nothing...

$ brew install mysql
==> Downloading http://downloads.mysql.com/archives/mysql-5.5/mysql-5.5.19.tar.gz
File already downloaded in /Users/evan/Library/Caches/Homebrew
==> Patching
patching file scripts/mysqld_safe.sh
patching file scripts/mysql_config.sh
==> cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/mysql/5.5.19 -DMYSQL_DATADIR=/usr/local/var/mysql -DINSTALL_MANDIR=/usr/local/C
==> make
Scanning dependencies of target INFO_BIN
Scanning dependencies of target INFO_SRC
Scanning dependencies of target abi_check
[  0%] Built target INFO_SRC
Scanning dependencies of target readline
1,240d0

[ ---- I've truncated the source dump ---- ]

CMake Error at cmake/do_abi_check.cmake:78 (MESSAGE):
  ABI check found difference between
  /tmp/homebrew-mysql-5.5.19-mGpc/mysql-5.5.19/include/mysql/plugin_audit.h.pp
  and /tmp/homebrew-mysql-5.5.19-mGpc/mysql-5.5.19/abi_check.out


Scanning dependencies of target gen_lex_hash
make[2]: *** [CMakeFiles/abi_check] Error 1
make[1]: *** [CMakeFiles/abi_check.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[  1%] [  2%] [  2%] Building C object cmd-line-utils/readline/CMakeFiles/readline.dir/readline.c.o
Building C object cmd-line-utils/readline/CMakeFiles/readline.dir/funmap.c.o
Building CXX object sql/CMakeFiles/gen_lex_hash.dir/gen_lex_hash.cc.o
[  2%] Built target INFO_BIN
[  2%] Building C object cmd-line-utils/readline/CMakeFiles/readline.dir/keymaps.c.o
[  2%] Building C object cmd-line-utils/readline/CMakeFiles/readline.dir/vi_mode.c.o
[  2%] Building C object cmd-line-utils/readline/CMakeFiles/readline.dir/parens.c.o
[  2%] [  3%] Building C object cmd-line-utils/readline/CMakeFiles/readline.dir/rltty.c.o
Building C object cmd-line-utils/readline/CMakeFiles/readline.dir/complete.c.o
Linking CXX executable gen_lex_hash
[  3%] Built target gen_lex_hash
[  3%] Building C object cmd-line-utils/readline/CMakeFiles/readline.dir/bind.c.o
[  3%] Building C object cmd-line-utils/readline/CMakeFiles/readline.dir/isearch.c.o
[  3%] Building C object cmd-line-utils/readline/CMakeFiles/readline.dir/display.c.o
[  3%] Building C object cmd-line-utils/readline/CMakeFiles/readline.dir/signals.c.o
[  3%] [  4%] Building C object cmd-line-utils/readline/CMakeFiles/readline.dir/kill.c.o
Building C object cmd-line-utils/readline/CMakeFiles/readline.dir/util.c.o
[  4%] Building C object cmd-line-utils/readline/CMakeFiles/readline.dir/undo.c.o
[  4%] Building C object cmd-line-utils/readline/CMakeFiles/readline.dir/macro.c.o
[  4%] Building C object cmd-line-utils/readline/CMakeFiles/readline.dir/input.c.o
[  4%] Building C object cmd-line-utils/readline/CMakeFiles/readline.dir/callback.c.o
[  4%] Building C object cmd-line-utils/readline/CMakeFiles/readline.dir/terminal.c.o
[  4%] Building C object cmd-line-utils/readline/CMakeFiles/readline.dir/xmalloc.c.o
[  5%] Building C object cmd-line-utils/readline/CMakeFiles/readline.dir/history.c.o
[  5%] Building C object cmd-line-utils/readline/CMakeFiles/readline.dir/histsearch.c.o
[  5%] Building C object cmd-line-utils/readline/CMakeFiles/readline.dir/histexpand.c.o
[  5%] Building C object cmd-line-utils/readline/CMakeFiles/readline.dir/histfile.c.o
[  5%] Building C object cmd-line-utils/readline/CMakeFiles/readline.dir/nls.c.o
[  5%] Building C object cmd-line-utils/readline/CMakeFiles/readline.dir/search.c.o
[  6%] Building C object cmd-line-utils/readline/CMakeFiles/readline.dir/shell.c.o
[  6%] Building C object cmd-line-utils/readline/CMakeFiles/readline.dir/tilde.c.o
[  6%] Building C object cmd-line-utils/readline/CMakeFiles/readline.dir/misc.c.o
[  6%] Building C object cmd-line-utils/readline/CMakeFiles/readline.dir/text.c.o
[  6%] Building C object cmd-line-utils/readline/CMakeFiles/readline.dir/mbutil.c.o
[  6%] Building C object cmd-line-utils/readline/CMakeFiles/readline.dir/compat.c.o
[  7%] Building C object cmd-line-utils/readline/CMakeFiles/readline.dir/savestring.c.o
Linking C static library libreadline.a
[  7%] Built target readline
make: *** [all] Error 2
==> Exit Status: 2
http://github.com/mxcl/homebrew/blob/master/Library/Formula/mysql.rb#L75
==> Environment
HOMEBREW_VERSION: 0.8.1
HEAD: 0e8ea8aae9dadda53d0dc0cf680d383981770be9
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
Hardware: quad-core 64-bit arrandale
OS X: 10.7.3
Kernel Architecture: x86_64
Xcode: 3.2.6
GCC-4.0: N/A
GCC-4.2: N/A
LLVM: build 2336
Clang: 3.1 build 318
MacPorts or Fink? false
X11: /usr/X11
System Ruby: 1.8.7-249
/usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Which Perl:   /usr/bin/perl
Which Python: /usr/bin/python
Which Ruby:   /Users/evan/.rvm/rubies/ruby-1.9.3-p0/bin/ruby
==> Build Flags
CC: /usr/bin/xcrun gcc-4.2 => /Developer/usr/bin/gcc-4.2

CXX: /usr/bin/xcrun g++-4.2 => /Developer/usr/bin/g++-4.2

LD: /usr/bin/xcrun gcc-4.2 => /Developer/usr/bin/gcc-4.2

CFLAGS: -Os -w -pipe -march=core2 -msse4
CXXFLAGS: -Os -w -pipe -march=core2 -msse4
CPPFLAGS: -I/usr/local/Cellar/readline/6.2.2/include
LDFLAGS: -L/usr/local/Cellar/readline/6.2.2/lib
MAKEFLAGS: -j4

Error: Failed executing: make 

UPDATE

I think thinks may be related to conflicting versions of XCode. I've installed the latest version fo XCode, but homebrew still thinks I have the old version installed

Warning: You have Xcode-3.2.6, which is outdated.
Please install Xcode 4.3.

Attempting a fix....

2

2 Answers

5
votes

Alright I solved this bad boy. I'll leave this up to help anyone else who might have the same problem.

Steps to solve

  1. run "brew doctor" - begin fixing issues
  2. apparently I had several versions of XCode installed and it was using the old, 3.2 version
  3. Uninstalled the old XCode using only do this in the correct directory which could be different from mine

    sudo /Developer/Library/uninstall-devtools

  4. restart and run 'brew doctor' again

  5. Use the following command to assign the right XCode version (this may be different depending on your install)

    sudo xcode-select -switch /Applications/Xcode.app

And voila! I was able to use homebrew to install mysql

2
votes

This failed for me. What worked was:

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

which was suggested by brew doctor.