jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • JRuby
  • JRUBY-4530

cannot run 'rake test' from jruby-complete.jar

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: JRuby 1.4
  • Fix Version/s: JRuby 1.6.1
  • Component/s: Windows
  • Labels:
    None
  • Environment:
    Windows Vista 64

Description

I am trying to run 'rake test' against a rails app using jruby-complete.jar but it fails.

Running rake test with jruby install works fine like this:
c:\jruby\jruby-1.4.0\bin\jruby -S rake test

However, running with jruby-complete like this:
java -jar c:\projects\X\build\jruby-complete-1.4.0.jar -S rake
test

yields an error:

file:/C:/projects/X/build/jruby-complete-1.4.0.jar!/META-INF/jruby.home/bin/jruby.exe
-I"lib;test" "C:/projects/X/SVNROOT/jruby/gems/rake-0.8.7/lib/
rake/rake_test_loader.rb" "test/unit/user_test.rb" <...>

The filename, directory name, or volume label syntax is incorrect.

Issue Links

relates to

Bug - A problem which impairs or prevents the functions of the product. JRUBY-4238 rake spec does not work with jruby-complete.jar

  • Minor - Minor loss of function, or other problem where easy workaround is present.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Charles Oliver Nutter added a comment - 01/Feb/10 3:15 PM

Ok, now the obvious question I should have asked you first: have you tried against JRuby 1.5 dev snapshots?

Check out http://ci.jruby.org/snapshots

Show
Charles Oliver Nutter added a comment - 01/Feb/10 3:15 PM Ok, now the obvious question I should have asked you first: have you tried against JRuby 1.5 dev snapshots? Check out http://ci.jruby.org/snapshots
Hide
Permalink
Homer Simpson added a comment - 01/Feb/10 3:28 PM

Yes - same error using jruby-complete-1.5.0.dev.jar

Show
Homer Simpson added a comment - 01/Feb/10 3:28 PM Yes - same error using jruby-complete-1.5.0.dev.jar
Hide
Permalink
Charles Oliver Nutter added a comment - 01/Feb/10 3:28 PM

Could it be related to this: http://jira.codehaus.org/browse/JRUBY-4249

Show
Charles Oliver Nutter added a comment - 01/Feb/10 3:28 PM Could it be related to this: http://jira.codehaus.org/browse/JRUBY-4249
Hide
Permalink
Vladimir Sizikov added a comment - 01/Feb/10 3:35 PM

At first sight, this looks like an issue, closely related to JRUBY-4238.

Show
Vladimir Sizikov added a comment - 01/Feb/10 3:35 PM At first sight, this looks like an issue, closely related to JRUBY-4238.
Hide
Permalink
Vladimir Sizikov added a comment - 01/Feb/10 3:41 PM

Will take a look. I was pretty sure that this is fixed on master branch, but maybe there is some other place that breaks for test, but works for spec.

Show
Vladimir Sizikov added a comment - 01/Feb/10 3:41 PM Will take a look. I was pretty sure that this is fixed on master branch, but maybe there is some other place that breaks for test, but works for spec.
Hide
Permalink
Vladimir Sizikov added a comment - 07/Feb/10 6:28 AM

OK, can reproduce the problem with the latest JRuby from master branch.

The problem is that Rake on Windows uses a rather weird way to launch ruby to execute tests, specifically: "call path_to_ruby ...". In this special case, when the first entry is 'call', JRuby's in-process launching magic doesn't work, since it works only when the first parameter is some kind of ruby, not 'call'.

Not sure how to proceed here. We probably could hack-up some solution to add 'call' case to in-process detection magic, but this feels really hacky solution... Any opinions?

Alternatively, one could submit some patch to Rake itself, but again, not clear what that could be. Running rake in such a weird envirenment like from within jruby-complete.jar on Windows won't probably be significant enough to change Rake...

The only workaround on Windows at the moment is to use proper JRuby, not jruby-complete.jar....

Show
Vladimir Sizikov added a comment - 07/Feb/10 6:28 AM OK, can reproduce the problem with the latest JRuby from master branch. The problem is that Rake on Windows uses a rather weird way to launch ruby to execute tests, specifically: "call path_to_ruby ...". In this special case, when the first entry is 'call', JRuby's in-process launching magic doesn't work, since it works only when the first parameter is some kind of ruby, not 'call'. Not sure how to proceed here. We probably could hack-up some solution to add 'call' case to in-process detection magic, but this feels really hacky solution... Any opinions? Alternatively, one could submit some patch to Rake itself, but again, not clear what that could be. Running rake in such a weird envirenment like from within jruby-complete.jar on Windows won't probably be significant enough to change Rake... The only workaround on Windows at the moment is to use proper JRuby, not jruby-complete.jar....
Hide
Permalink
Charles Oliver Nutter added a comment - 09/Mar/10 2:49 AM

