Salud Lemus | 6270ccc | 2019-09-04 18:15:35 -0700 | [diff] [blame] | 1 | #!/usr/bin/env python3 |
Salud Lemus | 055838a | 2019-08-19 13:37:28 -0700 | [diff] [blame] | 2 | # -*- coding: utf-8 -*- |
| 3 | # Copyright 2019 The Chromium OS Authors. All rights reserved. |
| 4 | # Use of this source code is governed by a BSD-style license that can be |
| 5 | # found in the LICENSE file. |
| 6 | |
| 7 | """Performs bisection on LLVM based off a .JSON file.""" |
| 8 | |
Salud Lemus | 055838a | 2019-08-19 13:37:28 -0700 | [diff] [blame] | 9 | from __future__ import print_function |
| 10 | |
| 11 | import argparse |
Salud Lemus | c856b68 | 2019-08-29 11:46:49 -0700 | [diff] [blame] | 12 | import enum |
Salud Lemus | 055838a | 2019-08-19 13:37:28 -0700 | [diff] [blame] | 13 | import errno |
| 14 | import json |
| 15 | import os |
Salud Lemus | c856b68 | 2019-08-29 11:46:49 -0700 | [diff] [blame] | 16 | import sys |
Salud Lemus | 055838a | 2019-08-19 13:37:28 -0700 | [diff] [blame] | 17 | |
Jian Cai | c16daa1 | 2020-04-15 17:53:41 -0700 | [diff] [blame] | 18 | import chroot |
| 19 | import get_llvm_hash |
Jian Cai | 089db67 | 2020-08-23 20:09:02 -0700 | [diff] [blame] | 20 | import git_llvm_rev |
Jian Cai | c16daa1 | 2020-04-15 17:53:41 -0700 | [diff] [blame] | 21 | import modify_a_tryjob |
| 22 | import update_tryjob_status |
Salud Lemus | 055838a | 2019-08-19 13:37:28 -0700 | [diff] [blame] | 23 | |
| 24 | |
Salud Lemus | c856b68 | 2019-08-29 11:46:49 -0700 | [diff] [blame] | 25 | class BisectionExitStatus(enum.Enum): |
| 26 | """Exit code when performing bisection.""" |
| 27 | |
| 28 | # Means that there are no more revisions available to bisect. |
| 29 | BISECTION_COMPLETE = 126 |
| 30 | |
| 31 | |
Salud Lemus | 055838a | 2019-08-19 13:37:28 -0700 | [diff] [blame] | 32 | def GetCommandLineArgs(): |
| 33 | """Parses the command line for the command line arguments.""" |
| 34 | |
| 35 | # Default path to the chroot if a path is not specified. |
| 36 | cros_root = os.path.expanduser('~') |
| 37 | cros_root = os.path.join(cros_root, 'chromiumos') |
| 38 | |
| 39 | # Create parser and add optional command-line arguments. |
| 40 | parser = argparse.ArgumentParser( |
| 41 | description='Bisects LLVM via tracking a JSON file.') |
| 42 | |
| 43 | # Add argument for other change lists that want to run alongside the tryjob |
| 44 | # which has a change list of updating a package's git hash. |
| 45 | parser.add_argument( |
| 46 | '--parallel', |
| 47 | type=int, |
| 48 | default=3, |
| 49 | help='How many tryjobs to create between the last good version and ' |
| 50 | 'the first bad version (default: %(default)s)') |
| 51 | |
| 52 | # Add argument for the good LLVM revision for bisection. |
| 53 | parser.add_argument( |
| 54 | '--start_rev', |
| 55 | required=True, |
| 56 | type=int, |
| 57 | help='The good revision for the bisection.') |
| 58 | |
| 59 | # Add argument for the bad LLVM revision for bisection. |
| 60 | parser.add_argument( |
| 61 | '--end_rev', |
| 62 | required=True, |
| 63 | type=int, |
| 64 | help='The bad revision for the bisection.') |
| 65 | |
| 66 | # Add argument for the absolute path to the file that contains information on |
| 67 | # the previous tested svn version. |
| 68 | parser.add_argument( |
| 69 | '--last_tested', |
| 70 | required=True, |
| 71 | help='the absolute path to the file that contains the tryjobs') |
| 72 | |
| 73 | # Add argument for the absolute path to the LLVM source tree. |
| 74 | parser.add_argument( |
| 75 | '--src_path', |
| 76 | help='the path to the LLVM source tree to use (used for retrieving the ' |
| 77 | 'git hash of each version between the last good version and first bad ' |
| 78 | 'version)') |
| 79 | |
| 80 | # Add argument for other change lists that want to run alongside the tryjob |
| 81 | # which has a change list of updating a package's git hash. |
| 82 | parser.add_argument( |
| 83 | '--extra_change_lists', |
| 84 | type=int, |
| 85 | nargs='+', |
| 86 | help='change lists that would like to be run alongside the change list ' |
| 87 | 'of updating the packages') |
| 88 | |
| 89 | # Add argument for custom options for the tryjob. |
| 90 | parser.add_argument( |
| 91 | '--options', |
| 92 | required=False, |
| 93 | nargs='+', |
| 94 | help='options to use for the tryjob testing') |
| 95 | |
| 96 | # Add argument for the builder to use for the tryjob. |
| 97 | parser.add_argument( |
| 98 | '--builder', required=True, help='builder to use for the tryjob testing') |
| 99 | |
| 100 | # Add argument for the description of the tryjob. |
| 101 | parser.add_argument( |
| 102 | '--description', |
| 103 | required=False, |
| 104 | nargs='+', |
| 105 | help='the description of the tryjob') |
| 106 | |
| 107 | # Add argument for a specific chroot path. |
| 108 | parser.add_argument( |
| 109 | '--chroot_path', |
| 110 | default=cros_root, |
| 111 | help='the path to the chroot (default: %(default)s)') |
| 112 | |
Salud Lemus | 6270ccc | 2019-09-04 18:15:35 -0700 | [diff] [blame] | 113 | # Add argument for whether to display command contents to `stdout`. |
Salud Lemus | 055838a | 2019-08-19 13:37:28 -0700 | [diff] [blame] | 114 | parser.add_argument( |
Salud Lemus | 6270ccc | 2019-09-04 18:15:35 -0700 | [diff] [blame] | 115 | '--verbose', |
| 116 | action='store_true', |
| 117 | help='display contents of a command to the terminal ' |
| 118 | '(default: %(default)s)') |
Salud Lemus | 055838a | 2019-08-19 13:37:28 -0700 | [diff] [blame] | 119 | |
| 120 | args_output = parser.parse_args() |
| 121 | |
| 122 | assert args_output.start_rev < args_output.end_rev, ( |
Jian Cai | 089db67 | 2020-08-23 20:09:02 -0700 | [diff] [blame] | 123 | 'Start revision %d is >= end revision %d' % |
| 124 | (args_output.start_rev, args_output.end_rev)) |
Salud Lemus | 055838a | 2019-08-19 13:37:28 -0700 | [diff] [blame] | 125 | |
| 126 | if args_output.last_tested and not args_output.last_tested.endswith('.json'): |
Jian Cai | 089db67 | 2020-08-23 20:09:02 -0700 | [diff] [blame] | 127 | raise ValueError('Filed provided %s does not end in ".json"' % |
| 128 | args_output.last_tested) |
Salud Lemus | 055838a | 2019-08-19 13:37:28 -0700 | [diff] [blame] | 129 | |
| 130 | return args_output |
| 131 | |
| 132 | |
Jian Cai | 089db67 | 2020-08-23 20:09:02 -0700 | [diff] [blame] | 133 | def GetRemainingRange(start, end, tryjobs): |
Salud Lemus | 055838a | 2019-08-19 13:37:28 -0700 | [diff] [blame] | 134 | """Gets the start and end intervals in 'json_file'. |
| 135 | |
| 136 | Args: |
| 137 | start: The start version of the bisection provided via the command line. |
| 138 | end: The end version of the bisection provided via the command line. |
| 139 | tryjobs: A list of tryjobs where each element is in the following format: |
| 140 | [ |
| 141 | {[TRYJOB_INFORMATION]}, |
| 142 | {[TRYJOB_INFORMATION]}, |
| 143 | ..., |
| 144 | {[TRYJOB_INFORMATION]} |
| 145 | ] |
| 146 | |
| 147 | Returns: |
Salud Lemus | ffed65d | 2019-08-26 14:52:02 -0700 | [diff] [blame] | 148 | The new start version and end version for bisection, a set of revisions |
| 149 | that are 'pending' and a set of revisions that are to be skipped. |
Salud Lemus | 055838a | 2019-08-19 13:37:28 -0700 | [diff] [blame] | 150 | |
| 151 | Raises: |
| 152 | ValueError: The value for 'status' is missing or there is a mismatch |
| 153 | between 'start' and 'end' compared to the 'start' and 'end' in the JSON |
| 154 | file. |
| 155 | AssertionError: The new start version is >= than the new end version. |
| 156 | """ |
| 157 | |
| 158 | if not tryjobs: |
Salud Lemus | 0263063 | 2019-08-28 15:27:59 -0700 | [diff] [blame] | 159 | return start, end, {}, {} |
Salud Lemus | 055838a | 2019-08-19 13:37:28 -0700 | [diff] [blame] | 160 | |
| 161 | # Verify that each tryjob has a value for the 'status' key. |
| 162 | for cur_tryjob_dict in tryjobs: |
| 163 | if not cur_tryjob_dict.get('status', None): |
Salud Lemus | 6270ccc | 2019-09-04 18:15:35 -0700 | [diff] [blame] | 164 | raise ValueError('"status" is missing or has no value, please ' |
Salud Lemus | 055838a | 2019-08-19 13:37:28 -0700 | [diff] [blame] | 165 | 'go to %s and update it' % cur_tryjob_dict['link']) |
| 166 | |
| 167 | all_bad_revisions = [end] |
Jian Cai | c16daa1 | 2020-04-15 17:53:41 -0700 | [diff] [blame] | 168 | all_bad_revisions.extend( |
| 169 | cur_tryjob['rev'] |
| 170 | for cur_tryjob in tryjobs |
| 171 | if cur_tryjob['status'] == update_tryjob_status.TryjobStatus.BAD.value) |
Salud Lemus | 055838a | 2019-08-19 13:37:28 -0700 | [diff] [blame] | 172 | |
| 173 | # The minimum value for the 'bad' field in the tryjobs is the new end |
| 174 | # version. |
| 175 | bad_rev = min(all_bad_revisions) |
| 176 | |
| 177 | all_good_revisions = [start] |
Jian Cai | c16daa1 | 2020-04-15 17:53:41 -0700 | [diff] [blame] | 178 | all_good_revisions.extend( |
| 179 | cur_tryjob['rev'] |
| 180 | for cur_tryjob in tryjobs |
| 181 | if cur_tryjob['status'] == update_tryjob_status.TryjobStatus.GOOD.value) |
Salud Lemus | 055838a | 2019-08-19 13:37:28 -0700 | [diff] [blame] | 182 | |
| 183 | # The maximum value for the 'good' field in the tryjobs is the new start |
| 184 | # version. |
| 185 | good_rev = max(all_good_revisions) |
| 186 | |
| 187 | # The good version should always be strictly less than the bad version; |
| 188 | # otherwise, bisection is broken. |
| 189 | assert good_rev < bad_rev, ('Bisection is broken because %d (good) is >= ' |
| 190 | '%d (bad)' % (good_rev, bad_rev)) |
| 191 | |
| 192 | # Find all revisions that are 'pending' within 'good_rev' and 'bad_rev'. |
| 193 | # |
| 194 | # NOTE: The intent is to not launch tryjobs between 'good_rev' and 'bad_rev' |
Salud Lemus | ffed65d | 2019-08-26 14:52:02 -0700 | [diff] [blame] | 195 | # that have already been launched (this set is used when constructing the |
Salud Lemus | 055838a | 2019-08-19 13:37:28 -0700 | [diff] [blame] | 196 | # list of revisions to launch tryjobs for). |
Salud Lemus | ffed65d | 2019-08-26 14:52:02 -0700 | [diff] [blame] | 197 | pending_revisions = { |
Salud Lemus | 055838a | 2019-08-19 13:37:28 -0700 | [diff] [blame] | 198 | tryjob['rev'] |
| 199 | for tryjob in tryjobs |
Jian Cai | c16daa1 | 2020-04-15 17:53:41 -0700 | [diff] [blame] | 200 | if tryjob['status'] == update_tryjob_status.TryjobStatus.PENDING.value and |
Salud Lemus | 055838a | 2019-08-19 13:37:28 -0700 | [diff] [blame] | 201 | good_rev < tryjob['rev'] < bad_rev |
Salud Lemus | ffed65d | 2019-08-26 14:52:02 -0700 | [diff] [blame] | 202 | } |
Salud Lemus | 055838a | 2019-08-19 13:37:28 -0700 | [diff] [blame] | 203 | |
Salud Lemus | ffed65d | 2019-08-26 14:52:02 -0700 | [diff] [blame] | 204 | # Find all revisions that are to be skipped within 'good_rev' and 'bad_rev'. |
| 205 | # |
| 206 | # NOTE: The intent is to not launch tryjobs between 'good_rev' and 'bad_rev' |
| 207 | # that have already been marked as 'skip' (this set is used when constructing |
| 208 | # the list of revisions to launch tryjobs for). |
| 209 | skip_revisions = { |
| 210 | tryjob['rev'] |
| 211 | for tryjob in tryjobs |
Jian Cai | c16daa1 | 2020-04-15 17:53:41 -0700 | [diff] [blame] | 212 | if tryjob['status'] == update_tryjob_status.TryjobStatus.SKIP.value and |
Salud Lemus | ffed65d | 2019-08-26 14:52:02 -0700 | [diff] [blame] | 213 | good_rev < tryjob['rev'] < bad_rev |
| 214 | } |
| 215 | |
| 216 | return good_rev, bad_rev, pending_revisions, skip_revisions |
Salud Lemus | 055838a | 2019-08-19 13:37:28 -0700 | [diff] [blame] | 217 | |
| 218 | |
Jian Cai | 089db67 | 2020-08-23 20:09:02 -0700 | [diff] [blame] | 219 | def GetCommitsBetween(start, end, parallel, src_path, pending_revisions, |
| 220 | skip_revisions): |
Salud Lemus | 055838a | 2019-08-19 13:37:28 -0700 | [diff] [blame] | 221 | """Determines the revisions between start and end.""" |
| 222 | |
Jian Cai | 089db67 | 2020-08-23 20:09:02 -0700 | [diff] [blame] | 223 | with get_llvm_hash.LLVMHash().CreateTempDirectory() as temp_dir: |
| 224 | # We have guaranteed contiguous revision numbers after this, |
| 225 | # and that guarnatee simplifies things considerably, so we don't |
| 226 | # support anything before it. |
| 227 | assert start >= git_llvm_rev.base_llvm_revision, f'{start} was too long ago' |
Salud Lemus | 055838a | 2019-08-19 13:37:28 -0700 | [diff] [blame] | 228 | |
Jian Cai | c16daa1 | 2020-04-15 17:53:41 -0700 | [diff] [blame] | 229 | with get_llvm_hash.CreateTempLLVMRepo(temp_dir) as new_repo: |
Salud Lemus | 4223570 | 2019-08-23 16:49:28 -0700 | [diff] [blame] | 230 | if not src_path: |
| 231 | src_path = new_repo |
Jian Cai | 089db67 | 2020-08-23 20:09:02 -0700 | [diff] [blame] | 232 | index_step = (end - (start + 1)) // (parallel + 1) |
| 233 | if not index_step: |
| 234 | index_step = 1 |
| 235 | revisions = [ |
| 236 | rev for rev in range(start + 1, end, index_step) |
| 237 | if rev not in pending_revisions and rev not in skip_revisions |
| 238 | ] |
Jian Cai | c16daa1 | 2020-04-15 17:53:41 -0700 | [diff] [blame] | 239 | git_hashes = [ |
| 240 | get_llvm_hash.GetGitHashFrom(src_path, rev) for rev in revisions |
| 241 | ] |
Jian Cai | 089db67 | 2020-08-23 20:09:02 -0700 | [diff] [blame] | 242 | return revisions, git_hashes |
Salud Lemus | 055838a | 2019-08-19 13:37:28 -0700 | [diff] [blame] | 243 | |
| 244 | |
Jian Cai | 089db67 | 2020-08-23 20:09:02 -0700 | [diff] [blame] | 245 | def Bisect(revisions, git_hashes, bisect_state, last_tested, update_packages, |
| 246 | chroot_path, patch_metadata_file, extra_change_lists, options, |
| 247 | builder, verbose): |
Salud Lemus | c856b68 | 2019-08-29 11:46:49 -0700 | [diff] [blame] | 248 | """Adds tryjobs and updates the status file with the new tryjobs.""" |
| 249 | |
| 250 | try: |
| 251 | for svn_revision, git_hash in zip(revisions, git_hashes): |
Jian Cai | 089db67 | 2020-08-23 20:09:02 -0700 | [diff] [blame] | 252 | tryjob_dict = modify_a_tryjob.AddTryjob(update_packages, git_hash, |
| 253 | svn_revision, chroot_path, |
| 254 | patch_metadata_file, |
| 255 | extra_change_lists, options, |
| 256 | builder, verbose, svn_revision) |
Salud Lemus | c856b68 | 2019-08-29 11:46:49 -0700 | [diff] [blame] | 257 | |
Jian Cai | 089db67 | 2020-08-23 20:09:02 -0700 | [diff] [blame] | 258 | bisect_state['jobs'].append(tryjob_dict) |
Salud Lemus | c856b68 | 2019-08-29 11:46:49 -0700 | [diff] [blame] | 259 | finally: |
| 260 | # Do not want to lose progress if there is an exception. |
| 261 | if last_tested: |
| 262 | new_file = '%s.new' % last_tested |
| 263 | with open(new_file, 'w') as json_file: |
Jian Cai | 089db67 | 2020-08-23 20:09:02 -0700 | [diff] [blame] | 264 | json.dump(bisect_state, json_file, indent=4, separators=(',', ': ')) |
Salud Lemus | c856b68 | 2019-08-29 11:46:49 -0700 | [diff] [blame] | 265 | |
| 266 | os.rename(new_file, last_tested) |
| 267 | |
| 268 | |
Salud Lemus | 97c1e1c | 2019-09-10 16:28:47 -0700 | [diff] [blame] | 269 | def LoadStatusFile(last_tested, start, end): |
| 270 | """Loads the status file for bisection.""" |
| 271 | |
| 272 | try: |
| 273 | with open(last_tested) as f: |
| 274 | return json.load(f) |
| 275 | except IOError as err: |
| 276 | if err.errno != errno.ENOENT: |
| 277 | raise |
| 278 | |
| 279 | return {'start': start, 'end': end, 'jobs': []} |
| 280 | |
| 281 | |
Salud Lemus | c856b68 | 2019-08-29 11:46:49 -0700 | [diff] [blame] | 282 | def main(args_output): |
Jian Cai | 089db67 | 2020-08-23 20:09:02 -0700 | [diff] [blame] | 283 | """Bisects LLVM commits. |
Salud Lemus | 055838a | 2019-08-19 13:37:28 -0700 | [diff] [blame] | 284 | |
| 285 | Raises: |
| 286 | AssertionError: The script was run inside the chroot. |
| 287 | """ |
| 288 | |
Jian Cai | c16daa1 | 2020-04-15 17:53:41 -0700 | [diff] [blame] | 289 | chroot.VerifyOutsideChroot() |
Salud Lemus | 055838a | 2019-08-19 13:37:28 -0700 | [diff] [blame] | 290 | update_packages = [ |
| 291 | 'sys-devel/llvm', 'sys-libs/compiler-rt', 'sys-libs/libcxx', |
| 292 | 'sys-libs/libcxxabi', 'sys-libs/llvm-libunwind' |
| 293 | ] |
Salud Lemus | 055838a | 2019-08-19 13:37:28 -0700 | [diff] [blame] | 294 | patch_metadata_file = 'PATCHES.json' |
Salud Lemus | 055838a | 2019-08-19 13:37:28 -0700 | [diff] [blame] | 295 | start = args_output.start_rev |
| 296 | end = args_output.end_rev |
| 297 | |
Jian Cai | 089db67 | 2020-08-23 20:09:02 -0700 | [diff] [blame] | 298 | bisect_state = LoadStatusFile(args_output.last_tested, start, end) |
| 299 | if start != bisect_state['start'] or end != bisect_state['end']: |
| 300 | raise ValueError(f'The start {start} or the end {end} version provided is ' |
| 301 | f'different than "start" {bisect_state["start"]} or "end" ' |
| 302 | f'{bisect_state["end"]} in the .JSON file') |
Salud Lemus | c856b68 | 2019-08-29 11:46:49 -0700 | [diff] [blame] | 303 | |
Salud Lemus | ffed65d | 2019-08-26 14:52:02 -0700 | [diff] [blame] | 304 | # Pending and skipped revisions are between 'start_revision' and |
| 305 | # 'end_revision'. |
| 306 | start_revision, end_revision, pending_revisions, skip_revisions = \ |
Jian Cai | 089db67 | 2020-08-23 20:09:02 -0700 | [diff] [blame] | 307 | GetRemainingRange(start, end, bisect_state['jobs']) |
Salud Lemus | 055838a | 2019-08-19 13:37:28 -0700 | [diff] [blame] | 308 | |
Jian Cai | 089db67 | 2020-08-23 20:09:02 -0700 | [diff] [blame] | 309 | revisions, git_hashes = GetCommitsBetween(start_revision, end_revision, |
| 310 | args_output.parallel, |
| 311 | args_output.src_path, |
| 312 | pending_revisions, skip_revisions) |
Salud Lemus | ffed65d | 2019-08-26 14:52:02 -0700 | [diff] [blame] | 313 | |
Salud Lemus | c856b68 | 2019-08-29 11:46:49 -0700 | [diff] [blame] | 314 | # No more revisions between 'start_revision' and 'end_revision', so |
| 315 | # bisection is complete. |
| 316 | # |
| 317 | # This is determined by finding all valid revisions between 'start_revision' |
| 318 | # and 'end_revision' and that are NOT in the 'pending' and 'skipped' set. |
Salud Lemus | ffed65d | 2019-08-26 14:52:02 -0700 | [diff] [blame] | 319 | if not revisions: |
Jian Cai | 089db67 | 2020-08-23 20:09:02 -0700 | [diff] [blame] | 320 | if pending_revisions: |
| 321 | # Some tryjobs are not finished which may change the actual bad |
| 322 | # commit/revision when those tryjobs are finished. |
| 323 | no_revisions_message = (f'No revisions between start {start_revision} ' |
| 324 | f'and end {end_revision} to create tryjobs\n') |
| 325 | |
| 326 | if pending_revisions: |
| 327 | no_revisions_message += ( |
| 328 | 'The following tryjobs are pending:\n' + |
| 329 | '\n'.join(str(rev) for rev in pending_revisions) + '\n') |
Salud Lemus | ffed65d | 2019-08-26 14:52:02 -0700 | [diff] [blame] | 330 | |
Salud Lemus | c856b68 | 2019-08-29 11:46:49 -0700 | [diff] [blame] | 331 | if skip_revisions: |
Jian Cai | 089db67 | 2020-08-23 20:09:02 -0700 | [diff] [blame] | 332 | no_revisions_message += ('The following tryjobs were skipped:\n' + |
| 333 | '\n'.join(str(rev) for rev in skip_revisions) + |
| 334 | '\n') |
Salud Lemus | ffed65d | 2019-08-26 14:52:02 -0700 | [diff] [blame] | 335 | |
Jian Cai | 089db67 | 2020-08-23 20:09:02 -0700 | [diff] [blame] | 336 | raise ValueError(no_revisions_message) |
Salud Lemus | 055838a | 2019-08-19 13:37:28 -0700 | [diff] [blame] | 337 | |
Jian Cai | 089db67 | 2020-08-23 20:09:02 -0700 | [diff] [blame] | 338 | print(f'Finished bisecting for {args_output.last_tested}') |
| 339 | if args_output.src_path: |
| 340 | bad_llvm_hash = get_llvm_hash.GetGitHashFrom(args_output.src_path, |
| 341 | end_revision) |
| 342 | else: |
| 343 | bad_llvm_hash = get_llvm_hash.LLVMHash().GetLLVMHash(end_revision) |
| 344 | print(f'The bad revision is {end_revision} and its commit hash is ' |
| 345 | f'{bad_llvm_hash}') |
| 346 | if skip_revisions: |
| 347 | skip_revisions_message = ('\nThe following revisions were skipped:\n' + |
| 348 | '\n'.join(str(rev) for rev in skip_revisions)) |
| 349 | print(skip_revisions_message) |
Salud Lemus | 055838a | 2019-08-19 13:37:28 -0700 | [diff] [blame] | 350 | |
Jian Cai | 089db67 | 2020-08-23 20:09:02 -0700 | [diff] [blame] | 351 | return BisectionExitStatus.BISECTION_COMPLETE.value |
Salud Lemus | 055838a | 2019-08-19 13:37:28 -0700 | [diff] [blame] | 352 | |
Jian Cai | 089db67 | 2020-08-23 20:09:02 -0700 | [diff] [blame] | 353 | for rev in revisions: |
| 354 | if update_tryjob_status.FindTryjobIndex(rev, |
| 355 | bisect_state['jobs']) is not None: |
| 356 | raise ValueError(f'Revision {rev} exists already in "jobs"') |
Salud Lemus | 055838a | 2019-08-19 13:37:28 -0700 | [diff] [blame] | 357 | |
Jian Cai | 089db67 | 2020-08-23 20:09:02 -0700 | [diff] [blame] | 358 | Bisect(revisions, git_hashes, bisect_state, args_output.last_tested, |
| 359 | update_packages, args_output.chroot_path, patch_metadata_file, |
| 360 | args_output.extra_change_lists, args_output.options, |
| 361 | args_output.builder, args_output.verbose) |
Salud Lemus | 055838a | 2019-08-19 13:37:28 -0700 | [diff] [blame] | 362 | |
| 363 | |
| 364 | if __name__ == '__main__': |
Jian Cai | c16daa1 | 2020-04-15 17:53:41 -0700 | [diff] [blame] | 365 | sys.exit(main(GetCommandLineArgs())) |