Bug 1508382: [taskgraph] Verify that the specifed sparse profile exists; r=gps
authorTom Prince <mozilla@hocat.ca>
Mon, 26 Nov 2018 19:27:22 +0000
changeset 504526 6417da60696e53fea6174ffff00f84cf7c614b0e
parent 504525 4242055088b10a03bbd9570446cac1d4b33d83b6
child 504527 5b79f38fa7eec7e493654f113c362ade06c4fae1
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1508382
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1508382: [taskgraph] Verify that the specifed sparse profile exists; r=gps Differential Revision: https://phabricator.services.mozilla.com/D12449
taskcluster/taskgraph/transforms/job/toolchain.py
taskcluster/taskgraph/transforms/task.py
--- a/taskcluster/taskgraph/transforms/job/toolchain.py
+++ b/taskcluster/taskgraph/transforms/job/toolchain.py
@@ -156,18 +156,18 @@ def docker_worker_toolchain(config, job,
         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'])]
+        sparse_profile = ['--sparse-profile=build/sparse-profiles/{}'
+                          .format(run['sparse-profile'])]
 
     worker['command'] = [
         '{workdir}/bin/run-task'.format(**run),
         '--vcs-checkout={}'.format(gecko_path),
     ] + sparse_profile + [
         '--',
         'bash',
         '-c',
--- a/taskcluster/taskgraph/transforms/task.py
+++ b/taskcluster/taskgraph/transforms/task.py
@@ -1909,16 +1909,26 @@ def check_run_task_caches(config, tasks)
             for arg in command[1:]:
                 if not isinstance(arg, basestring):
                     continue
 
                 if arg == '--':
                     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
 
         for cache in payload.get('cache', {}):
             if re_sparse_checkout_cache.match(cache):
                 have_sparse_cache = True
 
             if not re_reserved_caches.match(cache):