seattlerb/ruby2ruby

minitest missing from developer dependencies

neilconway opened this issue · 11 comments

I believe the Hoe.spec for ruby2ruby needs something like:

dependency "minitest", "~> 2.0", :developer

Otherwise, running rake with the isolate plugin won't isolate the minitest gem, which prevents the test suite from being run.

rake install_plugins will take care of the dependency loop between the minitest plugin being missing and not providing the gem dependency needed to run the tests

I'm not sure which dependency loop you're referring to. If you run rake test on a pristine source tree, you get an error because minitest hasn't been isolated (regardless of whether the minitest gem is installed). rake install_plugins doesn't help, as far as I can tell.

$ gem list minitest

*** LOCAL GEMS ***


$ rake install_plugins
$ rake
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -w -I../../ParseTree/dev/test:../../ruby_parser/dev/lib:../../sexp_processor/dev/lib:../../sexp_processor/dev/test:lib:lib:bin:test:. -e 'require "rubygems"; gem "minitest"; require "minitest/autorun"; require "test/test_crewriter.rb"; require "test/test_extras.rb"; require "test/test_function_table.rb"; require "test/test_function_type.rb"; require "test/test_handle.rb"; require "test/test_r2cenvironment.rb"; require "test/test_rewriter.rb"; require "test/test_ruby_to_ansi_c.rb"; require "test/test_ruby_to_ruby_c.rb"; require "test/test_type.rb"; require "test/test_type_checker.rb"; require "test/test_typed_sexp.rb"' -- 
[…]
$ gem list minitest hoe

*** LOCAL GEMS ***

minitest (2.11.3)

$ gem list hoe

*** LOCAL GEMS ***

hoe (2.15.0, 2.14.0)
$ rake install_plugins
[1/4] Isolating sexp_processor (~> 3.0).
[2/4] Isolating ruby_parser (~> 2.0).
[3/4] Isolating ParseTree (~> 3.0).
[4/4] Isolating rdoc (~> 3.10).
Building native extensions.  This could take a while...
Depending on your version of ruby, you may need to install ruby rdoc/ri data:

<= 1.8.6 : unsupported
 = 1.8.7 : gem install rdoc-data; rdoc-data --install
 = 1.9.1 : gem install rdoc-data; rdoc-data --install
>= 1.9.2 : nothing to do! Yay!
$ rake test
[1/1] Nuking hoe-seattlerb-1.2.8.
/Users/neilc/.rvm/rubies/ruby-1.8.7-p352/bin/ruby -w -Ilib:../../ruby_parser/dev/lib:../../sexp_processor/dev/lib:lib:bin:test:. -e 'require "rubygems"; require "test/unit"; require "test/test_ruby2ruby.rb"' -- 
/Users/neilc/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require': no such file to load -- minitest/autorun (LoadError)
    from /Users/neilc/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
    from ./test/test_ruby2ruby.rb:7
[...]
rake aborted!
Command failed with status (1): [/Users/neilc/.rvm/rubies/ruby-1.8.7-p352/b...]
[...]
$ gem list minitest

*** LOCAL GEMS ***

minitest (2.11.3)
$ gem list hoe         

*** LOCAL GEMS ***

hoe (2.15.0)

The dependency is provided by minitest itself and is activated in our projects via the :seattlerb plugin. rake debug_gem shows:

  s.add_development_dependency(%q<minitest>, ["~> 2.11"])

As for the other problem... We have cleaned some dependency issues up in hoe 2.16... but I'm not sure that's going to address the issue you're seeing.

Can you provide more details? Enough so I might be able to reproduce? I can see that you're using isolate + ruby 1.8.7. I am too. So I don't know what the missing ingredient is.

... still need more data

being ignored. closing.

Sorry. I'm not sure what other information I can provide; the issue repros for me with out-of-the-box ruby 1.8.7-p352 and a fresh git clone of the ruby2ruby repo. e.g.,:

$ rvm use ruby-1.8.7-p352
$ cd ruby2ruby && git pull && git clean -f -d
$ rvm gemset create empty
$ rvm gemset use empty
$ gem list -l

*** LOCAL GEMS ***

rake (0.9.2)
$ rake install_plugins
rake aborted!
no such file to load -- hoe

(See full trace by running task with --trace)
$ gem install hoe
Fetching: hoe-3.0.0.gem (100%)
Successfully installed hoe-3.0.0
1 gem installed
$ rake install_plugins
rake aborted!
no such file to load -- isolate/rake

(See full trace by running task with --trace)
$ gem install isolate 
Fetching: isolate-3.2.2.gem (100%)
Successfully installed isolate-3.2.2
1 gem installed
$ rake install_plugins
$ rake test
[1/5] Isolating sexp_processor (~> 3.0).
[2/5] Isolating ruby_parser (~> 2.0).
[3/5] Isolating rdoc (~> 3.10).
Building native extensions.  This could take a while...
Depending on your version of ruby, you may need to install ruby rdoc/ri data:

<= 1.8.6 : unsupported
 = 1.8.7 : gem install rdoc-data; rdoc-data --install
 = 1.9.1 : gem install rdoc-data; rdoc-data --install
>= 1.9.2 : nothing to do! Yay!
[4/5] Isolating ParseTree (~> 3.0).
[5/5] Isolating hoe (~> 3.0).
/Users/neilc/.rvm/rubies/ruby-1.8.7-p352/bin/ruby -w -Ilib:../../ruby_parser/dev/lib:../../sexp_processor/dev/lib:lib:bin:test:. -e 'require "rubygems"; require "test/unit"; require "test/test_ruby2ruby.rb"' -- 
/Users/neilc/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require': no such file to load -- minitest/autorun (LoadError)
[...]

After gem install minitest, isolate then isolates minitest and rake test succeeds (well, it runs and there are 30 assertion failures, but that seems unrelated).

Let me know if there's any more info you need.

BTW, would you mind merging my pull request fixing the empty hash literal bug? I've been depending on Ruby2Ruby < 1.3.1 for about 6 months now :)

OK. I think I understand what's going on now... slowly...

If you run with rake -t, then you'll prolly see a warning that the minitest hoe plugin can't be loaded. It's the plugin that adds the developer dependency. If you verify with gem spec --ruby -r ruby2ruby you'll see is fine for packaging, but obviously not for this scenario... so it looks like you'll have to have rake+hoe+isolate+minitest installed for the whole shebang to work properly.

This is a catch-22 of my own design and I need to think about it.

OK. I understand the problem better now. I've made some minor changes to the Rakefile that should reduce the minimum bootstrap to:

% gem i rake hoe
% rake install_plugins # installs hoe-seattlerb & isolate
% rake install_plugins # installs minitest (referenced from hoe-seattlerb)

I think this is acceptable at this point. I'll add the steps to the readme.