From 5200728bf0b8796194d079124a86dcde2f8fedf8 Mon Sep 17 00:00:00 2001 From: Ryan Beltran Date: Wed, 27 Oct 2021 20:41:33 +0000 Subject: llvm_tools: Add lldb_server to updated_packages This CL adds dev-util/lldb-server to the list of packages updated by various tools. Additionally, it updates the default packages in update_chromeos_llvm_hash.py so that we don't have to manually supply them anymore, and refactors other scripts to use that list instead of maintaining their own. BUG=b:196602751 TEST=`python3 -m unittest discover -s . -p '*_unittest.py'` Change-Id: I0856c8f854dc2cbd0f2f21b71db96d3ef000caa8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3248929 Tested-by: Ryan Beltran Auto-Submit: Ryan Beltran Commit-Queue: Manoj Gupta Reviewed-by: Manoj Gupta --- llvm_tools/modify_a_tryjob.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'llvm_tools/modify_a_tryjob.py') diff --git a/llvm_tools/modify_a_tryjob.py b/llvm_tools/modify_a_tryjob.py index 4d41e6b2..1bca30d4 100755 --- a/llvm_tools/modify_a_tryjob.py +++ b/llvm_tools/modify_a_tryjob.py @@ -17,9 +17,9 @@ import sys import chroot import failure_modes import get_llvm_hash +import update_chromeos_llvm_hash import update_packages_and_run_tests import update_tryjob_status -import update_chromeos_llvm_hash class ModifyTryjob(enum.Enum): @@ -253,17 +253,14 @@ def PerformTryjobModification(revision, modify_tryjob, status_file, extra_cls, # Make sure the revision is within the bounds of the start and end of the # bisection. elif bisect_contents['start'] < revision < bisect_contents['end']: - update_packages = [ - 'sys-devel/llvm', 'sys-libs/compiler-rt', 'sys-libs/libcxx', - 'sys-libs/libcxxabi', 'sys-libs/llvm-libunwind' - ] patch_metadata_file = 'PATCHES.json' git_hash, revision = get_llvm_hash.GetLLVMHashAndVersionFromSVNOption( revision) - tryjob_dict = AddTryjob(update_packages, git_hash, revision, chroot_path, + tryjob_dict = AddTryjob(update_chromeos_llvm_hash.DEFAULT_PACKAGES, + git_hash, revision, chroot_path, patch_metadata_file, extra_cls, options, builder, verbose, revision) -- cgit v1.2.3 From d080198a6e20a85e3d6c57a9fb168d4e19b3503c Mon Sep 17 00:00:00 2001 From: Ryan Beltran Date: Wed, 27 Oct 2021 20:47:16 +0000 Subject: llvm_tools: fix yapf warnings This CL applies fixes automatically generated by yapf during presubmit hook as well as a few manual fixes: * Removing erroneous `verbose` argument from call to RunTryJobs * Replacing / with parenthsis for long lines * Shortened some variable names to fix lines that were too long BUG=None TEST=rerean unit tests Change-Id: Ic6ed4bb74f067dd5c67991481caf75d8829bf86e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3248930 Tested-by: Ryan Beltran Auto-Submit: Ryan Beltran Commit-Queue: Manoj Gupta Reviewed-by: Manoj Gupta --- llvm_tools/modify_a_tryjob.py | 66 +++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 33 deletions(-) (limited to 'llvm_tools/modify_a_tryjob.py') diff --git a/llvm_tools/modify_a_tryjob.py b/llvm_tools/modify_a_tryjob.py index 1bca30d4..519fb51e 100755 --- a/llvm_tools/modify_a_tryjob.py +++ b/llvm_tools/modify_a_tryjob.py @@ -57,11 +57,10 @@ def GetCommandLineArgs(): # Add argument that determines which revision to search for in the list of # tryjobs. - parser.add_argument( - '--revision', - required=True, - type=int, - help='The revision to either remove or relaunch.') + parser.add_argument('--revision', + required=True, + type=int, + help='The revision to either remove or relaunch.') # Add argument for other change lists that want to run alongside the tryjob. parser.add_argument( @@ -72,40 +71,38 @@ def GetCommandLineArgs(): 'of updating the packages') # Add argument for custom options for the tryjob. - parser.add_argument( - '--options', - required=False, - nargs='+', - help='options to use for the tryjob testing') + parser.add_argument('--options', + required=False, + nargs='+', + help='options to use for the tryjob testing') # Add argument for the builder to use for the tryjob. - parser.add_argument('--builder', help='builder to use for the tryjob testing') + parser.add_argument('--builder', + help='builder to use for the tryjob testing') # Add argument for a specific chroot path. - parser.add_argument( - '--chroot_path', - default=cros_root, - help='the path to the chroot (default: %(default)s)') + parser.add_argument('--chroot_path', + default=cros_root, + help='the path to the chroot (default: %(default)s)') # Add argument for whether to display command contents to `stdout`. - parser.add_argument( - '--verbose', - action='store_true', - help='display contents of a command to the terminal ' - '(default: %(default)s)') + parser.add_argument('--verbose', + action='store_true', + help='display contents of a command to the terminal ' + '(default: %(default)s)') args_output = parser.parse_args() - if not os.path.isfile(args_output.status_file) or \ - not args_output.status_file.endswith('.json'): + if (not os.path.isfile(args_output.status_file) + or not args_output.status_file.endswith('.json')): raise ValueError('File does not exist or does not ending in ".json" ' ': %s' % args_output.status_file) - if args_output.modify_tryjob == ModifyTryjob.ADD.value and \ - not args_output.builder: + if (args_output.modify_tryjob == ModifyTryjob.ADD.value + and not args_output.builder): raise ValueError('A builder is required for adding a tryjob.') - elif args_output.modify_tryjob != ModifyTryjob.ADD.value and \ - args_output.builder: + elif (args_output.modify_tryjob != ModifyTryjob.ADD.value + and args_output.builder): raise ValueError('Specifying a builder is only available when adding a ' 'tryjob.') @@ -234,13 +231,13 @@ def PerformTryjobModification(revision, modify_tryjob, status_file, extra_cls, bisect_contents['jobs'][tryjob_index]['cl'], bisect_contents['jobs'][tryjob_index]['extra_cls'], bisect_contents['jobs'][tryjob_index]['options'], - bisect_contents['jobs'][tryjob_index]['builder'], chroot_path, verbose) + bisect_contents['jobs'][tryjob_index]['builder'], chroot_path) bisect_contents['jobs'][tryjob_index][ 'status'] = update_tryjob_status.TryjobStatus.PENDING.value bisect_contents['jobs'][tryjob_index]['link'] = tryjob_results[0]['link'] - bisect_contents['jobs'][tryjob_index]['buildbucket_id'] = tryjob_results[0][ - 'buildbucket_id'] + bisect_contents['jobs'][tryjob_index]['buildbucket_id'] = tryjob_results[ + 0]['buildbucket_id'] print('Successfully relaunched the tryjob for revision %d and updated ' 'the tryjob link to %s' % (revision, tryjob_results[0]['link'])) @@ -274,7 +271,10 @@ def PerformTryjobModification(revision, modify_tryjob, status_file, extra_cls, modify_tryjob) with open(status_file, 'w') as update_tryjobs: - json.dump(bisect_contents, update_tryjobs, indent=4, separators=(',', ': ')) + json.dump(bisect_contents, + update_tryjobs, + indent=4, + separators=(',', ': ')) def main(): @@ -287,9 +287,9 @@ def main(): PerformTryjobModification(args_output.revision, ModifyTryjob(args_output.modify_tryjob), args_output.status_file, - args_output.extra_change_lists, args_output.options, - args_output.builder, args_output.chroot_path, - args_output.verbose) + args_output.extra_change_lists, + args_output.options, args_output.builder, + args_output.chroot_path, args_output.verbose) if __name__ == '__main__': -- cgit v1.2.3