Commit cad1845a authored by Bruce Dawson's avatar Bruce Dawson Committed by Commit Bot

Show failure codes in run.py

If mksnapshot fails then all that is printed is
    "FAILED: gen/v8/embedded.S snapshot_blob.bin"
and the command line. That complicates the investigation. Printing the
error code in run.py can help. The printing code handles large negative
numbers specially so that special Windows failure codes like 0xC0000005
are recognizable.

This code was tested by adding this early-out to main in mksnapshot.cc.

  if (argc < 1000)
    return 0xc0000005;

Bug: Chromium:1095767
Change-Id: I5dc81d368beaa339f0c519ce1c01bd13cdb18d93
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2249518
Auto-Submit: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: 's avatarJochen Eisinger <jochen@chromium.org>
Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68395}
parent e0c1a349
...@@ -6,7 +6,18 @@ ...@@ -6,7 +6,18 @@
"""This program wraps an arbitrary command since gn currently can only execute """This program wraps an arbitrary command since gn currently can only execute
scripts.""" scripts."""
from __future__ import print_function
import subprocess import subprocess
import sys import sys
sys.exit(subprocess.call(sys.argv[1:])) result = subprocess.call(sys.argv[1:])
if result != 0:
# Windows error codes such as 0xC0000005 and 0xC0000409 are much easier
# to recognize and differentiate in hex.
if result < -100:
# Print negative hex numbers as positive by adding 2^32.
print('Return code is %08X' % (result + 2**32))
else:
print('Return code is %d' % result)
sys.exit(result)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment