Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

RSpec 2.13 doesn't load in 2.0 mode #602

Closed
rkh opened this Issue · 18 comments

4 participants

@rkh

backtrace:

/Users/konstantin/.rbenv/versions/jruby-1.7.3/bin/jruby -w -S rspec
/Users/konstantin/.rbenv/versions/jruby-1.7.3/lib/ruby/gems/shared/gems/rspec-mocks-2.13.0/lib/rspec/mocks/message_expectation.rb:145 warning: `*' interpreted as argument prefix
TypeError: wrong argument type Symbol (expected Module)
                include at org/jruby/RubyModule.java:2068
             module_for at /Users/konstantin/.rbenv/versions/jruby-1.7.3/lib/ruby/gems/shared/gems/rspec-core-2.13.1/lib/rspec/core/memoized_helpers.rb:463
  get_constant_or_yield at /Users/konstantin/.rbenv/versions/jruby-1.7.3/lib/ruby/gems/shared/gems/rspec-core-2.13.1/lib/rspec/core/memoized_helpers.rb:495
             module_for at /Users/konstantin/.rbenv/versions/jruby-1.7.3/lib/ruby/gems/shared/gems/rspec-core-2.13.1/lib/rspec/core/memoized_helpers.rb:451
                    let at /Users/konstantin/.rbenv/versions/jruby-1.7.3/lib/ruby/gems/shared/gems/rspec-core-2.13.1/lib/rspec/core/memoized_helpers.rb:180
                subject at /Users/konstantin/.rbenv/versions/jruby-1.7.3/lib/ruby/gems/shared/gems/rspec-core-2.13.1/lib/rspec/core/memoized_helpers.rb:278
                pattern at /Users/konstantin/Workspace/sinatra2/spec/support/pattern.rb:41
            module_eval at org/jruby/RubyModule.java:2291
               subclass at /Users/konstantin/.rbenv/versions/jruby-1.7.3/lib/ruby/gems/shared/gems/rspec-core-2.13.1/lib/rspec/core/example_group.rb:242
               describe at /Users/konstantin/.rbenv/versions/jruby-1.7.3/lib/ruby/gems/shared/gems/rspec-core-2.13.1/lib/rspec/core/example_group.rb:227
                pattern at /Users/konstantin/Workspace/sinatra2/spec/support/pattern.rb:40
                 (root) at /Users/konstantin/Workspace/sinatra2/spec/sinatra/pattern_spec.rb:114
            module_eval at org/jruby/RubyModule.java:2291
               subclass at /Users/konstantin/.rbenv/versions/jruby-1.7.3/lib/ruby/gems/shared/gems/rspec-core-2.13.1/lib/rspec/core/example_group.rb:242
               describe at /Users/konstantin/.rbenv/versions/jruby-1.7.3/lib/ruby/gems/shared/gems/rspec-core-2.13.1/lib/rspec/core/example_group.rb:227
               describe at /Users/konstantin/.rbenv/versions/jruby-1.7.3/lib/ruby/gems/shared/gems/rspec-core-2.13.1/lib/rspec/core/dsl.rb:18
                 (root) at /Users/konstantin/Workspace/sinatra2/spec/sinatra/pattern_spec.rb:5
                   load at org/jruby/RubyKernel.java:1046
                 (root) at /Users/konstantin/.rbenv/versions/jruby-1.7.3/lib/ruby/gems/shared/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:1
                   each at org/jruby/RubyArray.java:1613
        load_spec_files at /Users/konstantin/.rbenv/versions/jruby-1.7.3/lib/ruby/gems/shared/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819
        load_spec_files at /Users/konstantin/.rbenv/versions/jruby-1.7.3/lib/ruby/gems/shared/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819
                    run at /Users/konstantin/.rbenv/versions/jruby-1.7.3/lib/ruby/gems/shared/gems/rspec-core-2.13.1/lib/rspec/core/command_line.rb:22
                    run at /Users/konstantin/.rbenv/versions/jruby-1.7.3/lib/ruby/gems/shared/gems/rspec-core-2.13.1/lib/rspec/core/runner.rb:80
@enebo enebo was assigned
@enebo
Owner

@rkh I tried a couple of spec runs of projects using --2.0 and they both ran. I tried making a simplified snippet like L145 in that file and it also works. So I am guessing some change in grammar recently fixed this (I did fix something associated with kwargs a few weeks ago) or I am not tripping over it. Optimistically closing. If it still happens just re-open and I will gid deeper.

@enebo enebo closed this
@rkh

Still happens. Meaning to release some code this weekend that can be used to reproduce this.

@enebo
Owner

ah great. Thanks for replying soo lightning fast :)

@enebo enebo reopened this
@enebo
Owner

I have localized the issue:

def compile(options)
  puts(lookahead: 1, **options)
end

compile(foo: 1)

When run in interpreted mode this explodes with AIOOBE in ListNode. Something really basic is wrong with our code assuming options as kwarg is in the list when it isn't. I will look into this. When run with our JIT the above snippet is also wrong and does not print 'foo => 1' in the snippet. So even had this jit it would have not included any options passed into the compile method. So we have 2 things to deal with.

@rkh

\o/ sorry for the rspec red herring.

@enebo
Owner

Nah it is still valid but the localized cause is a little more primal :)

@rkh

Alternative way to reproduce: Run rspec for mustermann.

@rkh rkh referenced this issue in rkh/mustermann
Closed

not working on JRuby #2

4 of 6 tasks complete
@headius
Owner

Not sure if you've retried this with JRuby master, but 1.7.3 had very limited/partial 2.0 support. 1.7.4 will be much better.

@rkh

As all the other tickets, this is with a recent 1.7.4 from the CI.

@headius
Owner

Managed to patch everything up to the point or running rspec, and I get a somewhat different error:

ext-jruby-local ~/projects/mustermann $ jruby --2.0 -S rspec
/Users/headius/.rvm/gems/ext-jruby-local/gems/simplecov-0.7.1/lib/simplecov.rb:34 warning: tracing (e.g. set_trace_func) will not capture all events without --debug flag
ArgumentError: positional args mixed with named args
                % at org/jruby/RubyString.java:1176
          pattern at /Users/headius/projects/mustermann/spec/support.rb:62
           (root) at /Users/headius/projects/mustermann/spec/identity_spec.rb:71
      module_eval at org/jruby/RubyModule.java:2247
         subclass at /Users/headius/.rvm/gems/ext-jruby-local/gems/rspec-core-2.13.1/lib/rspec/core/example_group.rb:242
         describe at /Users/headius/.rvm/gems/ext-jruby-local/gems/rspec-core-2.13.1/lib/rspec/core/example_group.rb:227
         describe at /Users/headius/.rvm/gems/ext-jruby-local/gems/rspec-core-2.13.1/lib/rspec/core/dsl.rb:18
           (root) at /Users/headius/projects/mustermann/spec/identity_spec.rb:4
             load at org/jruby/RubyKernel.java:1047
           (root) at /Users/headius/.rvm/gems/ext-jruby-local/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:1
             each at org/jruby/RubyArray.java:1617
  load_spec_files at /Users/headius/.rvm/gems/ext-jruby-local/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819
  load_spec_files at /Users/headius/.rvm/gems/ext-jruby-local/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819
              run at /Users/headius/.rvm/gems/ext-jruby-local/gems/rspec-core-2.13.1/lib/rspec/core/command_line.rb:22
              run at /Users/headius/.rvm/gems/ext-jruby-local/gems/rspec-core-2.13.1/lib/rspec/core/runner.rb:80
Coverage report generated for RSpec to /Users/headius/projects/mustermann/coverage. 159 / 320 LOC (49.69%) covered.
[Coveralls] Outside the Travis environment, not sending data.

Forcing compilation changes it yet again. Keyword args are not 100% obviously, and we need more work (plus I don't think I have implemented them at all in the compiler yet).

ext-jruby-local ~/projects/mustermann $ jruby --2.0 -X+C -S rspec
/Users/headius/.rvm/gems/ext-jruby-local/gems/simplecov-0.7.1/lib/simplecov.rb:34 warning: tracing (e.g. set_trace_func) will not capture all events without --debug flag
NoMethodError: undefined method `keys' for nil:NilClass
              new at /Users/headius/projects/mustermann/lib/mustermann/pattern.rb:40
          pattern at /Users/headius/projects/mustermann/spec/support.rb:65
           (root) at /Users/headius/projects/mustermann/spec/identity_spec.rb:7
      module_eval at org/jruby/RubyModule.java:2247
         subclass at /Users/headius/.rvm/gems/ext-jruby-local/gems/rspec-core-2.13.1/lib/rspec/core/example_group.rb:242
         describe at /Users/headius/.rvm/gems/ext-jruby-local/gems/rspec-core-2.13.1/lib/rspec/core/example_group.rb:227
         describe at /Users/headius/.rvm/gems/ext-jruby-local/gems/rspec-core-2.13.1/lib/rspec/core/dsl.rb:18
           (root) at /Users/headius/projects/mustermann/spec/identity_spec.rb:4
             load at org/jruby/RubyKernel.java:1047
  load_spec_files at /Users/headius/.rvm/gems/ext-jruby-local/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819
             each at org/jruby/RubyArray.java:1617
  load_spec_files at /Users/headius/.rvm/gems/ext-jruby-local/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819
              run at /Users/headius/.rvm/gems/ext-jruby-local/gems/rspec-core-2.13.1/lib/rspec/core/command_line.rb:22
       __ensure__ at /Users/headius/.rvm/gems/ext-jruby-local/gems/rspec-core-2.13.1/lib/rspec/core/runner.rb:80
          autorun at /Users/headius/.rvm/gems/ext-jruby-local/gems/rspec-core-2.13.1/lib/rspec/core/runner.rb:17
