Details
-
Type:
Task
-
Status:
Closed
-
Priority:
Major
-
Resolution: Won't Fix
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Projects
-
Labels:None
-
Number of attachments :
Description
RCR 328 calls for a method to be added to Kernel specifically for launching additional Ruby scripts. This is to allow the possibility of launching those scripts in ways other than launching an external process.
This issue arose when we started running Rake scripts that included many unit tests. The default Rake behavior is to launch a separate process, which for JRuby was an unreasonable thing to do. We added hacks and tricks into our Kernel#system call to prevent Ruby scripts from launching out-of-process, but this solution is far from ideal. What would be best is if there were a Kernel method allowing you to simply launch a script in its own environment.
Ruby 1.8 would just follow the current path, launching a separate Ruby process to run the script.
JRuby would launch a new runtime in the same JVM, as we do with the Kernel#system hacks.
YARV would follow a similar approach, launching another YARV VM in the same process.
_why has also been working on a Ruby sandbox, which could easily be used to provide some level of Ruby MVM in the 1.8 series. He has expressed his support for RCR 328.
We need to work with the Ruby-core folks and others interested in this RCR to come up with a reasonable API, and ideally a patch for 1.8 to get it included. Once it's there, we need to work Rake and other application authors to have them migrate to using this new API for launching scripts, so that at some point in the future we'll be able to remove our Kernel#system hacks.
Note that the RCRchive has been completely flushed out, and Matz wants everyone to resubmit any RCRs they really want to see. However those RCRs will probably never be in Ruby 1.8.
This bug may also be expanded to help Rake developers find a better way to launch external scripts under JRuby, avoiding the need for our Kernel.system hacks.