jruby 1.5.0RC1 behaves different/strange than 1.4.0 with regards to app depolyment (compilation) via "rawr" -------------------------------------------------------------------------------------------------------------
Key: JRUBY-4782 URL: http://jira.codehaus.org/browse/JRUBY-4782 Project: JRuby Issue Type: Bug Environment: [cg ~]$ uname -a Linux idefix 2.6.30.9-elive-highmem-686 #1 SMP Fri Oct 9 11:49:49 CEST 2009 i686 GNU/Linux [cg ~]$ [cg ~]$ java -version java version "1.6.0_0" OpenJDK Runtime Environment (build 1.6.0_0-b11) OpenJDK Server VM (build 1.6.0_0-b11, mixed mode) [cg ~]$ jruby --version jruby 1.5.0.RC1 (ruby 1.8.7 patchlevel 249) (2010-04-14 0b08bc7) (OpenJDK Client VM 1.6.0_0) [i386-java] [cg ~]$ rawr gem version : rawr-1.3.9 Reporter: Christian Guenther Assignee: Thomas E Enebo Fix For: JRuby 1.5.0.RC1 Long problem summary: see below Short problem summary (problematic code example): [cg ~/rawr_example_project]$ cat weird.rb require 'ostruct' require 'jruby/jrubyc' module Rawr class JRubyBatchCompiler include JRubyCompiler puts "working as expected :-)" end end [cg ~/rawr_example_project]$ jruby --version jruby 1.4.0 (ruby 1.8.7 patchlevel 174) (2009-11-02 69fbfa3) (OpenJDK Client VM 1.6.0_0) [i386-java] [cg ~/rawr_example_project]$ jruby -e 'require "weird"' working as expected :-) [cg ~/rawr_example_project]$ Hence, with jruby 1.4.0 everything is working as I expected. But : [cg ~/rawr_example_project]$ jruby --version jruby 1.5.0.RC1 (ruby 1.8.7 patchlevel 249) (2010-04-14 0b08bc7) (OpenJDK Client VM 1.6.0_0) [i386-java] [cg ~/rawr_example_project]$ [cg ~/rawr_example_project]$ jruby -e 'require "weird"' ./weird.rb:6: uninitialized constant Rawr::JRubyBatchCompiler::JRubyCompiler (NameError) from ./weird.rb:1:in `require' from -e:1 It seem like jruby 1.5.0 RC.1 has a different opinion on initialzed constants than 1.4.0 !? Original (long) problem description: My "rawr"-accociated problem seems to be related to jrubyc of release 1.5.0 RC.1 only, because the problem does not show up when using jruby 1.4.0 ! The problem is the following: I am using "rawr" to deploy my app. When trying to compile (with jruby 1.4.0) my ruby source files everything works as expected : [cg ~/rawr_example_project]$ rake rawr:compile (in /home/cg/rawr_example_project) Running in jruby 1.4.0 (ruby 1.8.7 patchlevel 174) [i386-java] mkdir -p package/classes/java javac -target 1.6 -cp lib/java/jruby-complete.jar:src:lib/ruby -sourcepath src:lib/ruby -d package/classes/java src/org/rubyforge/rawr/Main.java mkdir -p package/classes/ruby Compile lib/ruby/bar.rb into package/classes/ruby/bar.class java -jar lib/java/jruby-complete.jar -e require '/home/cg/jruby-1.4.0/lib/ruby/gems/1.8/gems/rawr-1.3.9/lib/jruby_batch_compiler'; Rawr::JRubyBatchCompiler.compile_argv src lib/ruby package/classes/ruby files for src: 0 files for lib/ruby: 3 Compiling lib/ruby/bar.rb to class bar Compiling lib/ruby/foo.rb to class foo Compiling lib/ruby/main.rb to class main [cg ~/rawr_example_project]$ But when doing exact the same under jruby 1.5.0.RC1, jruby complains about "uninitialized constant Rawr::JRubyBatchCompiler::JRubyCompiler": [cg ~/rawr_example_project]$ rake rawr:compile (in /home/cg/rawr_example_project) Running in jruby 1.5.0.RC1 (ruby 1.8.7 patchlevel 249) [i386-java] mkdir -p package/classes/java javac -target 1.6 -cp lib/java/jruby-complete.jar:src:lib/ruby -sourcepath src:lib/ruby -d package/classes/java src/org/rubyforge/rawr/Main.java mkdir -p package/classes/ruby Compile lib/ruby/bar.rb into package/classes/ruby/bar.class rake aborted! uninitialized constant Rawr::JRubyBatchCompiler::JRubyCompiler (See full trace by running task with --trace) [cg ~/rawr_example_project]$ [cg ~/rawr_example_project]$ rake --trace rawr:compile (in /home/cg/rawr_example_project) Running in jruby 1.5.0.RC1 (ruby 1.8.7 patchlevel 249) [i386-java] ** Invoke rawr:compile (first_time) ** Invoke package/classes/java/org/rubyforge/rawr/Main.class (first_time, not_needed) ** Invoke src/org/rubyforge/rawr/Main.java (first_time, not_needed) ** Invoke package/classes/java (first_time, not_needed) ** Invoke package/classes/ruby/bar.class (first_time) ** Invoke lib/ruby/bar.rb (first_time, not_needed) ** Invoke package/classes/ruby (first_time, not_needed) ** Execute package/classes/ruby/bar.class Compile lib/ruby/bar.rb into package/classes/ruby/bar.class rake aborted! uninitialized constant Rawr::JRubyBatchCompiler::JRubyCompiler /home/cg/jruby-1.5.0.RC1/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2503:in `const_missing' /home/cg/jruby-1.5.0.RC1/lib/ruby/gems/1.8/gems/rawr-1.3.9/lib/jruby_batch_compiler.rb:6 <<<<<<<<<<<<<<<<<<<<<<<<<<<<< /home/cg/jruby-1.5.0.RC1/lib/ruby/gems/1.8/gems/rawr-1.3.9/lib/jruby_batch_compiler.rb:31:in `require' /home/cg/jruby-1.5.0.RC1/lib/ruby/gems/1.8/gems/rawr-1.3.9/lib/jruby_batch_compiler.rb seems to be rawr's problematic module : require 'ostruct' require 'jruby/jrubyc' module Rawr class JRubyBatchCompiler include JRubyCompiler <<<<<<<<<<<<<<<<<<< ??????? def self.compile_argv ....... It seems that when using jruby 1.5.0.RC1 "JRubyCompiler" is not defined at that point. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email