[jruby] Jruby 9.0.4.0 fails to compile code for MRI 2.1.6p336 (mingw).

Thomas E Enebo tom.enebo at gmail.com
Fri Jan 15 00:32:48 JST 2016


We do seem to have a second bug with --java + jrubyc open right now:

https://github.com/jruby/jruby/issues/3599

but if you can provide us with your error case then we can make it is also
fixed.  As far as providing a better mechanism so you can fix it yourself I
think we probably need some better error handling code there.   As it is
whatever we are parsing is exploding in the parser but not displaying what
that code it thinks is wrong...

-Tom

On Thu, Jan 14, 2016 at 5:59 AM, Hugh Sasse <hgs at dmu.ac.uk> wrote:

> Hello,
>
> I've been writing an assembler of sorts, and this is mostly working.
> It does have diagnostic puts statements in it, but otherwise does not
> interact
> with the terminal.  It runs to completion under Ruby 2.1.6p336 (Mingw),
> and I can get jruby 9.0.3.0 to produce a class file from it.
> I got a ParserSyntaxException from jrubyc, with unclear (to me) diagnostics
> about where the problem was, so I upgraded to jruby 9.0.4.0.  I get
> much the same results from jrubyc, i.e.:
>
>
> C:\hgs_documents\electronics_club\Assembler\bin>jrubyc --javac assembler.rb
> Unhandled Java exception: org.jruby.parser.ParserSyntaxException: syntax
> error,
> unexpected LPAREN
>
> org.jruby.parser.ParserSyntaxException: syntax error, unexpected LPAREN
>
>                       build_signature at
> C:/jruby-9.0.4.0/lib/ruby/stdlib/jruby/
> compiler/java_class.rb:142
>              block in ClassNodeWalker at
> C:/jruby-9.0.4.0/lib/ruby/stdlib/jruby/
> compiler/java_class.rb:228
>              block in visit_args_node at
> C:/jruby-9.0.4.0/lib/ruby/stdlib/jruby/
> compiler/java_class.rb:35
>                             with_node at
> C:/jruby-9.0.4.0/lib/ruby/stdlib/jruby/
> compiler/java_class.rb:188
>              block in visit_args_node at
> C:/jruby-9.0.4.0/lib/ruby/stdlib/jruby/
> compiler/java_class.rb:34
>                         visitArgsNode at
> JRuby$$Compiler$$ClassNodeWalker_385928
> 906.gen:13
>              block in ClassNodeWalker at
> C:/jruby-9.0.4.0/lib/ruby/stdlib/jruby/
> compiler/java_class.rb:240
>              block in visit_defn_node at
> C:/jruby-9.0.4.0/lib/ruby/stdlib/jruby/
> compiler/java_class.rb:35
>                             with_node at
> C:/jruby-9.0.4.0/lib/ruby/stdlib/jruby/
> compiler/java_class.rb:188
>              block in visit_defn_node at
> C:/jruby-9.0.4.0/lib/ruby/stdlib/jruby/
> compiler/java_class.rb:34
>                         visitDefnNode at
> JRuby$$Compiler$$ClassNodeWalker_385928
> 906.gen:13
>              block in ClassNodeWalker at
> C:/jruby-9.0.4.0/lib/ruby/stdlib/jruby/
> compiler/java_class.rb:270
>                                  each at
> uri:classloader:/jruby/java/java_ext/ja
> va.util.rb:7
>              block in ClassNodeWalker at
> C:/jruby-9.0.4.0/lib/ruby/stdlib/jruby/
> compiler/java_class.rb:270
>             block in visit_block_node at
> C:/jruby-9.0.4.0/lib/ruby/stdlib/jruby/
> compiler/java_class.rb:35
>                             with_node at
> C:/jruby-9.0.4.0/lib/ruby/stdlib/jruby/
> compiler/java_class.rb:188
>             block in visit_block_node at
> C:/jruby-9.0.4.0/lib/ruby/stdlib/jruby/
> compiler/java_class.rb:34
>                        visitBlockNode at
> JRuby$$Compiler$$ClassNodeWalker_385928
> 906.gen:13
>              block in ClassNodeWalker at
> C:/jruby-9.0.4.0/lib/ruby/stdlib/jruby/
> compiler/java_class.rb:234
>             block in visit_class_node at
> C:/jruby-9.0.4.0/lib/ruby/stdlib/jruby/
> compiler/java_class.rb:35
>                             with_node at
> C:/jruby-9.0.4.0/lib/ruby/stdlib/jruby/
> compiler/java_class.rb:188
>             block in visit_class_node at
> C:/jruby-9.0.4.0/lib/ruby/stdlib/jruby/
> compiler/java_class.rb:34
>                        visitClassNode at
> JRuby$$Compiler$$ClassNodeWalker_385928
> 906.gen:13
>              block in ClassNodeWalker at
> C:/jruby-9.0.4.0/lib/ruby/stdlib/jruby/
> compiler/java_class.rb:270
>                                  each at
> uri:classloader:/jruby/java/java_ext/ja
> va.util.rb:7
>              block in ClassNodeWalker at
> C:/jruby-9.0.4.0/lib/ruby/stdlib/jruby/
> compiler/java_class.rb:270
>             block in visit_block_node at
> C:/jruby-9.0.4.0/lib/ruby/stdlib/jruby/
> compiler/java_class.rb:35
>                             with_node at
> C:/jruby-9.0.4.0/lib/ruby/stdlib/jruby/
> compiler/java_class.rb:188
>             block in visit_block_node at
> C:/jruby-9.0.4.0/lib/ruby/stdlib/jruby/
> compiler/java_class.rb:34
>                        visitBlockNode at
> JRuby$$Compiler$$ClassNodeWalker_385928
> 906.gen:13
>              block in ClassNodeWalker at
> C:/jruby-9.0.4.0/lib/ruby/stdlib/jruby/
> compiler/java_class.rb:281
>              block in visit_root_node at
> C:/jruby-9.0.4.0/lib/ruby/stdlib/jruby/
> compiler/java_class.rb:35
>                             with_node at
> C:/jruby-9.0.4.0/lib/ruby/stdlib/jruby/
> compiler/java_class.rb:188
>              block in visit_root_node at
> C:/jruby-9.0.4.0/lib/ruby/stdlib/jruby/
> compiler/java_class.rb:34
>                         visitRootNode at
> JRuby$$Compiler$$ClassNodeWalker_385928
> 906.gen:13
>                         generate_java at
> C:/jruby-9.0.4.0/lib/ruby/stdlib/jruby/
> compiler/java_class.rb:8
>   block in compile_files_with_options at
> C:/jruby-9.0.4.0/lib/ruby/stdlib/jruby/
> compiler.rb:141
>   block in compile_files_with_options at
> C:/jruby-9.0.4.0/lib/ruby/stdlib/jruby/
> compiler.rb:291
>                                  each at org/jruby/RubyArray.java:1560
>            compile_files_with_options at
> C:/jruby-9.0.4.0/lib/ruby/stdlib/jruby/
> compiler.rb:275
>                          compile_argv at
> C:/jruby-9.0.4.0/lib/ruby/stdlib/jruby/
> compiler.rb:94
>                                 <top> at
> C_3a_/jruby_minus_9_dot_0_dot_4_dot_0/b
> in/C:/jruby-9.0.4.0/bin/jrubyc:5
>
>
> C:\hgs_documents\electronics_club\Assembler\bin>
>
> What I'm failing to see here is anything specific about where my code is
> wrong.
> I also can't see anything wrong with the parentheses at javaclass.rb line
> 142, but I'd expect that to have been spotted and fixed by now, of course.
>
> I also get:
>
> C:\hgs_documents\electronics_club\Assembler\bin>jruby -W -c assembler.rb
> io/console not supported; tty will not be manipulated
> Syntax OK
>
> C:\hgs_documents\electronics_club\Assembler\bin>
>
> Hence my remarks about puts, earlier.
>
> My java is 1.8.0_66, if that is useful diagnostics, on Windows 7 32bit.
>
> I'm not about to say: "here's my code, debug this for me" :-), so how do I
> get more useful information out of jrubyc as to what is going on?
> That way, I could attempt to produce a smaller failing case to pass on for
> unit test purposes.  Provided that will help, that is.
>
> My goal is to produce a jar file I can run as an executable, supplying two
> filenames on the command line, as I do for the present ruby code.  I have
> failed to produce such a thing with Warbler.
> (My other approach to creating an executable
> with rubyscript2exe failed also, but that is off-topic for this list.)
>
> Thank you,
> Hugh
>
>
>


-- 
blog: http://blog.enebo.com       twitter: tom_enebo
mail: tom.enebo at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ruby-lang.org/pipermail/jruby/attachments/20160114/1967b061/attachment.html>


More information about the JRuby mailing list