Bug 1469697 - Use run-task transform for spidermonkey tasks. r=tomprince
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 09 Aug 2019 16:58:16 +0900
changeset 488141 a1e9b49557436acb5dbb7e25668daebb3c5134c3
parent 488140 45bb0c1dfbf475c413e71d806c9a28c98198029c
child 488142 993f7ea9b2604c98fecc95225176b238b2aec491
push id36435
push usercbrindusan@mozilla.com
push dateThu, 15 Aug 2019 09:46:49 +0000
treeherdermozilla-central@0db07ff50ab5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstomprince
bugs1469697
milestone70.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 1469697 - Use run-task transform for spidermonkey tasks. r=tomprince Differential Revision: https://phabricator.services.mozilla.com/D41724
taskcluster/scripts/builder/sm-tooltool-config.sh
taskcluster/taskgraph/transforms/job/spidermonkey.py
--- a/taskcluster/scripts/builder/sm-tooltool-config.sh
+++ b/taskcluster/scripts/builder/sm-tooltool-config.sh
@@ -1,17 +1,17 @@
 #!/bin/bash
 
 set -x
 
 TOOLTOOL_SERVER=${TOOLTOOL_SERVER:-https://tooltool.mozilla-releng.net/}
 SPIDERMONKEY_VARIANT=${SPIDERMONKEY_VARIANT:-plain}
 UPLOAD_DIR=${UPLOAD_DIR:-$HOME/artifacts/}
 WORK=${WORK:-$HOME/workspace}
-SRCDIR=${SRCDIR:-$WORK/build/src}
+SRCDIR=${SRCDIR:-$GECKO_PATH}
 
 export TOOLTOOL_CHECKOUT=${TOOLTOOL_CHECKOUT:-$WORK}
 
 ( # Create scope for set -e
 set -e
 mkdir -p $WORK
 cd $WORK
 
--- a/taskcluster/taskgraph/transforms/job/spidermonkey.py
+++ b/taskcluster/taskgraph/transforms/job/spidermonkey.py
@@ -5,23 +5,24 @@
 Support for running spidermonkey jobs via dedicated scripts
 """
 
 from __future__ import absolute_import, print_function, unicode_literals
 
 from taskgraph.util.schema import Schema
 from voluptuous import Required, Any, Optional
 
-from taskgraph.transforms.job import run_job_using
+from taskgraph.transforms.job import (
+    run_job_using,
+    configure_taskdesc_for_run,
+)
 from taskgraph.transforms.job.common import (
     docker_worker_add_artifacts,
     generic_worker_add_artifacts,
-    generic_worker_hg_commands,
     docker_worker_add_tooltool,
-    support_vcs_checkout,
 )
 
 sm_run_schema = Schema({
     Required('using'): Any('spidermonkey', 'spidermonkey-package', 'spidermonkey-mozjs-crate',
                            'spidermonkey-rust-bindings'),
 
     # SPIDERMONKEY_VARIANT and SPIDERMONKEY_PLATFORM
     Required('spidermonkey-variant'): basestring,
@@ -36,104 +37,92 @@ sm_run_schema = Schema({
 @run_job_using("docker-worker", "spidermonkey-package", schema=sm_run_schema)
 @run_job_using("docker-worker", "spidermonkey-mozjs-crate",
                schema=sm_run_schema)
 @run_job_using("docker-worker", "spidermonkey-rust-bindings",
                schema=sm_run_schema)
 def docker_worker_spidermonkey(config, job, taskdesc):
     run = job['run']
 
-    worker = taskdesc['worker']
+    worker = taskdesc['worker'] = job['worker']
     worker['artifacts'] = []
     worker.setdefault('caches', []).append({
         'type': 'persistent',
         'name': '{}-build-spidermonkey-workspace'.format(config.params['project']),
         'mount-point': "{workdir}/workspace".format(**run),
         'skip-untrusted': True,
     })
 
     docker_worker_add_artifacts(config, job, taskdesc)
     docker_worker_add_tooltool(config, job, taskdesc)
 
     env = worker.setdefault('env', {})
     env.update({
         'MOZHARNESS_DISABLE': 'true',
-        'SPIDERMONKEY_VARIANT': run['spidermonkey-variant'],
+        'SPIDERMONKEY_VARIANT': run.pop('spidermonkey-variant'),
         'MOZ_BUILD_DATE': config.params['moz_build_date'],
         'MOZ_SCM_LEVEL': config.params['level'],
+        'GECKO_PATH': '{}/workspace/build/src'.format(run['workdir'])
     })
     if 'spidermonkey-platform' in run:
-        env['SPIDERMONKEY_PLATFORM'] = run['spidermonkey-platform']
-
-    support_vcs_checkout(config, job, taskdesc)
+        env['SPIDERMONKEY_PLATFORM'] = run.pop('spidermonkey-platform')
 
     script = "build-sm.sh"
     if run['using'] == 'spidermonkey-package':
         script = "build-sm-package.sh"
     elif run['using'] == 'spidermonkey-mozjs-crate':
         script = "build-sm-mozjs-crate.sh"
     elif run['using'] == 'spidermonkey-rust-bindings':
         script = "build-sm-rust-bindings.sh"
 
-    worker['command'] = [
-        '{workdir}/bin/run-task'.format(**run),
-        '--gecko-checkout', '{workdir}/workspace/build/src'.format(**run),
-        '--',
-        '/bin/bash',
-        '-c',
-        'cd {workdir} && workspace/build/src/taskcluster/scripts/builder/{script}'.format(
-            workdir=run['workdir'], script=script)
+    run['using'] = 'run-task'
+    run['cwd'] = run['workdir']
+    run['command'] = [
+        'workspace/build/src/taskcluster/scripts/builder/{script}'.format(
+            script=script)
     ]
 
+    configure_taskdesc_for_run(config, job, taskdesc, worker['implementation'])
+
 
 @run_job_using("generic-worker", "spidermonkey", schema=sm_run_schema)
 def generic_worker_spidermonkey(config, job, taskdesc):
     assert job['worker']['os'] == 'windows', 'only supports windows right now'
 
     run = job['run']
 
-    worker = taskdesc['worker']
+    worker = taskdesc['worker'] = job['worker']
 
     generic_worker_add_artifacts(config, job, taskdesc)
-    support_vcs_checkout(config, job, taskdesc)
 
     env = worker.setdefault('env', {})
     env.update({
         'MOZHARNESS_DISABLE': 'true',
-        'SPIDERMONKEY_VARIANT': run['spidermonkey-variant'],
+        'SPIDERMONKEY_VARIANT': run.pop('spidermonkey-variant'),
         'MOZ_BUILD_DATE': config.params['moz_build_date'],
         'MOZ_SCM_LEVEL': config.params['level'],
         'SCCACHE_DISABLE': "1",
         'WORK': ".",  # Override the defaults in build scripts
-        'SRCDIR': "./src",  # with values suiteable for windows generic worker
+        'GECKO_PATH': "./src",  # with values suiteable for windows generic worker
         'UPLOAD_DIR': "./public/build"
     })
     if 'spidermonkey-platform' in run:
-        env['SPIDERMONKEY_PLATFORM'] = run['spidermonkey-platform']
+        env['SPIDERMONKEY_PLATFORM'] = run.pop('spidermonkey-platform')
 
     script = "build-sm.sh"
     if run['using'] == 'spidermonkey-package':
         script = "build-sm-package.sh"
         # Don't allow untested configurations yet
         raise Exception("spidermonkey-package is not a supported configuration")
     elif run['using'] == 'spidermonkey-mozjs-crate':
         script = "build-sm-mozjs-crate.sh"
         # Don't allow untested configurations yet
         raise Exception("spidermonkey-mozjs-crate is not a supported configuration")
     elif run['using'] == 'spidermonkey-rust-bindings':
         script = "build-sm-rust-bindings.sh"
         # Don't allow untested configurations yet
         raise Exception("spidermonkey-rust-bindings is not a supported configuration")
 
-    hg_command = generic_worker_hg_commands(
-        'https://hg.mozilla.org/mozilla-unified',
-        env['GECKO_HEAD_REPOSITORY'],
-        env['GECKO_HEAD_REV'],
-        r'.\src',
-    )[0]
+    run['using'] = 'run-task'
+    run['command'] = ['c:\\mozilla-build\\msys\\bin\\bash.exe '  # string concat
+                      '"./src/taskcluster/scripts/builder/%s"' % script]
 
-    command = ['c:\\mozilla-build\\msys\\bin\\bash.exe '  # string concat
-               '"./src/taskcluster/scripts/builder/%s"' % script]
-
-    worker['command'] = [
-        hg_command,
-        ' '.join(command),
-    ]
+    configure_taskdesc_for_run(config, job, taskdesc, worker['implementation'])