From 4efd7c3f0ef2698358bf07a825980a0049d58abb Mon Sep 17 00:00:00 2001 From: Tom Prince Date: Mon, 26 Nov 2018 19:27:22 +0000 Subject: [PATCH] Bug 1508382: [taskgraph] Verify that the specifed sparse profile exists; r=gps Differential Revision: https://phabricator.services.mozilla.com/D12449 --HG-- extra : moz-landing-system : lando --- taskcluster/taskgraph/transforms/job/toolchain.py | 4 ++-- taskcluster/taskgraph/transforms/task.py | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/taskcluster/taskgraph/transforms/job/toolchain.py b/taskcluster/taskgraph/transforms/job/toolchain.py index c594b83c21c3..d542267c76c7 100644 --- a/taskcluster/taskgraph/transforms/job/toolchain.py +++ b/taskcluster/taskgraph/transforms/job/toolchain.py @@ -161,8 +161,8 @@ def docker_worker_toolchain(config, job, taskdesc): sparse_profile = [] if run.get('sparse-profile'): - sparse_profile = ['--sparse-profile', - 'build/sparse-profiles/{}'.format(run['sparse-profile'])] + sparse_profile = ['--sparse-profile=build/sparse-profiles/{}' + .format(run['sparse-profile'])] worker['command'] = [ '{workdir}/bin/run-task'.format(**run), diff --git a/taskcluster/taskgraph/transforms/task.py b/taskcluster/taskgraph/transforms/task.py index b1f14e7702f6..09d0b946cf05 100644 --- a/taskcluster/taskgraph/transforms/task.py +++ b/taskcluster/taskgraph/transforms/task.py @@ -1914,6 +1914,16 @@ def check_run_task_caches(config, tasks): break if arg.startswith('--sparse-profile'): + if '=' not in arg: + raise Exception( + '{} is specifying `--sparse-profile` to run-task as two arguments. ' + 'Unable to determine if the sparse profile exists.'.format( + task['label'])) + _, sparse_profile = arg.split('=', 1) + if not os.path.exists(os.path.join(GECKO, sparse_profile)): + raise Exception( + '{} is using non-existant sparse profile {}.'.format( + task['label'], sparse_profile)) require_sparse_cache = True break