Homebrew / legacy-homebrew

💀 The former home of Homebrew/homebrew (deprecated)
https://brew.sh
26.99k stars 11.36k forks source link

Mercurial 3.1.1 Build Failure. #32083

Closed DomT4 closed 10 years ago

DomT4 commented 10 years ago

Ugh, This problem is back. I wonder if DP7 of Yosemite caused this issue, because Homebrew was working swimmingly prior to the update. Anyone else on 10.9 or 10.10 DP7 seeing this issue, or has my local setup screwed itself up again for some reason?

➜  ~  brew upgrade
==> Upgrading 1 outdated package, with result:
mercurial 3.1.1
==> Upgrading mercurial
==> Downloading http://mercurial.selenic.com/release/mercurial-3.1.1.tar.gz
Already downloaded: /Library/Caches/Homebrew/mercurial-3.1.1.tar.gz
==> make PREFIX=/usr/local/Cellar/mercurial/3.1.1 install-bin
clang -bundle -undefined dynamic_lookup -Wl,-F. -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.Internal.sdk/System/Library/PrivateFrameworks -framework CrashReporterSupport build/temp.macosx-10.10-intel-2.7/mercurial/base85.o -o build/lib.macosx-10.10-intel-2.7/mercurial/base85.so
ld: framework not found CrashReporterSupport
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 1
make: *** [build] Error 1

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

Error: Class is not a module
Please report this bug:
    https://github.com/Homebrew/homebrew/wiki/troubleshooting
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:390:in `<class:HTTP>'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:384:in `<module:Net>'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:25:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/https.rb:21:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/Library/Homebrew/utils.rb:308:in `open'
/usr/local/Library/Homebrew/utils.rb:350:in `issues_matching'
/usr/local/Library/Homebrew/utils.rb:378:in `issues_for_formula'
/usr/local/Library/Homebrew/exceptions.rb:162:in `fetch_issues'
/usr/local/Library/Homebrew/exceptions.rb:158:in `issues'
/usr/local/Library/Homebrew/exceptions.rb:197:in `dump'
/usr/local/Library/Homebrew/cmd/upgrade.rb:87:in `rescue in upgrade_formula'
/usr/local/Library/Homebrew/cmd/upgrade.rb:95:in `upgrade_formula'
/usr/local/Library/Homebrew/cmd/upgrade.rb:43:in `block in upgrade'
/usr/local/Library/Homebrew/cmd/upgrade.rb:43:in `each'
/usr/local/Library/Homebrew/cmd/upgrade.rb:43:in `upgrade'
/usr/local/Library/brew.rb:131:in `<main>'
➜  ~  brew config
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew
HEAD: e46f2be2eba763dbe60856295a953b87376e24df
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit ivybridge
OS X: 10.10-x86_64
Xcode: 6.0 => /Applications/Xcode6-Beta7.app/Contents/Developer
CLT: 6.0.0.0.1.1404410606
Clang: 6.0 build 600
X11: 2.7.7 => /opt/X11
System Ruby: 2.0.0-481
Perl: /usr/bin/perl
Python: /usr/local/bin/python => /usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/bin/python2.7
Ruby: /usr/local/bin/ruby => /usr/local/Cellar/ruby/2.1.2_3/bin/ruby
jacknagel commented 10 years ago

Note that "class is not a module" is a ruby error that is unrelated to the actual build error, which is:

==> make PREFIX=/usr/local/Cellar/mercurial/3.1.1 install-bin
clang -bundle -undefined dynamic_lookup -Wl,-F. -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.Internal.sdk/System/Library/PrivateFrameworks -framework CrashReporterSupport build/temp.macosx-10.10-intel-2.7/mercurial/base85.o -o build/lib.macosx-10.10-intel-2.7/mercurial/base85.so
ld: framework not found CrashReporterSupport
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 1

as for "class is not a module", there is a constant name conflict happening somewhere between Homebrew and the ruby stdlib, but I haven't tracked it down yet. You can safely ignore it, as it only happens when a real build error occurs.

mistydemeo commented 10 years ago

Can you post the outputs of:

python-config --includes
python-config --libs
python-config --cflags
python-config --ldflags
mistydemeo commented 10 years ago

I'm guessing this is "Some python modules may fail to install." issue reported by Apple - python-config probably recorded and is passing internal debug build flags.

DomT4 commented 10 years ago
➜  ~  python-config --includes
-I/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/include/python2.7
➜  ~  python-config --libs
-ldl -framework CoreFoundation -lpython2.7
➜  ~ python-config --cflags
-I/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/usr/local/Cellar/python/2.7.8_1/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
➜  ~  python-config --ldflags
-L/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config -ldl -framework CoreFoundation -lpython2.7
DomT4 commented 10 years ago

@jacknagel Thanks for the clarification. I won't fret too much over that part then, and I'll rename the issue to reflect the build error.

mistydemeo commented 10 years ago

Oh, sorry - could you redo the python-config outputs with /usr/bin/python-config? You have a Homebrew python first in your PATH but that's not what mercurial was building against.

DomT4 commented 10 years ago

Oh sure.

➜  ~  /usr/bin/python-config --includes
-I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
➜  ~  /usr/bin/python-config --libs
-ldl -framework CoreFoundation -lpython2.7
➜  ~  /usr/bin/python-config --cflags
-I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.Internal.sdk/System/Library/PrivateFrameworks -framework CrashReporterSupport -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE
➜  ~  /usr/bin/python-config --ldflags
-L/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config -ldl -framework CoreFoundation -lpython2.7
mistydemeo commented 10 years ago

Yep, the bad flags are coming from --cflags.

Since Apple mentions this as a known issue, I'd expect it to be fixed in the next preview build.

jacknagel commented 10 years ago

Can we fold this and any others with the same root cause into a single issue? Maybe just track it in the 10.10 thread?

DomT4 commented 10 years ago

@mistydemeo Thanks! I'll just build it against the Homebrew-supplied Python for now then. Should tie me over till Apple ship a fix.

@jacknagel Yeah, I'll close this and link back to it in my big 10.10 thread.

jonbuffington commented 10 years ago

@DomT4 I have not been able to build against my brew install python (2.7). brew install mercurial is using the system python even though which python returns /usr/local/bin/python. Can you share your steps/recipe?

mmack commented 10 years ago

I have the same problem. Please share your solution :)

DomT4 commented 10 years ago

Oh, the way Homebrew works is that even if something is ahead of an alternative in your $PATH Homebrew won't touch any other formula installed via Homebrew unless there's a specific dependency added.

Depending on whether you prefer Vim or Nano, you can either do brew edit mercurial and then add depends_on 'python' before def install or you can do nano /usr/local/library/formula/mercurial.rb and make the same change.

screen shot 2014-09-04 at 15 56 48

MikeMcQuaid commented 10 years ago

brew install mercurial is using the system python even though which python returns /usr/local/bin/python

This is intentional. pip install it instead if you wish to use it that way.