Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jrubyc does not compile braces #2880

Closed
dmityr opened this issue Apr 27, 2015 · 1 comment
Closed

jrubyc does not compile braces #2880

dmityr opened this issue Apr 27, 2015 · 1 comment

Comments

@dmityr
Copy link

dmityr commented Apr 27, 2015

jrubyc with JRUBY_OPTS=--2.0 fails with a cryptic error:

$ jruby --version
jruby 1.7.19 (2.0.0p598) 2015-01-29 20786bd on OpenJDK Server VM 1.7.0_65-b32 +jit [linux-i386]

$ echo "proc {}" > x.rb; JRUBY_OPTS=--1.9  jrubyc x.rb

$ echo "proc {}" > x.rb; JRUBY_OPTS=--2.0  jrubyc x.rb
Failure during compilation of file x.rb:
Can't compile assignment node: (ArgsNoArgNode 0)
java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:606)
RUBY.compile_files_with_options(/home/alexey/.rvm/rubies/jruby-1.7.19/lib/ruby/shared/jruby/compiler.rb:164)
org.jruby.RubyProc.call(org/jruby/RubyProc.java:271)
RUBY.compile_files_with_options(/home/alexey/.rvm/rubies/jruby-1.7.19/lib/ruby/shared/jruby/compiler.rb:214)
org.jruby.RubyArray.each(org/jruby/RubyArray.java:1613)
RUBY.compile_files_with_options(/home/alexey/.rvm/rubies/jruby-1.7.19/lib/ruby/shared/jruby/compiler.rb:198)
RUBY.compile_argv(/home/alexey/.rvm/rubies/jruby-1.7.19/lib/ruby/shared/jruby/compiler.rb:90)
home.alexey.$_dot_rvm.rubies.jruby_minus_1_dot_7_dot_19.bin.jrubyc.(root)(/home/alexey/.rvm/rubies/jruby-1.7.19/bin/jrubyc:5)
home.alexey.$_dot_rvm.rubies.jruby_minus_1_dot_7_dot_19.bin.jrubyc.(root)(home/alexey/$_dot_rvm/rubies/jruby_minus_1_dot_7_dot_19/bin//home/alexey/.rvm/rubies/jruby-1.7.19/bin/jrubyc:5)
Compilation FAILED: 1 error(s) encountered
@headius
Copy link
Member

headius commented Apr 29, 2015

This isn't too surprising considering that 2.0 support is experimental in JRuby 1.7.x. The problem is that our JVM bytecode compiler simply doesn't know how to compile this node, which was added in 2.0 mode to support new argument forms like keyword args.

With JRuby 9k nearly complete and 2.2 compatible, we are not going to be improving the 2.0 mode in JRuby 1.7. We would accept community improvements to JRuby 1.7's 2.0 mode, but this is probably not a case where any community members are going to step up.

Perhaps JRuby 9000 is in your future? It's definitely the right move to make if you need Ruby 2.0+ features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants