Re: [rawr] rawr failure with mixed ruby/java packages

19 views
Skip to first unread message

Logan Barnett

unread,
Mar 17, 2013, 1:45:57 PM3/17/13
to rawr...@googlegroups.com
Bruce,
I think I have the time to look into to this (Rawr and Monkeybars doesn't get a ton of love these days). Just so I understand clearly, this happens with the NestedSimple example? If not, can you give me a git link for your example where it breaks?

-Logan


On Wed, Mar 13, 2013 at 6:47 PM, Bruce Tesar <bruce...@gmail.com> wrote:
I'm having difficulty using rawr. The problem occurs under certain
circumstances, during the creation of the target jar file: the rake task
aborts. The key portions of the rawr output look like this (I include
the full output further down):

=== Creating jar file: package/jar/rawrtest.jar
Error during the creation of the jar file: package/jar/rawrtest.jar
rake aborted!
add failed. Entry rawrtest already exists

I'm using Jruby v. 1.7.3, with Java 1.7.0_17-b02
rawr v. 1.6.4 and monkeybars v. 1.1.2
Running in Win7 x64, but with the 32-bit version of Java.

The build_configuration.rb includes the following settings:
    c.executable_type = "console"
    c.compile_ruby_files = false
    c.target_jvm_version = 1.7

The project I'm using here is a very simple "hello world" style
console program. The src directory contains a file, main.rb,
with a single puts in it, org/monkeybars/rawr/Main.java, and
one other subdirectory, rawrtest, with two files in it. Neither file
is actually called from main.rb, all that matters is that one is a
ruby file and the other is a java file. The src/rawrtest subdirectory is
the rawrtest that "already exists" in the error message above.

What I mean by "all that matters" is that, if src/rawrtest only contains
the java file (not the ruby file), then rawr runs properly, and
produces executables the execute properly. If src/rawrtest contains
only the ruby file, rawr executes properly. If src/rawrtest contains
neither file (it is empty), rawr executes properly. It is only when
it contains *both* the java file and the ruby file that rawr fails.
Note: the java file is jextra.java, the ruby file is rextra.rb, so
they do not have the same filename (pre-extension).

In the rawr code, the error arises during the execution of the
following line, near the bottom of rawr-1.6.4\lib\rawr\jar_builder.rb:
            zipfile.add(file_path_in_zip, src_file_path)

I've included the complete output from the failed rawr task below.
In the output, there are lines prefixed with BBT: those are from
a puts that I added to jar_builder.rb on the line before the
zipfile.add line, showing the file_path_in_zip and src_file_path
values for each iteration.
I believe that they key lines to observe are the last BBT line before
the error, and two lines before that one. Both lines have the same
file_path_in_zip=rawrtest, coming from different src_file_path values.

At this point, I want to toss this to someone with more familiarity
than me about how rawr is supposed to work. I assume that this is
not expected behavior from rawr (I first ran into this when trying
to run rawr on the Nested-Simple project contained in the monkeybars
gem). What is the best fix for this?

c:\Users\Bruce\Projects\rawrtest>rake rawr:jar
c:/Programs/jruby-1.7.3/lib/ruby/gems/shared/gems/rake-10.0.3/lib/rake/backtrace
.rb:11 warning: invalid Unicode Property \P: /(\Ac:\Programs\jruby-1.7.3|c:/Prog
rams/jruby-1.7.3/lib|c:/Programs/jruby-1.7.3/lib/ruby|c:/Programs/jruby-1.7.3/li
b/ruby/1.9|c:/Programs/jruby-1.7.3/lib/ruby/shared|c:/Programs/jruby-1.7.3/lib/r
uby/1.9/site_ruby|c:/Programs/jruby\-1\.7\.3/lib/ruby/gems/shared/gems/rake\-10\
.0\.3/lib|bin/rake:\d+)/
mkdir -p package/classes/java
javac -target 1.7 -cp lib/java/jruby-complete.jar;src -sourcepath src -d package
/classes/java src/org/monkeybars/rawr/Main.java
javac -target 1.7 -cp lib/java/jruby-complete.jar;src -sourcepath src -d package
/classes/java src/rawrtest/jextra.java
mkdir -p package/classes/ruby
Copying source file src/main.rb to package/classes/ruby/main.rb
cp src/main.rb package/classes/ruby/main.rb
mkdir -p package/classes/ruby/rawrtest
Copying source file src/rawrtest/rextra.rb to package/classes/ruby/rawrtest/rext
ra.rb
cp src/rawrtest/rextra.rb package/classes/ruby/rawrtest/rextra.rb
mkdir -p package/classes/META-INF
mkdir -p package/jar
=== Creating jar file: package/jar/rawrtest.jar
BBT: file_path_in_zip=META-INF src_file_path=package/classes/META-INF
BBT: file_path_in_zip=META-INF/MANIFEST.MF src_file_path=package/classes/META-IN
F/MANIFEST.MF
BBT: file_path_in_zip=run_configuration src_file_path=package/classes/run_config
uration
BBT: file_path_in_zip=org/monkeybars/rawr/Main.class src_file_path=package/class
es/java/org/monkeybars/rawr/Main.class
BBT: file_path_in_zip=rawrtest/jextra.class src_file_path=package/classes/java/r
awrtest/jextra.class
BBT: file_path_in_zip=main.rb src_file_path=package/classes/ruby/main.rb
BBT: file_path_in_zip=rawrtest/rextra.rb src_file_path=package/classes/ruby/rawr
test/rextra.rb
BBT: file_path_in_zip=java src_file_path=package/classes/java
BBT: file_path_in_zip=org src_file_path=package/classes/java/org
BBT: file_path_in_zip=org/monkeybars src_file_path=package/classes/java/org/monk
eybars
BBT: file_path_in_zip=org/monkeybars/rawr src_file_path=package/classes/java/org
/monkeybars/rawr
BBT: file_path_in_zip=rawrtest src_file_path=package/classes/java/rawrtest
BBT: file_path_in_zip=ruby src_file_path=package/classes/ruby
BBT: file_path_in_zip=rawrtest src_file_path=package/classes/ruby/rawrtest
Error during the creation of the jar file: package/jar/rawrtest.jar
rake aborted!
add failed. Entry rawrtest already exists
c:/Programs/jruby-1.7.3/lib/ruby/gems/shared/gems/rake-10.0.3/lib/rake/backtrace
.rb:16 warning: invalid Unicode Property \P: /(\Ac:\Programs\jruby-1.7.3|c:/Prog
rams/jruby-1.7.3/lib|c:/Programs/jruby-1.7.3/lib/ruby|c:/Programs/jruby-1.7.3/li
b/ruby/1.9|c:/Programs/jruby-1.7.3/lib/ruby/shared|c:/Programs/jruby-1.7.3/lib/r
uby/1.9/site_ruby|c:/Programs/jruby\-1\.7\.3/lib/ruby/gems/shared/gems/rake\-10\
.0\.3/lib|bin/rake:\d+)/
org/jruby/RubyArray.java:1613:in `each'
org/jruby/RubyProc.java:249:in `call'
org/jruby/RubyArray.java:1613:in `each'
org/jruby/RubyArray.java:1613:in `each'
org/jruby/RubyArray.java:1613:in `each'
org/jruby/RubyKernel.java:1046:in `load'
Tasks: TOP => rawr:jar => package/jar/rawrtest.jar
(See full trace by running task with --trace)

--
You received this message because you are subscribed to the Google Groups "rawr-lib" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rawr-lib+u...@googlegroups.com.
To post to this group, send email to rawr...@googlegroups.com.
Visit this group at http://groups.google.com/group/rawr-lib?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages