mirror of
git://slackware.nl/current.git
synced 2025-02-11 08:48:30 +01:00
46 lines
1.5 KiB
Diff
46 lines
1.5 KiB
Diff
|
|
diff --git a/python/mozbuild/mozbuild/action/node.py b/python/mozbuild/mozbuild/action/node.py
|
|
--- a/python/mozbuild/mozbuild/action/node.py
|
|
+++ b/python/mozbuild/mozbuild/action/node.py
|
|
@@ -47,24 +47,35 @@ def execute_node_cmd(node_cmd_list):
|
|
printed to stderr instead.
|
|
"""
|
|
|
|
try:
|
|
printable_cmd = ' '.join(pipes.quote(arg) for arg in node_cmd_list)
|
|
print('Executing "{}"'.format(printable_cmd), file=sys.stderr)
|
|
sys.stderr.flush()
|
|
|
|
- output = subprocess.check_output(node_cmd_list)
|
|
+ # We need to redirect stderr to a pipe because
|
|
+ # https://github.com/nodejs/node/issues/14752 causes issues with make.
|
|
+ proc = subprocess.Popen(
|
|
+ node_cmd_list, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
|
+
|
|
+ stdout, stderr = proc.communicate()
|
|
+ retcode = proc.wait()
|
|
+
|
|
+ if retcode != 0:
|
|
+ print(stderr, file=sys.stderr)
|
|
+ sys.stderr.flush()
|
|
+ sys.exit(retcode)
|
|
|
|
# Process the node script output
|
|
#
|
|
# XXX Starting with an empty list means that node scripts can
|
|
# (intentionally or inadvertently) remove deps. Do we want this?
|
|
deps = []
|
|
- for line in output.splitlines():
|
|
+ for line in stdout.splitlines():
|
|
if 'dep:' in line:
|
|
deps.append(line.replace('dep:', ''))
|
|
else:
|
|
print(line, file=sys.stderr)
|
|
sys.stderr.flush()
|
|
|
|
return set(deps)
|
|
|
|
|
|
|
|
|
|
|