Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: JRuby 1.6.5
    • Fix Version/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Process.spawn ignores the :chdir option:

      jruby-1.6.5 :028 > Process.spawn("pwd", :chdir => '/tmp')
      /Users/ddeleo/code/tevatron
       => 28210 
      
      
      ruby-1.9.3-p0 :001 > Process.spawn("pwd", :chdir => '/tmp')
       => 28244 
      ruby-1.9.3-p0 :002 > /private/tmp
      

      If I'm following the code correctly, these methods get delegated to runExternal in ShellLauncher which hard-codes the directory to the current working directory:

      File pwd = new File(runtime.getCurrentDirectory());
      

      I'm not sure if this is related to JRUBY-5710 since the description is a bit vague there.

        Issue Links

          Activity

          Hide
          Hiro Asari added a comment -

          As mentioned in JRUBY-5710, open3 uses Process#spawn with option hash, which should be processed.

          Show
          Hiro Asari added a comment - As mentioned in JRUBY-5710 , open3 uses Process#spawn with option hash, which should be processed.
          Hide
          Charles Oliver Nutter added a comment -

          Definitely a known issue. Some of these options may not be supportable without a lot of work, since we can't fork + exec like MRI.

          Show
          Charles Oliver Nutter added a comment - Definitely a known issue. Some of these options may not be supportable without a lot of work, since we can't fork + exec like MRI.
          Hide
          Hiro Asari added a comment -

          Should we warn about the incoming option hash, though? Users may expect different behavior.

          Show
          Hiro Asari added a comment - Should we warn about the incoming option hash, though? Users may expect different behavior.
          Hide
          Charles Oliver Nutter added a comment -

          I did add logic on master to warn when there are options we don't support, but I'm not sure if we want to warn in 1.6.x at this point since it would be a visible behavioral change. 1.6.6 should have better support for the various options, at least.

          Show
          Charles Oliver Nutter added a comment - I did add logic on master to warn when there are options we don't support, but I'm not sure if we want to warn in 1.6.x at this point since it would be a visible behavioral change. 1.6.6 should have better support for the various options, at least.
          Hide
          Charles Oliver Nutter added a comment -

          Parts of this are fixed in 1.7.0, but there are still many options we don't (and maybe can't) support.

          Easiest way to support some of the redirecting options would be to use Java 7 process APIs, like we're doing now for backquote. Bumping to 1.7.1 for continued work.

          Show
          Charles Oliver Nutter added a comment - Parts of this are fixed in 1.7.0, but there are still many options we don't (and maybe can't) support. Easiest way to support some of the redirecting options would be to use Java 7 process APIs, like we're doing now for backquote. Bumping to 1.7.1 for continued work.

            People

            • Assignee:
              Unassigned
              Reporter:
              Daniel DeLeo
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: