Commit 047f91b8 authored by Michael Achenbach's avatar Michael Achenbach Committed by V8 LUCI CQ

[foozzie] Augment launcher script to bisect to bugs before Python3 switch

Bugs that are older than the switch of v8_foozzie.py to Python3
bisect to the switch commit unfortunately. This change attempts to
let bisect run longer if a python2 executable still exists.

No-Try: true
Bug: chromium:1355824
Change-Id: I457a50af21704ddd2985793861eee8be5601a673
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3856574Reviewed-by: 's avatarLiviu Rau <liviurau@google.com>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82728}
parent 4d66d9a5
......@@ -14,9 +14,17 @@ for a transition period.
import os
import re
import shutil
import subprocess
import sys
def find_harness_code(args):
for arg in args:
if arg.endswith('v8_foozzie.py'):
with open(arg) as f:
return f.read()
assert False, 'Foozzie harness not found'
if __name__ == '__main__':
# In some cases or older versions, the python executable is passed as
# first argument. Let's be robust either way, with or without full
......@@ -25,7 +33,18 @@ if __name__ == '__main__':
args = sys.argv[2:]
else:
args = sys.argv[1:]
process = subprocess.Popen(['python3'] + args)
python_exe = 'python3'
# To ease bisection of really old bugs, attempt to use Python2 as long
# as it is supported. This enables bisection before the point where the
# harness switched to Python3.
script = find_harness_code(args)
use_python3 = script.startswith('#!/usr/bin/env python3')
if not use_python3 and shutil.which('python2'):
python_exe = 'python2'
process = subprocess.Popen([python_exe] + args)
process = subprocess.Popen(args)
process.communicate()
sys.exit(process.returncode)
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