Skip to content
This repository has been archived by the owner. It is now read-only.

brew install serf failed on OS X Mavericks #20405

Closed
huahang opened this Issue Jun 11, 2013 · 37 comments

Comments

Projects
None yet
@huahang
Copy link
Contributor

huahang commented Jun 11, 2013

$ brew --config
HOMEBREW_VERSION: 0.9.4
ORIGIN: https://github.com/mxcl/homebrew
HEAD: 231a297
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: 8-core 64-bit ivybridge
OS X: 10.9-x86_64
Xcode: 5.0 => /Applications/Xcode5-DP.app/Contents/Developer
LLVM-GCC: build 0
Clang: 5.0 build 500
X11: 2.7.4 => /opt/X11
System Ruby: 1.8.7-358
Perl: /usr/bin/perl
Python: /usr/local/bin/python => /usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/bin/python2.7
Ruby: /usr/local/var/rbenv/shims/ruby

@samueljohn

This comment has been minimized.

Copy link
Contributor

samueljohn commented Jun 11, 2013

Sorry, but right now, no core dev has got an Apple Developer account (as far as I know), so can't really be helpful right now 😿

@MikeMcQuaid

This comment has been minimized.

Copy link
Member

MikeMcQuaid commented Jun 11, 2013

If you pay for one we'll fix it.

EDIT: someone did so we're working on it.

@clemensg

This comment has been minimized.

Copy link
Contributor

clemensg commented Jun 11, 2013

I am still on Mountain Lion, but I have the newest XCode 5 with Clang 5.0 installed and subversion builds fine with it. @huahang Could you please post a gist with the output of brew install subversion -v ?

@clemensg

This comment has been minimized.

Copy link
Contributor

clemensg commented Jun 11, 2013

@huahang: I just installed subversion on my OSX Mavericks machine without any problems. Maybe you are experiencing the same problem as in issue #13226 ? Does it build when you try it a second time?

@huahang

This comment has been minimized.

Copy link
Contributor Author

huahang commented Jun 11, 2013

@clemensg
I upgraded from Mountain Lion and I got the the error when I do "brew upgrade". I checked carefully and I think it is a dependency (serf) of subversion that fails build rather than subversion itself. My error here is not the same as #13226. The error I got when "brew upgrade -v" is posted in gist here:
https://gist.github.com/huahang/5756956

@mistydemeo

This comment has been minimized.

Copy link
Member

mistydemeo commented Jun 11, 2013

The error from Homebrew came after the build itself failed, so that's incidental. (It should also be a warning...)

Your actual error is:

./configure: line 1494: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bin/cc: No such file or directory
@clemensg

This comment has been minimized.

Copy link
Contributor

clemensg commented Jun 11, 2013

Looks like it has something to do with the apache portable runtime (apr).

https://github.com/Homebrew/homebrew-apache

(...) This is because the OS X tool apr-1-config returns a path for a compiler that does not exist, even with Xcode installed (...)

Executing the following resolves the problem, but sudo is needed :-/

[ "$(sw_vers -productVersion | sed 's/^\(10\.[0-9]\).*/\1/')" = "10.9" ] && bash -c "[ -d /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain ] && sudo bash -c 'cd /Applications/Xcode.app/Contents/Developer/Toolchains/ && ln -vs XcodeDefault.xctoolchain OSX10.9.xctoolchain' || sudo bash -c 'mkdir -vp /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr && cd /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr && ln -vs /usr/bin'"

Maybe a fixed apr-1-config is necessary?

@clemensg

This comment has been minimized.

Copy link
Contributor

clemensg commented Jun 11, 2013

Please change the title to "brew install serf failed..."

@roderik

This comment has been minimized.

Copy link
Contributor

roderik commented Jun 11, 2013

@MikeMcQuaid if it helps getting home-brew to run on mavericks smoothly, i can hook you up with an invite for our test account.

@mistydemeo

This comment has been minimized.

Copy link
Member

mistydemeo commented Jun 11, 2013

Looks like it has something to do with the apache portable runtime (apr).

No, it actually looks like a problem with your compiler, which is either a result of the Xcode SDK not being as we expect, or the compiler not being as we expect.

@mistydemeo

This comment has been minimized.

Copy link
Member

mistydemeo commented Jun 11, 2013

Er, of course I could have read that link.

Following those instructions isn't really a good solution since it modifies your SDK instead of fixing the problem more generally.

Maybe we should just bring the apr dupe into homebrew if the system one is broken.

@clemensg

This comment has been minimized.

Copy link
Contributor

clemensg commented Jun 11, 2013

This seems to be a known problem for 10.8:

The problem seems to be that configure is calling apr-1-config --cpp and that is returning the invalid toolchain path. That's is not a serf problem. That's an OSX bug.
The easy solution for us is to define the CPP environment variable for configure to be #{ENV.cc} -E

See: #13586 and #13891

@clemensg

This comment has been minimized.

Copy link
Contributor

clemensg commented Jun 11, 2013

Somebody must have removed the fix. It was already there: snakeyroc3@3b72e17

@clemensg

This comment has been minimized.

Copy link
Contributor

