Homebrew / legacy-homebrew

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

`brew install weechat` fails #11835

Closed zmanji closed 12 years ago

zmanji commented 12 years ago

This is the output of brew doctor:

Warning: Setting DYLD_LIBRARY_PATH can break dynamic linking.
You should probably unset it.
Warning: /Library/Frameworks/Mono.framework detected
This can be picked up by CMake's build system and likely cause the build to
fail. You may need to move this file out of the way to compile CMake.

This is the output of brew install weechat -v can be seen at this gist.

2bits commented 12 years ago

https://github.com/mxcl/homebrew/wiki/Reporting-Bugs

adamv commented 12 years ago

What ruby do you have installed?

2bits commented 12 years ago

Thanks for adjusting your issue by making that gist. I just re-read that wiki page, and didn't realize it said all those things about mocking you. Don't take that too seriously. I figured out the real problem down below.

sindresorhus commented 12 years ago

I'm also having this problem. gist with required info (-v, config, doctor).

2bits commented 12 years ago

Thanks for the info. There were/are two issues:

  1. Broken formula crafts the args incorrectly.
  2. Homebrew python, not system python, contains a variable LINKFORSHARED that has an incomplete path:
$ python -c "from distutils.sysconfig import *; print(get_config_var('LINKFORSHARED'))"
-u _PyMac_Error Python.framework/Versions/2.7/Python

That command should have returned the full path into the cellar.

2bits commented 12 years ago

I have fixed the formula for weechat, and I will submit a pull request for it tomorrow. @sindresorhus You should probably fix those things that brew doctor mentioned. They aren't breaking weechat, but it's better if the doctor says you're raring to brew.

adamv commented 12 years ago

Is this only an issue against Framework Python?

zmanji commented 12 years ago

Since the problem I was having was related to the ruby module here is the other information requested. My $DYLD_LIBRARY_PATH has mysql set in it, I don't think it should effect how the ruby module is compiled.

Zameers-MacBook-Air:~ zmanji$ echo $DYLD_LIBRARY_PATH
/usr/local/mysql/lib:

My brew --config is located at this gist

Is there any other information that can help diagnose the problem?

2bits commented 12 years ago

@adamv The python issue only occurs when python is built as a framework. @zmanji We might have to adjust the formula to handle non-system Ruby if the admins say we support that. From what I've read in previous issues, Homebrew only runs correctly with the system Ruby, but let's let Adam explain that.

2bits commented 12 years ago

@zmanji will you please try out the formula that is linked above this post. You can do that a few different ways, but the easiest is probably

brew install -vd https://raw.github.com/2bits/homebrew/fixWeechat/Library/Formula/weechat.rb

but you could also visit the pull request 11859 and click Diff, View File, and Raw, then save that into /usr/local/Library/Formula/weechat.rb

zmanji commented 12 years ago

@2bits Without passing any arguments to the formula weechat compiles just fine. Enabling ruby support by using the --enable-ruby flag still fails.

2bits commented 12 years ago

@zmanji Thanks. Would you please run this and gist the output, thanks.

brew rm -f weechat
export VERBOSE=1
brew install -vd --enable-ruby https://raw.github.com/2bits/homebrew/fixWeechat/Library/Formula/weechat.rb
zmanji commented 12 years ago

The output is here.

2bits commented 12 years ago

@adamv Does the user have to move the system ruby into place when building software that links to Ruby? Or are they allowed to brew with Homebrew's Ruby and link to Homebrew's Ruby?

@zmanji Thanks. Can you gist this also if it exists:

/Users/zmanji/Library/Logs/Homebrew/CMakeChache.txt

There are a couple of variables in there that specify where it thinks Ruby is located.

zmanji commented 12 years ago

The file is here.

jacknagel commented 12 years ago

We allow the same flexibility with Ruby that we do with Python; the restriction that Homebrew itself uses the system Ruby is unrelated.

2bits commented 12 years ago

@jacknagel This looks strange doesn't it?

//Path to a program.
RUBY_EXECUTABLE:FILEPATH=/Users/zmanji/.rbenv/shims/ruby

//Path to a file.
RUBY_INCLUDE_PATH:PATH=/Library/Frameworks/MacRuby.framework/Headers

//Path to a library.
RUBY_LIBRARY:FILEPATH=/System/Library/Frameworks/ruby.framework

I'll have to figure out how to query Ruby for its environment. Any ideas?

zmanji commented 12 years ago

@2bits If you can't figure out the Ruby issue, could you at least submit the updated formula that actually disables plugin building by default?

2bits commented 12 years ago

That's exactly what my pull request 11859 does. You even said,

@2bits Without passing any arguments to the formula weechat compiles just fine.

So I'm confused.

2bits commented 12 years ago

@zmanji would you please try the new version of the formula I have committed. What I'm trying now is to update weechat's build scripts using the latest FindRuby.cmake from cmake-2.8.8 rather than their older module. You can do that with these commands:

brew rm -f weechat
export VERBOSE=1
brew install -v --enable-ruby https://raw.github.com/2bits/homebrew/fixWeechat/Library/Formula/weechat.rb

If that doesn't work, please gist this, which should have changed:

/Users/zmanji/Library/Logs/Homebrew/CMakeChache.txt

Thanks.

2bits commented 12 years ago

@sindresorhus Do you have Ruby-1.9x of some flavor installed? If so, would you please also try the commands I listed directly above this? Thanks.

zmanji commented 12 years ago

@2bits: Sorry about my earlier comment, I was not aware that you already submitted a pull request. That was my bad.

I have tried out your new version and again the build failed with the same error messages as before. Here I have gisted the CMakeCache here.

2bits commented 12 years ago

@zmanji Thanks for the new gist. On the rbenv github page, I've opened up a new issue, sstephenson/rbenv#220 , asking them to verify which of the values in your gist are accurate. Once I hear back, I'll know better how to patch weechat and how to report this bug to their developers.

I fixed the Python issue by patching weechat's FindPython.cmake so that it compiles against framework Python. I'll be adjusting my pull request, 11859, in a few minutes so at least that's done.

zmanji commented 12 years ago

Thanks a lot for your hard work @2bits.

sindresorhus commented 12 years ago

@2bits I don't think I have Ruby 1.9 installed, at least ruby -v say: ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]

I tried it anyway, and it installed successfully, but when I try to run weechat it doesn't exist.

https://gist.github.com/c374627eecc258c664d5

2bits commented 12 years ago

-- Installing: /usr/local/Cellar/weechat/0.3.7/bin/weechat-curses

Apparently they are calling it weechat-curses. You should be able to pick it up by typing wee and hitting TAB. It seems to work, but if you could test it a bit and let us know how it goes that would help. All I did was run it and type /quit which caused it crash :-) So yea for me.

sindresorhus commented 12 years ago

@2bits Oh, right, that's logical... But it seems to work now ;)

Will let you now if I experience any problems.

2bits commented 12 years ago

We're getting no help from the rbenv people. @zmanji would you run these commands and tell me what you get:

find /System/Library/Frameworks -name libruby.dylib
find /Library/Frameworks -name libruby.dylib
find /Users/zmanji -name libruby.dylib

Thanks.

zmanji commented 12 years ago

Only the first command returns a result: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/libruby.dylib The other two commands do not return anything.

2bits commented 12 years ago

Thanks I'll work on it tomorrow.

2bits commented 12 years ago

Hmm, that's odd... Compare what CMake found with what you posted

RUBY_LIBRARY:FILEPATH=/System/Library/Frameworks/ruby.framework
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/libruby.dylib

CMake has a lower case ruby. I wonder if that's the problem.