|
| 1 | +diff --git a/python/mozbuild/mozbuild/action/node.py b/python/mozbuild/mozbuild/action/node.py |
| 2 | +--- a/python/mozbuild/mozbuild/action/node.py |
| 3 | ++++ b/python/mozbuild/mozbuild/action/node.py |
| 4 | +@@ -1,19 +1,20 @@ |
| 5 | + # This Source Code Form is subject to the terms of the Mozilla Public |
| 6 | + # License, v. 2.0. If a copy of the MPL was not distributed with this |
| 7 | + # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 8 | + |
| 9 | +-import pipes |
| 10 | + import subprocess |
| 11 | + import sys |
| 12 | + |
| 13 | + import buildconfig |
| 14 | + import six |
| 15 | + |
| 16 | ++from mozbuild.shellutil import quote as shell_quote |
| 17 | ++ |
| 18 | + SCRIPT_ALLOWLIST = [buildconfig.topsrcdir + "/devtools/client/shared/build/build.js"] |
| 19 | + |
| 20 | + ALLOWLIST_ERROR = """ |
| 21 | + %s is not |
| 22 | + in SCRIPT_ALLOWLIST in python/mozbuild/mozbuild/action/node.py. |
| 23 | + Using NodeJS from moz.build is currently in beta, and node |
| 24 | + scripts to be executed need to be added to the allowlist and |
| 25 | + reviewed by a build peer so that we can get a better sense of |
| 26 | +@@ -42,18 +43,17 @@ def execute_node_cmd(node_cmd_list): |
| 27 | + |
| 28 | + The node script is expected to output lines for all of the dependencies |
| 29 | + to stdout, each prefixed by the string "dep:". These lines will make up |
| 30 | + the returned set of dependencies. Any line not so-prefixed will simply be |
| 31 | + printed to stderr instead. |
| 32 | + """ |
| 33 | + |
| 34 | + try: |
| 35 | +- printable_cmd = " ".join(pipes.quote(arg) for arg in node_cmd_list) |
| 36 | +- print('Executing "{}"'.format(printable_cmd), file=sys.stderr) |
| 37 | ++ print('Executing "{}"'.format(shell_quote(*node_cmd_list)), file=sys.stderr) |
| 38 | + sys.stderr.flush() |
| 39 | + |
| 40 | + # We need to redirect stderr to a pipe because |
| 41 | + # https://github.com/nodejs/node/issues/14752 causes issues with make. |
| 42 | + proc = subprocess.Popen( |
| 43 | + node_cmd_list, stdout=subprocess.PIPE, stderr=subprocess.PIPE |
| 44 | + ) |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
0 commit comments