clemensg commented Jun 13, 2013

This should be fixed by #20474

@jacknagel

This comment has been minimized.

Copy link
Contributor

jacknagel commented Jun 13, 2013

Presuming fixed by 3baaa6b

@jacknagel jacknagel closed this Jun 13, 2013

@ivucica

This comment has been minimized.

Copy link

ivucica commented Oct 6, 2013

On Mavericks GM, there is no /usr/include/apr-1.

While I have /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/ along with an assortment of toolchain executables and libraries, inside of it there is no usr/include/apr-1. I end up getting this:

[ivucica@The-Magnificent-MacBook:~]$ brew install serf
==> Downloading http://serf.googlecode.com/files/serf-1.3.1.tar.bz2
Already downloaded: /Library/Caches/Homebrew/serf-1.3.1.tar.bz2
==> Patching
patching file SConstruct
==> scons PREFIX=/usr/local/Cellar/serf/1.3.1 GSSAPI=/usr
#include <apr_pools.h>
         ^
1 error generated.
scons: *** [context.o] Error 1
scons: building terminated because of errors.

READ THIS: https://github.com/mxcl/homebrew/wiki/troubleshooting

These open issues may also help:
    https://github.com/mxcl/homebrew/pull/21449

Output of apr-1-config --cpp:

[ivucica@The-Magnificent-MacBook:~]$ apr-1-config --cpp
/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bin/cc -E

I still have Xcode 5, the public release for Mountain Lion, in case that might be an issue.

@mistydemeo

This comment has been minimized.

Copy link
Member

mistydemeo commented Oct 6, 2013

There are known issues with Xcode 5 and 10.9, since Xcode 5 is missing the 10.9 SDK. You'll need to upgrade to Xcode 5.0.1.

@ivucica

This comment has been minimized.

Copy link

ivucica commented Oct 10, 2013

Thanks! Having switched to Xcode 5.0.1, the issue has NOT been resolved.

There is still nothing in /usr/include - presumably the new approach Apple is taking is not putting things into "standard" locations.

Alright, so maybe at least apr-1-config got miraculously patched when I started up Xcode 5.0.1? Sadly, nope:

[ivucica@themagntmacbook:~]$ which apr-1-config
/usr/bin/apr-1-config
[ivucica@themagntmacbook:~]$ apr-1-config --cpp
/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bin/cc -E
[ivucica@themagntmacbook:~]$ ls /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bin/
ls: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bin/: No such file or directory
[ivucica@themagntmacbook:~]$ ls /Applications/Xcode.app/Contents/Developer/Toolchains/
XcodeDefault.xctoolchain
[ivucica@themagntmacbook:~]$ ls /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/
FlexLexer.h

Indeed, the required file is inside the 10.9 SDK. We can find apr_pools.h inside, but that doesn't help with building serf:

[ivucica@themagntmacbook:~]$ ls /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/apr-1/apr_pools.h 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/apr-1/apr_pools.h
[ivucica@themagntmacbook:~]$ brew install serf
==> Downloading http://serf.googlecode.com/files/serf-1.3.1.tar.bz2
Already downloaded: /Library/Caches/Homebrew/serf-1.3.1.tar.bz2
==> Patching
patching file SConstruct
==> scons PREFIX=/usr/local/Cellar/serf/1.3.1 GSSAPI=/usr
#include <apr_pools.h>
         ^
1 error generated.
scons: *** [context.o] Error 1
scons: building terminated because of errors.
READ THIS: https://github.com/mxcl/homebrew/wiki/troubleshooting
These open issues may also help:
    https://github.com/mxcl/homebrew/pull/21449

(Edited comment to remove mention of what is a non-issue.)

@ivucica

This comment has been minimized.

Copy link

ivucica commented Oct 10, 2013

Small post here: http://blog.vucica.net/2013/10/apr-1-config-broken-under-mavericks.html

I'm doing the Bad Thing(tm) and patching paths mentioned in /usr/bin/apr-1-config. That got me through installing serf. Changes I made:

-prefix="/usr"
+prefix="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr"
-CC="/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bin/cc"
-CPP="/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bin/cc -E"
+CC="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc"
+CPP="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -E"

I find it peculiar and possibly relevant that (IIRC) Xcode didn't ask me to install command line tools nor can I install them from Downloads. Perhaps I just need to install Command Line Tools from the .dmg to properly populate /usr, /usr/include et al. I'll post my findings.

@mistydemeo

This comment has been minimized.

Copy link
Member

mistydemeo commented Oct 10, 2013

I wonder why the superenv apr-1-config fix isn't working. We do provide a wrapper that's meant to fix this.

@ivucica

This comment has been minimized.

Copy link

ivucica commented Oct 11, 2013

Being unfamiliar with inner workings of brew, could you advise me on how to help figure that out? I am especially unfamiliar with superenv and where to look for this fix.

If the relevant file is /usr/local/Library/ENV/4.3/apr-1-config, I would suspect the issue is that the value of $HOMEBREW_CCCFG does not contain character a. It would probably be helpful if you could explain where this variable is being set, what the "a" character in it means and what this variable itself means.

