Details

    • Type: Bug Bug
    • Status: Closed Closed
    • 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
    • Number of attachments :
      0

      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

          Activity

          Hide
          Charles Oliver Nutter added a comment -

          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 - 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
          Homer Simpson added a comment -

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

          Show
          Homer Simpson added a comment - Yes - same error using jruby-complete-1.5.0.dev.jar
          Hide
          Charles Oliver Nutter added a comment -

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

          Show
          Charles Oliver Nutter added a comment - Could it be related to this: http://jira.codehaus.org/browse/JRUBY-4249
          Hide
          Vladimir Sizikov added a comment -

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

          Show
          Vladimir Sizikov added a comment - At first sight, this looks like an issue, closely related to JRUBY-4238 .
          Hide
          Vladimir Sizikov added a comment -

          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 - 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
          Vladimir Sizikov added a comment -

          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 - 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
          Charles Oliver Nutter added a comment -

          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 - 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
          Charles Oliver Nutter added a comment -

          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 - 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
          Ketan Padegaonkar added a comment -

          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 - 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
          Hiro Asari added a comment -

          I believe this was fixed along with JRUBY-5576.

          Show
          Hiro Asari added a comment - I believe this was fixed along with JRUBY-5576 .

            People

            • Assignee:
              Hiro Asari
              Reporter:
              Homer Simpson
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: