diff options
author | plundblad <plundblad@chromium.org> | 2015-08-27 12:58:40 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-27 19:59:46 +0000 |
commit | 2cadf1ff8e88b5471c0926ee247af5eb6eb297e6 (patch) | |
tree | 14dff4913dad7f336768af1e9625a00fc0a4b59c /tools/gypv8sh.py | |
parent | 454c57b9ca037103c2ffdbf77b2f111e30d2fcc6 (diff) | |
download | chromium_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-x | tools/gypv8sh.py | 3 |
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) |