Bug 1528155 - Use sparse profiles in Windows toolchain tasks. r=tomprince

Also fix support_vcs_checkout call for docker-image based toolchain
tasks.

Differential Revision: https://phabricator.services.mozilla.com/D19912
This commit is contained in:
Mike Hommey 2019-02-16 20:31:26 +09:00
Родитель 68af671f02
Коммит e42ae134c3
2 изменённых файлов: 17 добавлений и 5 удалений

Просмотреть файл

@ -160,7 +160,8 @@ def support_vcs_checkout(config, job, taskdesc, sparse=False):
taskdesc['worker']['taskcluster-proxy'] = True
def generic_worker_hg_commands(base_repo, head_repo, head_rev, path):
def generic_worker_hg_commands(base_repo, head_repo, head_rev, path,
sparse_profile=None):
"""Obtain commands needed to obtain a Mercurial checkout on generic-worker.
Returns two command strings. One performs the checkout. Another logs.
@ -172,9 +173,16 @@ def generic_worker_hg_commands(base_repo, head_repo, head_rev, path):
'--purge',
'--upstream', base_repo,
'--revision', head_rev,
]
if sparse_profile:
args.extend(['--config', 'extensions.sparse='])
args.extend(['--sparseprofile', sparse_profile])
args.extend([
head_repo,
path,
]
])
logging_args = [
b":: TinderboxPrint:<a href={source_repo}/rev/{revision} "

Просмотреть файл

@ -123,7 +123,7 @@ def docker_worker_toolchain(config, job, taskdesc):
if not any(artifact.get('name') == 'public/build' for artifact in artifacts):
docker_worker_add_artifacts(config, job, taskdesc)
support_vcs_checkout(config, job, taskdesc, sparse=True)
support_vcs_checkout(config, job, taskdesc, sparse=('sparse-profile' in run))
# Toolchain checkouts don't live under {workdir}/checkouts
workspace = '{workdir}/workspace/build'.format(**run)
@ -201,7 +201,7 @@ def windows_toolchain(config, job, taskdesc):
# all sorts of problems with toolchain tasks, disable them until
# tasks are ready.
run['use-caches'] = False
support_vcs_checkout(config, job, taskdesc)
support_vcs_checkout(config, job, taskdesc, sparse=('sparse-profile' in run))
env = worker['env']
env.update({
@ -210,11 +210,15 @@ def windows_toolchain(config, job, taskdesc):
'MOZ_AUTOMATION': '1',
})
sparse_profile = run.get('sparse-profile')
if sparse_profile:
sparse_profile = 'build/sparse-profiles/{}'.format(run['sparse-profile'])
hg_command = generic_worker_hg_commands(
'https://hg.mozilla.org/mozilla-unified',
env['GECKO_HEAD_REPOSITORY'],
env['GECKO_HEAD_REV'],
r'.\build\src')[0]
r'.\build\src', sparse_profile=sparse_profile)[0]
# Use `mach` to invoke python scripts so in-tree libraries are available.
if run['script'].endswith('.py'):