Special-casing "call" does seem pretty hacky. Is "call" a standard windows thing? I don't remember ever using it.

We don't have any patches for Rake at all right now...so I'd prefer we try to get this patched in Rake itself. I think Jim Weirich would be open to any fix that seems appropriate, but I have not looked closely enough at the problem to know what to suggest...

Show
Charles Oliver Nutter added a comment - 09/Mar/10 2:49 AM Special-casing "call" does seem pretty hacky. Is "call" a standard windows thing? I don't remember ever using it. We don't have any patches for Rake at all right now...so I'd prefer we try to get this patched in Rake itself. I think Jim Weirich would be open to any fix that seems appropriate, but I have not looked closely enough at the problem to know what to suggest...
Hide
Permalink
Charles Oliver Nutter added a comment - 08/Apr/10 12:25 AM

I think we need to involve the Rake folks on this. Rake needs a better way to launch whatever Ruby it's running in, probably by calling into a core method of some kind like Kernel.launch_ruby, which would allow us to do the right thing depending on how we're being run. This is a systemic problem with a lot of Ruby programs that launch "sub rubies", since they won't ever work with anything that isn't called "ruby" or doesn't have a normal executable on disk.

Homer: I'm bumping this off JRuby 1.5, since it's obviously not something we're going to be able to work out with the Rake guys. If you're really interested in making this work, we will help coordinate with the Rake folks on how to make this work. I have a picture in my head of how it should look, but we need someone like you to own the task of making this move forward.

Show
Charles Oliver Nutter added a comment - 08/Apr/10 12:25 AM I think we need to involve the Rake folks on this. Rake needs a better way to launch whatever Ruby it's running in, probably by calling into a core method of some kind like Kernel.launch_ruby, which would allow us to do the right thing depending on how we're being run. This is a systemic problem with a lot of Ruby programs that launch "sub rubies", since they won't ever work with anything that isn't called "ruby" or doesn't have a normal executable on disk. Homer: I'm bumping this off JRuby 1.5, since it's obviously not something we're going to be able to work out with the Rake guys. If you're really interested in making this work, we will help coordinate with the Rake folks on how to make this work. I have a picture in my head of how it should look, but we need someone like you to own the task of making this move forward.
Hide
Permalink
Ketan Padegaonkar added a comment - 03/May/11 7:32 PM

Here's our 'patch' for this problem:

# put this in RAILS_ROOT/lib/rake/tasks or rakelib
$ cat lib/tasks/rake_patch.rake

# http://jira.codehaus.org/browse/JRUBY-4530
# when using jruby-complete.jar, FileUtils::RUBY is the <bindir inside the jar>/jruby.exe
# we 'fix' this by overwriting the path here
if defined?(JRUBY_VERSION)
  module FileUtils
    RUBY = "#{Rails.root}/jruby#{'.bat' if Config::CONFIG['host_os'] =~ /mswin/}"
  end
end


Show
Ketan Padegaonkar added a comment - 03/May/11 7:32 PM Here's our 'patch' for this problem:
# put this in RAILS_ROOT/lib/rake/tasks or rakelib
$ cat lib/tasks/rake_patch.rake

# http://jira.codehaus.org/browse/JRUBY-4530
# when using jruby-complete.jar, FileUtils::RUBY is the <bindir inside the jar>/jruby.exe
# we 'fix' this by overwriting the path here
if defined?(JRUBY_VERSION)
  module FileUtils
    RUBY = "#{Rails.root}/jruby#{'.bat' if Config::CONFIG['host_os'] =~ /mswin/}"
  end
end


Hide
Permalink
Hiro Asari added a comment - 09/Feb/12 12:20 AM

I believe this was fixed along with JRUBY-5576.

Show
Hiro Asari added a comment - 09/Feb/12 12:20 AM I believe this was fixed along with JRUBY-5576.

People

  • Assignee:
    Hiro Asari
    Reporter:
    Homer Simpson
Vote (0)
Watch (1)

Dates

  • Created:
    01/Feb/10 2:52 PM
    Updated:
    09/Feb/12 12:20 AM
    Resolved:
    09/Feb/12 12:20 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.