Coverage report generated for RSpec to /Users/headius/projects/mustermann/coverage. 0 / 320 LOC (0%) covered.
[Coveralls] Outside the Travis environment, not sending data.
@enebo
Owner

I am resolving this with the recent commits I made. All the kwargs stuff neccesary to run your specs now work. I did run into 2 other issues #720 and #721 in the course of working on this. We will track those issues separately. Once I worked around those two issues I ended up with:

734 examples, 11 failures

It is very possible these errors are related to kwargs processing but it does run now so I would like to open up new more specific issues for these cas(es). It is also very likely something else we are missing in 2.0 support.

Thanks for reporting this. It made a world of difference to our kwargs implementation :)

@enebo enebo closed this
@rkh
rkh commented

Cool, once I get around to it, I'll investigate further and potentially open more issues or talk to you guys. Great work!

@rkh

Is this fix in master? Still getting TypeError: wrong argument type Symbol (expected Module) on b4bb482.

@enebo
Owner

@rkh Try JRUBY_OPTS="--2.0 -X-C" I notice that we may be erroneously JIT'ing some **foo at callsite stuff as foo=nil (all kwargs right now should abort JIT'ing since it is not implemented in the JIT yet). Unfortunately, I am not getting the same error as you. I did get an error like that when rvm was lying to me and I was using 1.9.3 gems instead of JRuby ones.

Here is output when I work around the cited bugs in my last comment using HEAD of both JRuby and sinatra2:
https://gist.github.com/enebo/5554404

@rkh
rkh commented

I am now seeing this error with RSpec 3.0.0 and RSpec 3.0.0.beta2 on JRuby 1.7.10, 1.7.11, 1.7.12 and 1.7.13 in 1.9 mode.

@rkh
rkh commented

Setting -X-C indeed fixes that.

@headius
Owner

@rkh You're seeing this in 1.9 mode on 1.7.x? There shouldn't be any support at all for **foo syntax in 1.9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.