jimweirich / rake

A make-like build utility for Ruby.

Home Page:http://rake.rubyforge.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rake v10.2.2 never exits on OS X 10.7.5 under rvm

albertsun opened this issue · comments

I've been having an issue with rake version 10.2.2 where tasks never finish running.

It'll successfully go through everything, but then the process will never exit and return to the commandline. Downgrading rake to 10.1.1 fixes the problem.

I haven't been able to reproduce on ubuntu or OS X 10.8 however.

A minimal test case is here https://github.com/albertsun/testrake and the output of rvm info on my system is here https://gist.github.com/albertsun/2bf9f79eb7b52a3a4ffc Let me know if you need any other system info. Hopefully this is reproduceable for others and not just a bug on my system.

Another note, I've reproduced the error with both ruby 1.9.3 and 2.0.0

I have a slightly different setup than you have (rbenv vs rvm), but I did not have any trouble executing this code.

~/workspace/tmp/testrake
☻  be rake test
Hi

~/workspace/tmp/testrake
☻  be rake --version
rake, version 10.2.2

~/workspace/tmp/testrake
☻  be ruby --version
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin13.0.2]

be above is an alias for bundle exec. Sounds like it may be something on your system... I'd probably start by blowing away the RVM caches and reinstalling your Ruby and Gems. Someone more familiar with RVM may have a better suggestion as to how to do that in a clean way.

I don't think this is a rake problem. I've reviewed the changes between 10.1.1 and 10.2.2 and nothing obvious stands out at me that would cause this (it may be subtle, of course).

I don't use rvm or bundler and I can't reproduce it without either. Are there smaller steps to reproduce?

What backtrace does ^C produce?

Do you have RAKEOPTS set?

$ /usr/bin/ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]
$ /usr/bin/rake --version
rake, version 10.2.2
$ /usr/bin/rake -f test.rf test
Hi
$ ruby20 -v
ruby 2.0.0p451 (2014-02-24 revision 45167) [x86_64-darwin13.1.0]
$ rake20 --version
rake, version 10.2.2
$ rake20 -f test.rf test
Hi
$ ruby -v
ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin13.0]
$ rake --version
rake, version 10.2.2
$ rake -f test.rf test
Hi

I've tried blowing away the rvm gemset and the ruby and reinstalling ruby. Same problem. Don't have RAKEOPTS set.

Ctrl-C produces this: https://gist.github.com/albertsun/3082743bd12050c3566a

$ ruby --version
ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-darwin11.4.2]

I'll try and produce a simpler test case without bundler or rvm, but I suspect it has to do with the OS X version. Are either of you using 10.7.5?

I am running 10.9.2 which is much newer. What do you get for the following:

ruby -rrbconfig -e 'puts RbConfig::CONFIG["host_os"]'

hwprefs cpu_count

hwprefs thread_count

$ ruby -rrbconfig -e 'puts RbConfig::CONFIG["host_os"]'
darwin11.4.2
$ hwprefs cpu_count
2
$ hwprefs thread_count
4

But when running the hwprefs commands I also get a whole screenful of this warning message.

objc[66713]: Class VMURangeArray is implemented in both /System/Library/PrivateFrameworks/Symbolication.framework/Versions/A/Symbolication and /System/Library/PrivateFrameworks/CHUD.framework/Versions/A/Frameworks/CHUDApp.framework/Versions/A/CHUDApp. One of the two will be used. Which one is undefined.

Do either of these hang:

ruby -ropen3 -e 'Open3.popen3 "hwprefs", "thread_count" do |_, out| puts out.gets.to_i end'

ruby -ropen3 -e 'Open3.popen3 "hwprefs", "thread_count" do |_, out| puts out.read.to_i end'

Yea, both of those hang.

What about:

ruby -ropen3 -e 'Open3.popen3 "hwprefs", "thread_count" do |inn, out| inn.close; puts out.gets.to_i end'

(Hopefully I'll stumble upon the magic thing to add to get hwprefs to exit when run, 10.9 no longer has it).

Yea, that still hangs.

Ugh, how about:

ruby -ropen3 -e 'Open3.popen3 "hwprefs", "thread_count" do |inn, out, _| inn.close; p out.getc end'

Still hanging.

This doesn't hang:

ruby -ropen3 -e 'Open3.popen3 "hwprefs", "thread_count" do |inn, out, err| err.close; inn.close; puts out.gets.to_i end'

But it returns 0 instead of 4 like hwprefs thread_count does.

This seems to work:

$ ruby -ropen3 -e 'Open3.popen3 "hwprefs", "thread_count" do |inn, out, err, wait_thr| inn.close; err.read; puts out.read.to_i; end'
4

Can you try master ↑

Hm... I wasn't sure how to install rake from master.... but I cloned the repo and ran this from it and it seemed to work!

$ ruby -Ilib bin/rake -f ..//testrake/Rakefile test

Thanks for all the help tracking this down!

Yep, just like that. I will close and release