Want to bisect your local checkout rather than prebuilt binaries? Use run-bisect-manual-test.py.
Have you ever hit a regression bug like this: "In chromium 26.0.401.1, things were broken. Back in chromium 220.127.116.11, it was fine."? A good way to attack bugs like this – where it's unclear what change could have caused the regression, but where you have a reliable repro – is to bisect.
tools/bisect-builds.py automates downloading builds of Chrome across a regression range, conducting a binary search for the problematic change.
If you don't have a chromium checkout, you can fetch it with linux commands below:
curl -s --basic -n "https://chromium.googlesource.com/chromium/src/+/master/tools/bisect-builds.py?format=TEXT" | base64 -d > bisect-builds.py
Windows (no curl, base64)
python -c "import urllib2; import base64; print base64.b64decode(urllib2.urlopen(\"https://chromium.googlesource.com/chromium/src/+/master/tools/bisect-builds.py?format=TEXT\").read())" > bisect-builds.py
Note: Bisect builds needs Python 2.x. Python 3.x won't work.
Run it like this:
Valid archive types (the -a parameter) are
You can also use the
The script will download a build in the revision range and execute it. You must then manually check if the bug still repros. Quit Chromium, and the script will ask you if the bug reproduced or not. It will use your answer to drive a binary search, and after just a few steps it will tell you "this regression happened somewhere between revisions 1234 and 1334". From that list, it's usually easy to spot the offending CL. If not, you can use the run-bisect-manual-test.py script which will further bisect down to a particular CL by syncing and building manually. If you're adding the range as a comment to a bug, please always paste the output from bisect-builds.py, as this includes links to the chromium changes in the regression range.
View code changes in revision range with this Useful URL (replacing SUCCESS_REV and FAILURE_REV with the range start and end):
Notes: For internal usage, we also enabled bisect builds by commits. Please refer to internal doc for more information.
Getting an initial revision range
If you have two Chrome binaries, one which doesn't work, one which does, you can check the chrome://version page for the revision that it was built at (look for the "(Official Build NNNNN)" text). You can also infer the revision number from the version number.
You can use the "Version Information" tool on OmahaProxy to find out the numeric "Branch base position".
If your revision range is incorrect, or if something about your environment interferes with your reproduction of the bug, you will not get useful results from bisect-builds.py. If you would prefer to know this as soon as possible, rather than after downloading and checking O(log n) builds, pass the --verify-range option to bisect-builds.py. This will check the first and last builds in the range before starting the bisect.
Use an elevated command prompt for use on Windows
The script currently requires an elevated command prompt to extract the build on Windows.
You can run your shell as administrator to work around the silent failure. Track this issue at crbug.com/98739.
This can be annoying, especially if it's a big roll. If that doesn't help, then you can use the run-bisect-manual-test.py script, which will recurse into the V8 or Skia repositories if you give it a start and end revision range which includes a roll from one of these repositories.
API Keys and Chrome OS builds
Without API keys, Chrome OS won't allow you to log in as a specific user. To run a chromeos bisect on your Linux desktop, add the following variables to your environment (e.g., via .bashrc):
See https://www.chromium.org/developers/how-tos/api-keys for more info about API keys.
For Developers >