modules/ringo/subprocess.js

32 views
Skip to first unread message

Russ Tremain

unread,
Dec 1, 2015, 7:17:23 PM12/1/15
to rin...@googlegroups.com
was testing the subprocess.js "system" function and it has a problem, partially fixed by following:

$ diff -c subprocess.js tmp/modules/ringo/subprocess.js
*** subprocess.js       Tue Dec  1 15:39:40 2015
--- tmp/modules/ringo/subprocess.js     Tue Dec  1 15:40:36 2015
***************
*** 169,176 ****
  exports.system = function() {
      var args = parseArguments(arguments);
      var process = createProcess(args);
!     var output = system.stdout,
!         errput = system.stderr;
      if (args.binary) {
          output = output.raw;
          errput = errput.raw;
--- 169,176 ----
  exports.system = function() {
      var args = parseArguments(arguments);
      var process = createProcess(args);
!     var output = process.stdout,
!         errput = process.stderr;
      if (args.binary) {
          output = output.raw;
          errput = errput.raw;
however, now I get another error:

$ cat xx.js
var proc = require("ringo/subprocess");
//okay
print(proc.command("pwd"));
proc.system("pwd");

$ ringo xx.js
/Users/russt/proj/jsfun

Wrapped java.util.concurrent.ExecutionException: org.mozilla.javascript.JavaScriptException: Error: The TextStream is not writable! (io.js#514)
        at ringo/subprocess.js:114 (anonymous)
        at ringo/subprocess.js:183 (anonymous)
        at /Users/russt/proj/jsfun/xx.js:4

not sure what is going on there.. it is inheriting i/o streams from parent process, or so it looks like to me.

/russt

Philipp Naderer

unread,
Dec 2, 2015, 6:05:17 AM12/2/15
to rin...@googlegroups.com
Hi Russ!

The bug has been fixed with the recent master commits. The system module was preloaded in older Ringo releases, but this behavior has been dropped in 0.11. The effect on the subprocess.system(): system.out has been undefined.

The fix:

Thanks for spotting this bug! If you want to use Ringo 0.11, you can backport this manually. We will release 0.12 in the next weeks (after more testing it with bigger application deployments), then the fix ships by default.

Bye,
Philipp

--
You received this message because you are subscribed to the Google Groups "RingoJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ringojs+u...@googlegroups.com.
To post to this group, send email to rin...@googlegroups.com.
Visit this group at http://groups.google.com/group/ringojs.
For more options, visit https://groups.google.com/d/optout.

Russ Tremain

unread,
Dec 2, 2015, 12:51:47 PM12/2/15
to rin...@googlegroups.com, rin...@googlegroups.com, Philipp Naderer
Hi Philipp,

Fix verified - thanks for the quick response!

cheers,
-Russ
Reply all
Reply to author
Forward
0 new messages