summaryrefslogtreecommitdiff
path: root/source/xap/mozilla-thunderbird/firefox.node.py.patch
blob: 11e2b843b0615e736cedbdaf057410d6ae029557 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46

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)