[ 
https://issues.apache.org/jira/browse/HBASE-13583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16505600#comment-16505600
 ] 

Mike Drob commented on HBASE-13583:
-----------------------------------

v2: get something that actually works! manually verified that there are class 
files corresponding to the ruby source in our hbase-shell jar. We end up 
including both the .rb and .class files, which might be ok for now? Can circle 
back to that later.

It's actually much worse than what you suggested, [~busbey].

Checked the classpath with {{mvn -X}} and saw that we have asm 3.1 in use. I 
tried using a newer version of asm both asm:asm:3.3.1 (the latest version in 
the asm:asm coordinate space) and org.ow2.asm:asm-all:5.0.4 (the version jruby 
is using) and they fail with:

{noformat}
[INFO] TypeError: failed to coerce org.objectweb.asm.ClassWriter to 
org.jruby.org.objectweb.asm.ClassVisitor
[INFO]   block in compile_files_with_options at 
uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/jruby/compiler.rb:189
[INFO]   block in compile_files_with_options at 
uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/jruby/compiler.rb:291
[INFO]                                  each at org/jruby/RubyArray.java:1734
[INFO]   block in compile_files_with_options at 
uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/jruby/compiler.rb:290
[INFO]                                  each at org/jruby/RubyArray.java:1734
[INFO]            compile_files_with_options at 
uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/jruby/compiler.rb:281
[INFO]                          compile_argv at 
uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/jruby/compiler.rb:94
[INFO]                                <main> at -e:3
{noformat}

which led me to https://github.com/jruby/jruby/issues/2887 that suggest using 
shaded and unshaded asm in the same classpath will lead to a world of trouble.

So... I looked at the dependency tree and noted that we're pulling asm 3.1 via 
jersey-server via a bunch of hadoop libs, so we can exclude that in dependency 
management. And in hadoop-3, we're pulling in a different asm, so out that goes 
as well. Should file another JIRA to see what else we can prune from that 
dependency list, because it looks really long and full of hadoop stuff that I'm 
sure we don't need. Removing MR entries for now since those obviously don't 
belong, but leaving the rest because I don't want too invasive of a change.

> AOT compile our JRuby
> ---------------------
>
>                 Key: HBASE-13583
>                 URL: https://issues.apache.org/jira/browse/HBASE-13583
>             Project: HBase
>          Issue Type: Improvement
>          Components: build, scripts, shell
>            Reporter: Nick Dimiduk
>            Assignee: Mike Drob
>            Priority: Major
>         Attachments: HBASE-13583.patch, HBASE-13583.v2.patch
>
>
> Our Jruby code seems to not keep up well with Java changes. We should 
> investigate adding a compilation step for our shell and the rb scripts in bin 
> to ensure they're calling methods that exist on classes that exist. This 
> looks like as good a starting point as any: 
> https://github.com/jruby/jruby/wiki/GeneratingJavaClasses



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to