summaryrefslogtreecommitdiffstats
path: root/tools/gypv8sh.py
diff options
context:
space:
mode:
authorplundblad <plundblad@chromium.org>2015-08-27 12:58:40 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-27 19:59:46 +0000
commit2cadf1ff8e88b5471c0926ee247af5eb6eb297e6 (patch)
tree14dff4913dad7f336768af1e9625a00fc0a4b59c /tools/gypv8sh.py
parent454c57b9ca037103c2ffdbf77b2f111e30d2fcc6 (diff)
downloadchromium_src-2cadf1ff8e88b5471c0926ee247af5eb6eb297e6.zip
chromium_src-2cadf1ff8e88b5471c0926ee247af5eb6eb297e6.tar.gz
chromium_src-2cadf1ff8e88b5471c0926ee247af5eb6eb297e6.tar.bz2
Improve error handling for js2gtest C++ generation.
Previously, an error in a javascript file would cause the error to be written to the -gen.cc file and fed to the C++ compiler (rarely accepts such output as valid C++). This change causes the generation build action to fail and the error to be output to the stderr of the ninja process instead. Also, stack traces are improved by annotating eval'd files with sourceURL comments when running the generator. BUG=None Review URL: https://codereview.chromium.org/1299893002 Cr-Commit-Position: refs/heads/master@{#345964}
Diffstat (limited to 'tools/gypv8sh.py')
-rwxr-xr-xtools/gypv8sh.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/gypv8sh.py b/tools/gypv8sh.py
index 2a1fada..d1f246c 100755
--- a/tools/gypv8sh.py
+++ b/tools/gypv8sh.py
@@ -65,6 +65,9 @@ def main ():
p = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, bufsize=0)
out, err = p.communicate()
+ if p.returncode != 0:
+ sys.stderr.write(out + err);
+ return 1
if not HasSameContent(cxxoutfile, out):
with open(cxxoutfile, 'wb') as f:
f.write(out)