Skip to content


Subversion checkout URL

You can clone with
Download ZIP


brew install postgresql fails during link step in Mac OS (10.7.4) with XCode 4.3.3 #13044

mscottford opened this Issue · 15 comments

9 participants


I've posted the verbose output of running brew install postgresql to a gist.

brew is suggesting that #11759 might be helpful, but none of the solutions there have helped. I've already tried the following.

  • running brew install --use-gcc postgresql
  • running brew install --use-clang postgresql
  • running brew install --use-llvm postgresql
  • running CC=/usr/bin/gcc-4.2 brew install postgresql
  • running export CC=/usr/bin/gcc-4.2 && brew install postgresql
  • running brew install postgresql --32-bit
  • running brew install postgresql --without-ossp-uuid
  • running brew install postgresql --no-python
  • running PYTHON=/usr/local/bin/python brew install postgresql

I've noticed that postgreqsl 9.0.4 is already installed on the system, but many of the commands that I'd expect to be there are missing, such as initdb and pg_ctl, so I don't want to use that version.

I suspect that the issue I'm encountering is caused by libraries from the system version of postgresql are being linked against, but I'm not sure how to test this.

Running brew doctor results in Your system is raring to brew..


+1 Real headache.


Me too. Also with 4.3.2


Does #13037 help you?
So, cd /usr/local
git checkout -b test
brew pull 13037
Revert by git checkout master.


Thanks! It worked like a charm


Ok just don't forget to revert once that fix is in homebrew. Otherwise brew update might show git conflicts.


thanks man! worked for me! my env is below

CPU: quad-core 64-bit sandybridge
OS X: 10.7.4-x86_64
Xcode: 4.3.3


+1 for #13037
Postgres installed like a dream.


@samueljohn That fixed the problem. Thanks a bunch.

@mscottford mscottford closed this
fj commented

Thanks, @samueljohn -- this unblocked two of our new developers, each of whom lost a day to workstation setup that should have taken a couple of hours instead. If you're ever in Charlottesville, VA, let me know so I can buy you lunch!


@fj ... will you punch me in the face when I tell you that is was (partly) my fault the issue occurred in the first place?

I committed a change which added the OS X SDK-root from Xcode to the "-L" flags in order to support Xcode-only setups because Apple does not ship their OS with the SDK anymore. The assumption that the SDK in the Xcode and in the "Command Line Tools" are identical seems not to hold but 99% of the formulae are fine with this. However, due to unknown reasons postgresql and valgrind (and poppler and zookeeper) fail to build. I feel so sorry that your devs lost two days and felt like homebrew is broken. The opposite was my intention - make Homebrew work out of the box. I think a buildbot (and automated tests) could have prevented this - but we have no.

fj commented

@samueljohn Automated tests and a buildbot would be nice. Homebrew is definitely beyond the minimal complexity needed to make CI worthwhile, especially with the (I'm sure) vast array of potential configurations it might have to support.

This is probably something that's worth talking about with the other major contributors, but you guys could pretty easily raise some funds to support a hosted OSX instance and run per-commit continuous integration, especially with all the time and money that Homebrew saves teams.


Thanks it works! Love you! Works :)


Hi! I tried that and get the following errors:

afriappsmini:local afriapps$ brew pull 13037
######################################################################## 100,0%
==> Applying patch
Applying: Fix #13012 properly and don't set the SDK if CLT
error: patch failed: Library/Homebrew/cmd/doctor.rb:210
error: Library/Homebrew/cmd/doctor.rb: patch does not apply
error: patch failed: Library/Homebrew/extend/ENV.rb:231
error: Library/Homebrew/extend/ENV.rb: patch does not apply
error: patch failed: Library/Homebrew/utils.rb:298
error: Library/Homebrew/utils.rb: patch does not apply
Patch failed at 0001 Fix #13012 properly and don't set the SDK if CLT
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".
Error: Failure while executing: git am --signoff --whitespace=fix /Library/Caches/Homebrew/13037.patch

Any ideas?


@afriapps The #13037 has long been pulled and is alrady in homebrew, therefore applying it now again fails.
Type the suggested git am --abort (to abort this patching) in your brew --prefix directory.

You should brew update. If that is now failing due to git mess up, do git reset --hard HEAD (considering this will remove all changes you did to homebrew source.)

If you have an issue with postgres, then check the FAQ for what we need to know when you open a new issue.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.