Bug 1405413 - Pre: Allow toolchain tasks to (un)set sparse-profile. r=glandium
Specifying anything but "toolchain-build" appears to have cache
errors, which I cannot understand. These cache errors can be
addressed in follow-up, if and when toolchain tasks require new sparse
profiles. But specifying `null` avoids the sparse profile details
entirely, which works nicely for `android-gradle-dependencies`, which
is build-like and requires a fairly complete checkout.
MozReview-Commit-ID: L3R8UIDjgqW
--- a/taskcluster/taskgraph/transforms/job/toolchain.py
+++ b/taskcluster/taskgraph/transforms/job/toolchain.py
@@ -45,16 +45,23 @@ toolchain_run_schema = Schema({
False,
'public',
'internal',
),
# If true, tc-vcs will be enabled. Not supported on Windows.
Required('tc-vcs', default=True): bool,
+ # Sparse profile to give to checkout using `run-task`. If given,
+ # a filename in `build/sparse-profiles`. Defaults to
+ # "toolchain-build", i.e., to
+ # `build/sparse-profiles/toolchain-build`. If `None`, instructs
+ # `run-task` to not use a sparse profile at all.
+ Required('sparse-profile', default='toolchain-build'): Any(basestring, None),
+
# Paths/patterns pointing to files that influence the outcome of a
# toolchain build.
Optional('resources'): [basestring],
# Path to the artifact produced by the toolchain job
Required('toolchain-artifact'): basestring,
# An alias that can be used instead of the real toolchain job name in
@@ -145,20 +152,25 @@ def docker_worker_toolchain(config, job,
wrapper = 'workspace/build/src/mach python '
else:
wrapper = ''
args = run.get('arguments', '')
if args:
args = ' ' + shell_quote(*args)
+ sparse_profile = []
+ if run.get('sparse-profile'):
+ sparse_profile = ['--sparse-profile',
+ 'build/sparse-profiles/{}'.format(run['sparse-profile'])]
+
worker['command'] = [
'/builds/worker/bin/run-task',
'--vcs-checkout=/builds/worker/workspace/build/src',
- '--sparse-profile', 'build/sparse-profiles/toolchain-build',
+ ] + sparse_profile + [
'--',
'bash',
'-c',
'cd /builds/worker && '
'{}workspace/build/src/taskcluster/scripts/misc/{}{}'.format(
wrapper, run['script'], args)
]