| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """An auto-roller for GN binaries into Chromium. | 5 """An auto-roller for GN binaries into Chromium. |
| 6 | 6 |
| 7 This script is used to update the GN binaries that a Chromium | 7 This script is used to update the GN binaries that a Chromium |
| 8 checkout uses. In order to update the binaries, one must follow | 8 checkout uses. In order to update the binaries, one must follow |
| 9 four steps in order: | 9 four steps in order: |
| 10 | 10 |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 email = '' | 199 email = '' |
| 200 rpc_server = upload.GetRpcServer(CODE_REVIEW_SERVER, email) | 200 rpc_server = upload.GetRpcServer(CODE_REVIEW_SERVER, email) |
| 201 try: | 201 try: |
| 202 props = json.loads(rpc_server.Send('/api/%d' % issue)) | 202 props = json.loads(rpc_server.Send('/api/%d' % issue)) |
| 203 except Exception as _e: | 203 except Exception as _e: |
| 204 raise | 204 raise |
| 205 | 205 |
| 206 patchset = int(props['patchsets'][-1]) | 206 patchset = int(props['patchsets'][-1]) |
| 207 | 207 |
| 208 try: | 208 try: |
| 209 patchset_data = json.loads(rpc_server.Send('/api/%d/%d' % | 209 try_job_results = json.loads(rpc_server.Send( |
| 210 (issue, patchset))) | 210 '/api/%d/%d/try_job_results' % (issue, patchset))) |
| 211 except Exception as _e: | 211 except Exception as _e: |
| 212 raise | 212 raise |
| 213 | 213 |
| 214 try_job_results = patchset_data['try_job_results'] | |
| 215 if not try_job_results: | 214 if not try_job_results: |
| 216 print('No try jobs found on most recent patchset') | 215 print('No try jobs found on most recent patchset') |
| 217 return {} | 216 return {} |
| 218 | 217 |
| 219 results = {} | 218 results = {} |
| 220 for job in try_job_results: | 219 for job in try_job_results: |
| 221 builder = job['builder'] | 220 builder = job['builder'] |
| 222 if builder == 'linux_chromium_gn_upload': | 221 if builder == 'linux_chromium_gn_upload': |
| 223 platform = 'linux64' | 222 platform = 'linux64' |
| 224 elif builder == 'mac_chromium_gn_upload': | 223 elif builder == 'mac_chromium_gn_upload': |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 self.old_gn_version, | 367 self.old_gn_version, |
| 369 self.new_gn_version, | 368 self.new_gn_version, |
| 370 gn_changes, | 369 gn_changes, |
| 371 self.reviewer, | 370 self.reviewer, |
| 372 )) | 371 )) |
| 373 | 372 |
| 374 def GetDEPSRollDesc(self, old_buildtools_commitish, new_buildtools_commitish): | 373 def GetDEPSRollDesc(self, old_buildtools_commitish, new_buildtools_commitish): |
| 375 gn_changes = self.GetGNChanges() | 374 gn_changes = self.GetGNChanges() |
| 376 | 375 |
| 377 return ( | 376 return ( |
| 378 'Roll DEPS %s..%s\n' | 377 'Roll buildtools %s..%s\n' |
| 379 '\n' | 378 '\n' |
| 380 ' In order to roll GN %s..%s (r%s:r%s) and pick up\n' | 379 ' In order to roll GN %s..%s (r%s:r%s) and pick up\n' |
| 381 ' the following changes:\n' | 380 ' the following changes:\n' |
| 382 '\n' | 381 '\n' |
| 383 '%s' | 382 '%s' |
| 384 '\n' | 383 '\n' |
| 385 'TBR=%s\n' | 384 'TBR=%s\n' |
| 386 'CQ_EXTRA_TRYBOTS=tryserver.chromium.mac:mac_chromium_gn_rel,' | 385 'CQ_EXTRA_TRYBOTS=tryserver.chromium.mac:mac_chromium_gn_rel,' |
| 387 'mac_chromium_gn_dbg;' | 386 'mac_chromium_gn_dbg;' |
| 388 'tryserver.chromium.win:win8_chromium_gn_dbg,' | 387 'tryserver.chromium.win:win8_chromium_gn_dbg,' |
| (...skipping 17 matching lines...) Expand all Loading... |
| 406 def Call(self, cmd, cwd=None): | 405 def Call(self, cmd, cwd=None): |
| 407 proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True, | 406 proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True, |
| 408 cwd=(cwd or self.chromium_src_dir)) | 407 cwd=(cwd or self.chromium_src_dir)) |
| 409 out, err = proc.communicate() | 408 out, err = proc.communicate() |
| 410 return proc.returncode, out, err | 409 return proc.returncode, out, err |
| 411 | 410 |
| 412 | 411 |
| 413 if __name__ == '__main__': | 412 if __name__ == '__main__': |
| 414 roller = GNRoller() | 413 roller = GNRoller() |
| 415 sys.exit(roller.Roll()) | 414 sys.exit(roller.Roll()) |
| OLD | NEW |