[gm.py] Support embedded builtins or missing build.ninja
This patch adds two improvements to gm.py: (1) Fix "mksnapshot failure" detection to match the error message that is generated when embedded builtins are enabled. (2) Run "gn gen" whenever build.ninja is missing. This can happen when out/<config>/args.gn exists already when gm.py is run for the first time. Bug: v8:6666, v8:8335 Change-Id: I71836b832754fa21b6443d57a6c3c49718a9a8d1 Reviewed-on: https://chromium-review.googlesource.com/c/1294174 Reviewed-by: Jakob Gruber <jgruber@chromium.org> Commit-Queue: Jakob Kummerow <jkummerow@chromium.org> Cr-Commit-Position: refs/heads/master@{#56918}
This commit is contained in:
parent
2552c747dc
commit
f5e13b2bf6
@ -244,11 +244,13 @@ class Config(object):
|
||||
def Build(self):
|
||||
path = GetPath(self.arch, self.mode)
|
||||
args_gn = os.path.join(path, "args.gn")
|
||||
build_ninja = os.path.join(path, "build.ninja")
|
||||
if not os.path.exists(path):
|
||||
print("# mkdir -p %s" % path)
|
||||
os.makedirs(path)
|
||||
if not os.path.exists(args_gn):
|
||||
_Write(args_gn, self.GetGnArgs())
|
||||
if not os.path.exists(build_ninja):
|
||||
code = _Call("gn gen %s" % path)
|
||||
if code != 0: return code
|
||||
targets = " ".join(self.targets)
|
||||
@ -270,6 +272,21 @@ class Config(object):
|
||||
"--random-seed 314159265 "
|
||||
"--startup-blob %(path)s/snapshot_blob.bin"
|
||||
"%(extra)s"% {"path": path, "extra": extra_opt})
|
||||
if (return_code != 0 and
|
||||
"FAILED: gen/embedded.cc snapshot_blob.bin" in output):
|
||||
csa_trap = re.compile("Specify option( --csa-trap-on-node=[^ ]*)")
|
||||
match = csa_trap.search(output)
|
||||
extra_opt = match.group(1) if match else ""
|
||||
_Notify("V8 build requires your attention",
|
||||
"Detected mksnapshot failure, re-running in GDB...")
|
||||
_Call("gdb -args %(path)s/mksnapshot "
|
||||
"--turbo-instruction-scheduling "
|
||||
"--embedded_src %(path)s/gen/embedded.cc "
|
||||
"--embedded_variant Default "
|
||||
"--startup_src %(path)s/gen/snapshot.cc "
|
||||
"--random-seed 314159265 "
|
||||
"--startup-blob %(path)s/snapshot_blob.bin"
|
||||
"%(extra)s"% {"path": path, "extra": extra_opt})
|
||||
return return_code
|
||||
|
||||
def RunTests(self):
|
||||
|
Loading…
Reference in New Issue
Block a user