Opened 7 years ago

Closed 7 years ago

#15401 closed defect (fixed)

Build no longer propagates exit code to shell when using node 0.6+

Reported by: Ben Lowery Owned by: Rawld Gill
Priority: high Milestone: 1.8
Component: BuildSystem Version: 1.7.2
Keywords: Cc:
Blocked By: Blocking:

Description

Node 0.6+ no longer fires 'close' on the stdout stream when closing, but it does wait for stdout to drain before exiting. The node variant of the build hooks 'close' to set the process exit code, but since this event no longer fires, it never gets set.

Attached is a patch that properly exits the process, setting the exit code in a backwards compat way. If we only care about the current version of node, we can drop the try.

CLA on file, etc.

Attachments (1)

process.patch (881 bytes) - added by Ben Lowery 7 years ago.
patch against util

Download all attachments as: .zip

Change History (4)

Changed 7 years ago by Ben Lowery

Attachment: process.patch added

patch against util

comment:1 Changed 7 years ago by Rawld Gill

Milestone: tbd1.8
Priority: undecidedhigh
Status: newassigned

comment:2 Changed 7 years ago by Rawld Gill

Somewhere along the way in node's evolution, stdout became blocking. I'm not sure that it was nonblocking in some early versions was intentional, a bug, or some anomaly on the systems I was developing on. In any event, the hack of necessarily waiting for stdout to drain before calling exit is no longer required so I'm going to remove that whole idea to keep the code clean.

If someone happens to be using a very old version of node.js that doesn't drain stdout, and consequently, is missing output, then the soln is to upgrade to a current version of node.js.

comment:3 Changed 7 years ago by Rawld Gill

Resolution: fixed
Status: assignedclosed

In [29081]:

don't wait for stdout close event in node since modern node.js never fires that event; fixes #15401; !strict

Note: See TracTickets for help on using tickets.