From 7624e2dace1eddb857ba092d4db07ade86891165 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Thu, 8 Oct 2020 11:18:36 -0700 Subject: llvm_tools: use gsutil.py instead of gsutil chrotomation.mtv has gsutil.py from depot_tools, and no pre-installed gsutil. seems easiest to just add another dependency on gsutil.py. BUG=None TEST=Ran on chrotomation Change-Id: I9833c0fb1e11d31b3a4c17375e0f296ff5a83a8e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2462043 Reviewed-by: Manoj Gupta Tested-by: George Burgess --- llvm_tools/bisect_clang_crashes.py | 4 ++-- llvm_tools/bisect_clang_crashes_unittest.py | 2 +- llvm_tools/upload_lexan_crashes_to_forcey.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'llvm_tools') diff --git a/llvm_tools/bisect_clang_crashes.py b/llvm_tools/bisect_clang_crashes.py index 4d47c4c3..e8ee2ab6 100755 --- a/llvm_tools/bisect_clang_crashes.py +++ b/llvm_tools/bisect_clang_crashes.py @@ -23,7 +23,7 @@ import chroot def get_artifacts(pattern): - results = subprocess.check_output(['gsutil', 'ls', pattern], + results = subprocess.check_output(['gsutil.py', 'ls', pattern], stderr=subprocess.STDOUT, encoding='utf-8') return sorted(l.strip() for l in results.splitlines()) @@ -48,7 +48,7 @@ def submit_crash_to_forcey(forcey: str, temporary_directory: str, dest_dir = os.path.join(temporary_directory, buildbucket_id) dest_file = os.path.join(dest_dir, os.path.basename(url)) logging.info('Downloading and submitting %r...', url) - subprocess.check_output(['gsutil', 'cp', url, dest_file], + subprocess.check_output(['gsutil.py', 'cp', url, dest_file], stderr=subprocess.STDOUT) subprocess.check_output(['tar', '-xJf', dest_file], cwd=dest_dir) for src, script in get_crash_reproducers(dest_dir): diff --git a/llvm_tools/bisect_clang_crashes_unittest.py b/llvm_tools/bisect_clang_crashes_unittest.py index 66923ffc..c9143450 100755 --- a/llvm_tools/bisect_clang_crashes_unittest.py +++ b/llvm_tools/bisect_clang_crashes_unittest.py @@ -40,7 +40,7 @@ class Test(unittest.TestCase): mock_gsutil_ls.return_value = 'artifact1\nartifact2\nartifact3' results = bisect_clang_crashes.get_artifacts(pattern) self.assertEqual(results, ['artifact1', 'artifact2', 'artifact3']) - mock_gsutil_ls.assert_called_once_with(['gsutil', 'ls', pattern], + mock_gsutil_ls.assert_called_once_with(['gsutil.py', 'ls', pattern], stderr=subprocess.STDOUT, encoding='utf-8') diff --git a/llvm_tools/upload_lexan_crashes_to_forcey.py b/llvm_tools/upload_lexan_crashes_to_forcey.py index 9cf0c086..216511fc 100755 --- a/llvm_tools/upload_lexan_crashes_to_forcey.py +++ b/llvm_tools/upload_lexan_crashes_to_forcey.py @@ -24,7 +24,7 @@ gsurl_base = 'gs://chrome-clang-crash-reports/v1' def gsutil_ls(loc: str) -> List[str]: - results = subprocess.run(['gsutil', 'ls', loc], + results = subprocess.run(['gsutil.py', 'ls', loc], stdout=subprocess.PIPE, check=True, encoding='utf-8') @@ -107,7 +107,7 @@ def submit_test_case(gs_url: str, cr_tool: str) -> None: with temp_dir() as tempdir: target_name = 'test_case' + suffix target = os.path.join(tempdir, target_name) - subprocess.run(['gsutil', 'cp', gs_url, target], check=True) + subprocess.run(['gsutil.py', 'cp', gs_url, target], check=True) subprocess.run(['tar', 'xaf', target_name], check=True, cwd=tempdir) os.unlink(target) -- cgit v1.2.3