Thanks for all the hard work on brew!

@mistydemeo

This comment has been minimized.

Copy link
Member

mistydemeo commented Oct 11, 2013

That value is always set on 10.8 and newer - see 3baaa6b (from earlier in this issue)

@mistydemeo

This comment has been minimized.

Copy link
Member

mistydemeo commented Oct 11, 2013

Is it possible serf is executing the real apr-1-config instead of our shim?

@mistydemeo

This comment has been minimized.

Copy link
Member

mistydemeo commented Oct 11, 2013

Looking at the build earlier:

APR_CONFIG='/usr/local/Library/ENV/4.3/apr-1-config'

So it is using the shim. Does the shim return usable values if HOMEBREW_CCCFG is set appropriately?

@ivucica

This comment has been minimized.

Copy link

ivucica commented Oct 11, 2013

This is what I get:

[ivucica@The-Magnificent-MacBook:local]$ /usr/local/Library/ENV/4.3/apr-1-config --cc
/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bin/cc
[ivucica@The-Magnificent-MacBook:local]$ HOMEBREW_CCCFG=a /usr/local/Library/ENV/4.3/apr-1-config --cc
cc

Having edited the shim by adding the following

echo "$HOMEBREW_CCCFG => $0 $1" > /tmp/hb.txt

and running brew uninstall serf && brew install serf, I did not find the /tmp/hb.txt file. So I would suspect it is NOT being used, at least on my machine.

@mistydemeo

This comment has been minimized.

Copy link
Member

mistydemeo commented Oct 11, 2013

Can you please post the full build logs for a failed serf build?

@fengyie007

This comment has been minimized.

Copy link

fengyie007 commented Oct 12, 2013

@ivucica did you install the command_line_tools_os_x_mavericks ?

@fengyie007

This comment has been minimized.

Copy link

fengyie007 commented Oct 12, 2013

/usr/include is generated by command_line_tools_os_x_mavericks.

@ivucica

This comment has been minimized.

Copy link

ivucica commented Oct 14, 2013

@mistydemeo Build logs:

[ivucica@The-Magnificent-MacBook:serf]$ pwd
/Users/ivucica/Library/Logs/Homebrew/serf
[ivucica@The-Magnificent-MacBook:serf]$ cat config.log
file /private/tmp/serf-RI91/serf-1.3.1/SConstruct,line 387:
    Configure(confdir = .sconf_temp)
[ivucica@The-Magnificent-MacBook:serf]$ cat 01.scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
gcc -o context.o -c -std=c89 -Wdeclaration-after-statement -Wmissing-prototypes -Wall -O2 -dynamic -DNDEBUG -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -DSERF_HAVE_GSSAPI -I. -I/usr/include/apr-1 -I/usr/include context.c
context.c:16:10: fatal error: 'apr_pools.h' file not found
#include <apr_pools.h>
         ^
1 error generated.
scons: *** [context.o] Error 1
scons: building terminated because of errors.
HOMEBREW_VERSION: 0.9.5
HEAD: d814765ada217dbefc36ee42abe62a8bd57a9041
CPU: dual-core 64-bit penryn
OS X: 10.9-x86_64
Xcode: 5.0.1
MacPorts/Fink: /opt/local/bin/port, /sw/bin/fink
X11: 2.7.4 => /opt/X11

@fengyie007 Thanks for the information! It's interesting that Apple opted to remove the integrated option to install Command Line Tools from Xcode 5. I've grabbed the .dmg and will report back after installing the tools.

@streeter

This comment has been minimized.

Copy link
Contributor

streeter commented Oct 20, 2013

I was getting the same error, and after downloading the Mavericks Command Line Tools (I don't think an ADA is required) and installing them, the upgrade went smoothly.

@tholu

This comment has been minimized.

Copy link

tholu commented Oct 23, 2013

Can confirm, downloading and installing Mavericks Command Line Tools fixed brew install serf for me as well.

@MentalPower

This comment has been minimized.

Copy link
Contributor

MentalPower commented Oct 23, 2013

+1 on the Mavericks Command Line Tools fix, may want to add this to brew doctor.

@ivucica

This comment has been minimized.

Copy link

ivucica commented Oct 23, 2013

Finally got around to installing Command Line Tools. That was it.

@getninjaN

This comment has been minimized.

Copy link

getninjaN commented Oct 24, 2013

"xcode-select --install" in the terminal did the trick. Thanks.

@patbos

This comment has been minimized.

Copy link

patbos commented Oct 26, 2013

Can also confirm "xcode-select --install" did the trick

@oddlyzen

This comment has been minimized.

Copy link

oddlyzen commented Oct 30, 2013

Thanks for this thread. It got me over the hump and now all is well in brewland. Cheers! 😄

@genuinefafa

This comment has been minimized.

Copy link

genuinefafa commented Jul 13, 2014

"xcode-select --install" asks for the Command Line Tools, if you agree, it installs and then no APR error is found. I dont really understand why it didn't get installed by xCode.
ps: this link is a good step-by-step to do that

@Homebrew Homebrew locked and limited conversation to collaborators Jul 14, 2014

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.