Chromium Code Reviews| Index: tools/bisect-builds.py |
| =================================================================== |
| --- tools/bisect-builds.py (revision 233008) |
| +++ tools/bisect-builds.py (working copy) |
| @@ -29,7 +29,7 @@ |
| 'changelog?old_version=%s&new_version=%s' |
| # DEPS file URL. |
| -DEPS_FILE= 'http://src.chromium.org/viewvc/chrome/trunk/src/DEPS?revision=%d' |
| +DEPS_FILE = 'http://src.chromium.org/viewvc/chrome/trunk/src/DEPS?revision=%d' |
| # Blink Changelogs URL. |
| BLINK_CHANGELOG_URL = 'http://build.chromium.org/f/chromium/' \ |
| 'perf/dashboard/ui/changelog_blink.html?' \ |
| @@ -43,10 +43,8 @@ |
| ############################################################################### |
| import json |
| -import math |
| import optparse |
| import os |
| -import pipes |
| import re |
| import shlex |
| import shutil |
| @@ -64,7 +62,7 @@ |
| """A PathContext is used to carry the information used to construct URLs and |
| paths when dealing with the storage server and archives.""" |
| def __init__(self, base_url, platform, good_revision, bad_revision, |
| - is_official, is_aura): |
| + is_official, is_aura, flash_path = None): |
| super(PathContext, self).__init__() |
| # Store off the input parameters. |
| self.base_url = base_url |
| @@ -73,6 +71,7 @@ |
| self.bad_revision = bad_revision |
| self.is_official = is_official |
| self.is_aura = is_aura |
| + self.flash_path = flash_path |
| # The name of the ZIP file in a revision directory on the server. |
| self.archive_name = None |
| @@ -287,16 +286,16 @@ |
| pass |
| return final_list |
| -def UnzipFilenameToDir(filename, dir): |
| - """Unzip |filename| to directory |dir|.""" |
| +def UnzipFilenameToDir(filename, directory): |
| + """Unzip |filename| to |directory|.""" |
| cwd = os.getcwd() |
| if not os.path.isabs(filename): |
| filename = os.path.join(cwd, filename) |
| zf = zipfile.ZipFile(filename) |
| # Make base. |
| - if not os.path.isdir(dir): |
| - os.mkdir(dir) |
| - os.chdir(dir) |
| + if not os.path.isdir(directory): |
| + os.mkdir(directory) |
| + os.chdir(directory) |
| # Extract files. |
| for info in zf.infolist(): |
| name = info.filename |
| @@ -304,9 +303,9 @@ |
| if not os.path.isdir(name): |
| os.makedirs(name) |
| else: # file |
| - dir = os.path.dirname(name) |
| - if not os.path.isdir(dir): |
| - os.makedirs(dir) |
| + directory = os.path.dirname(name) |
| + if not os.path.isdir(directory): |
| + os.makedirs(directory) |
| out = open(name, 'wb') |
| out.write(zf.read(name)) |
| out.close() |
| @@ -362,9 +361,19 @@ |
| # Run the build as many times as specified. |
| testargs = ['--user-data-dir=%s' % profile] + args |
| + if context.flash_path: |
| + testargs.append('--flag-switches-begin') |
|
Robert Sesek
2013/11/08 18:35:44
Why do you need --flag-switches-begin?
ilja
2013/11/08 19:38:39
I will try this on Windows again, I thought it nee
|
| # The sandbox must be run as root on Official Chrome, so bypass it. |
| - if context.is_official and context.platform.startswith('linux'): |
| + if (context.is_official and context.platform.startswith('linux') or |
| + context.flash_path): |
|
Robert Sesek
2013/11/08 18:35:44
Is this the intended condition? Can you add anothe
|
| testargs.append('--no-sandbox') |
| + if context.flash_path: |
| + testargs.append('--ppapi-flash-path=%s' % context.flash_path) |
| + # We have to pass a large enough Flash version, which currently needs not |
| + # be correct. Instead of requiring the user of the script to figure out and |
| + # pass the correct version we just spoof it. |
| + testargs.append('--ppapi-flash-version=99.9.999.999') |
|
enne (OOO)
2013/11/07 23:05:23
Is this impossible to do in Chrome?
ilja
2013/11/08 06:07:39
Yes. It actually is a command line parameter that
|
| + testargs.append('--flag-switches-end') |
| runcommand = [] |
| for token in shlex.split(command): |
| @@ -452,6 +461,7 @@ |
| command="%p %a", |
| try_args=(), |
| profile=None, |
| + flash_path=None, |
| evaluate=AskIsGoodBuild): |
| """Given known good and known bad revisions, run a binary search on all |
| archived revisions to determine the last known good revision. |
| @@ -485,7 +495,7 @@ |
| profile = 'profile' |
| context = PathContext(base_url, platform, good_rev, bad_rev, |
| - official_builds, is_aura) |
| + official_builds, is_aura, flash_path) |
| cwd = os.getcwd() |
| print "Downloading list of known revisions..." |
| @@ -554,7 +564,7 @@ |
| command, |
| try_args) |
| except Exception, e: |
| - print >>sys.stderr, e |
| + print >> sys.stderr, e |
| # Call the evaluate function to see if the current revision is good or bad. |
| # On that basis, kill one of the background downloads and complete the |
| @@ -721,6 +731,11 @@ |
| help = 'A bad revision to start bisection. ' + |
| 'May be earlier or later than the good revision. ' + |
| 'Default is HEAD.') |
| + parser.add_option('-f', '--flash_path', type = 'str', |
| + help = 'Absolute path to a recent Adobe Pepper Flash ' + |
| + 'binary to be used in this bisection (e.g. ' + |
| + 'on Windows C:\...\pepflashplayer.dll and on Linux ' + |
| + '/opt/google/chrome/PepperFlash/libpepflashplayer.so).') |
| parser.add_option('-g', '--good', type = 'str', |
| help = 'A good revision to start bisection. ' + |
| 'May be earlier or later than the bad revision. ' + |
| @@ -738,7 +753,7 @@ |
| 'Use %s to specify all extra arguments as one string. ' + |
| 'Defaults to "%p %a". Note that any extra paths ' + |
| 'specified should be absolute.', |
| - default = '%p %a'); |
| + default = '%p %a') |
| parser.add_option('-l', '--blink', action='store_true', |
| help = 'Use Blink bisect instead of Chromium. ') |
| parser.add_option('--aura', |
| @@ -768,7 +783,7 @@ |
| # Create the context. Initialize 0 for the revisions as they are set below. |
| context = PathContext(base_url, opts.archive, 0, 0, |
| - opts.official_builds, opts.aura) |
| + opts.official_builds, opts.aura, None) |
| # Pick a starting point, try to get HEAD for this. |
| if opts.bad: |
| bad_rev = opts.bad |
| @@ -783,6 +798,11 @@ |
| else: |
| good_rev = '0.0.0.0' if opts.official_builds else 0 |
| + if opts.flash_path: |
| + flash_path = opts.flash_path |
| + msg = 'Could not find Flash binary at %s' % flash_path |
| + assert os.path.exists(flash_path), msg |
| + |
| if opts.official_builds: |
| good_rev = LooseVersion(good_rev) |
| bad_rev = LooseVersion(bad_rev) |
| @@ -798,7 +818,7 @@ |
| (min_chromium_rev, max_chromium_rev) = Bisect( |
| base_url, opts.archive, opts.official_builds, opts.aura, good_rev, |
| - bad_rev, opts.times, opts.command, args, opts.profile) |
| + bad_rev, opts.times, opts.command, args, opts.profile, opts.flash_path) |
| # Get corresponding blink revisions. |
| try: |