From c30a6232df03e1efbd9f3b226777b07e087a1122 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 12 Oct 2020 14:27:29 +0200 Subject: BASELINE: Update Chromium to 85.0.4183.140 Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen --- chromium/tools/infra/clobber_cache_utils.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'chromium/tools/infra/clobber_cache_utils.py') diff --git a/chromium/tools/infra/clobber_cache_utils.py b/chromium/tools/infra/clobber_cache_utils.py index be957234485..ba180373d22 100644 --- a/chromium/tools/infra/clobber_cache_utils.py +++ b/chromium/tools/infra/clobber_cache_utils.py @@ -9,6 +9,7 @@ from __future__ import print_function import os import subprocess import sys +import textwrap _SRC_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')) _SWARMING_CLIENT = os.path.join(_SRC_ROOT, 'tools', 'swarming_client', @@ -48,16 +49,26 @@ def _trigger_clobber(swarming_server, pool, cache, bot, mount_rel_path, '-d', 'id', bot, + '--cipd-package', + 'cpython:infra/python/cpython/${platform}:latest', '--named-cache', cache, mount_rel_path, '--priority=10', '--raw-cmd', '--', - # TODO(jbudorick): Generalize this for windows. - '/bin/rm', - '-rf', - mount_rel_path, + 'cpython/bin/python${EXECUTABLE_SUFFIX}', + '-c', + textwrap.dedent('''\ + import os, shutil, stat + + def remove_readonly(func, path, _): + "Clear the readonly bit and reattempt the removal" + os.chmod(path, stat.S_IWRITE) + func(path) + + shutil.rmtree({mount_rel_path!r}, onerror=remove_readonly) + '''.format(mount_rel_path=mount_rel_path)), ] if dry_run: print('Would run `%s`' % ' '.join(cmd)) -- cgit v1.2.1