JRuby Compiler ignores platform specific path separator
-------------------------------------------------------

                 Key: JRUBY-5055
                 URL: http://jira.codehaus.org/browse/JRUBY-5055
             Project: JRuby
          Issue Type: Bug
          Components: Compiler
    Affects Versions: JRuby 1.5.2
         Environment: Windows XP SP3, 1.5.0_17, JRuby 1.5.2
            Reporter: Satoru Chinen
         Attachments: java_class.rb.patch

Yesterday I built the mirah(http://www.mirah.org/) .
I thought it was an easy task.
However, I was encountered the following error message.

{noformat}
D:\opt\mirah\mirah>jruby -S rake jar
(in D:/opt/mirah/mirah)
mkdir -p dist
mkdir -p build
Compiling Ruby sources
Generating Java class MirahCommand to build/org/mirah/MirahCommand.java
javac -J-Duser.language=en -d build -cp 
D:\opt\jruby\jruby-1.5.2/lib/jruby.jar:. build/org/mirah/MirahCommand.java
build/org/mirah/MirahCommand.java:3: package org.jruby does not exist
import org.jruby.Ruby;
(snip)
29 errors
Compiling Mirah sources
org/mirah/ant/compile.duby:4: Class 'org.mirah.MirahCommand' not found.
import org.mirah.MirahCommand
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
{noformat}

I looked for the cause of this error, and found it.

{noformat}
--- lib\ruby\site_ruby\shared\jruby\compiler\java_class.rb.orig 2010-08-20 
14:37:58.000000000 +0900
+++ lib\ruby\site_ruby\shared\jruby\compiler\java_class.rb      2010-08-31 
12:25:25.438906800 +0900
@@ -15,8 +15,9 @@
       jruby_jar, = ['jruby.jar', 'jruby-complete.jar'].select do |jar|
         File.exist? "#{ENV_JAVA['jruby.home']}/lib/#{jar}"
       end
-      classpath_string = options[:classpath].size > 0 ? 
options[:classpath].join(":") : "."
-      compile_string = "javac #{options[:javac_options].join(' ')} -d 
#{options[:target]} -cp 
#{ENV_JAVA['jruby.home']}/lib/#{jruby_jar}:#{classpath_string} #{files_string}"
+      ps = ENV_JAVA['path.separator']
+      classpath_string = options[:classpath].size > 0 ? 
options[:classpath].join(ps) : "."
+      compile_string = "javac #{options[:javac_options].join(' ')} -d 
#{options[:target]} -cp 
#{ENV_JAVA['jruby.home']}/lib/#{jruby_jar}#{ps}#{classpath_string} 
#{files_string}"
 
       compile_string
     end
{noformat}

JRuby::Compiler / JavaGenerator / generate_javac always was used colon 
character for path separator,
But the path separator of Windows platform is semi colon.

I made above patch file, and patched to java_class.rb .
this patch is works fine.

Please fix this problem.


-- 
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


Reply via email to