Bug 1335651 - Automatically add the script to files-changed for toolchain jobs. r=dustin
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 31 Jan 2017 18:00:55 +0900
changeset 343182 671410de0b248dc65f0dbbd4782a9253fb9c58f2
parent 343181 a0da8c39431d93d9efc043b44cf87087c16f4f53
child 343183 e7e02e3c2e56edb9ba8bff03716052ae261ebb26
push id37462
push usermh@glandium.org
push dateThu, 16 Feb 2017 04:38:25 +0000
treeherderautoland@e7e02e3c2e56 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdustin
bugs1335651
milestone54.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 1335651 - Automatically add the script to files-changed for toolchain jobs. r=dustin Also automatically add the job.toolchain python module itself.
taskcluster/ci/toolchain/linux.yml
taskcluster/ci/toolchain/macosx.yml
taskcluster/ci/toolchain/windows.yml
taskcluster/taskgraph/transforms/job/toolchain.py
--- a/taskcluster/ci/toolchain/linux.yml
+++ b/taskcluster/ci/toolchain/linux.yml
@@ -16,18 +16,16 @@ linux64-clang/opt:
     worker-type: aws-provisioner-v1/gecko-{level}-b-linux
     worker:
         implementation: docker-worker
         docker-image: {in-tree: desktop-build}
         max-run-time: 36000
     when:
         files-changed:
             - 'build/build-clang/**'
-            - 'taskcluster/scripts/misc/build-clang-linux.sh'
-            - 'taskcluster/taskgraph/transforms/job/toolchain.py'
 
 linux64-clang-tidy/opt:
     description: "Clang-tidy build"
     index:
         product: static-analysis
         job-name: linux64-clang-tidy
     treeherder:
         kind: build
@@ -42,18 +40,16 @@ linux64-clang-tidy/opt:
     worker:
         implementation: docker-worker
         docker-image: {in-tree: desktop-build}
         max-run-time: 36000
     when:
         files-changed:
             - 'build/clang-plugin/**'
             - 'build/build-clang/**'
-            - 'taskcluster/scripts/misc/build-clang-tidy-linux.sh'
-            - 'taskcluster/taskgraph/transforms/job/toolchain.py'
 
 linux64-gcc/opt:
     description: "GCC toolchain build"
     treeherder:
         kind: build
         platform: toolchains/opt
         symbol: TL(gcc)
         tier: 1
@@ -63,18 +59,16 @@ linux64-gcc/opt:
     worker-type: aws-provisioner-v1/gecko-{level}-b-linux
     worker:
         implementation: docker-worker
         docker-image: {in-tree: desktop-build}
         max-run-time: 36000
     when:
         files-changed:
             - 'build/unix/build-gcc/**'
-            - 'taskcluster/scripts/misc/build-gcc-linux.sh'
-            - 'taskcluster/taskgraph/transforms/job/toolchain.py'
 
 linux64-binutils/opt:
     description: "Binutils toolchain build"
     treeherder:
         kind: build
         platform: toolchains/opt
         symbol: TL(binutil)
         tier: 1
@@ -84,38 +78,32 @@ linux64-binutils/opt:
     worker-type: aws-provisioner-v1/gecko-{level}-b-linux
     worker:
         implementation: docker-worker
         docker-image: {in-tree: desktop-build}
         max-run-time: 36000
     when:
         files-changed:
             - 'build/unix/build-binutils/**'
-            - 'taskcluster/scripts/misc/build-binutils-linux.sh'
-            - 'taskcluster/taskgraph/transforms/job/toolchain.py'
 
 linux64-cctools-port/opt:
     description: "cctools-port toolchain build"
     treeherder:
         kind: build
         platform: toolchains/opt
         symbol: TL(cctools)
         tier: 1
     run:
         using: toolchain-script
         script: build-cctools-port.sh
     worker-type: aws-provisioner-v1/gecko-{level}-b-linux
     worker:
         implementation: docker-worker
         docker-image: {in-tree: desktop-build}
         max-run-time: 36000
-    when:
-        files-changed:
-            - 'taskcluster/scripts/misc/build-cctools-port.sh'
-            - 'taskcluster/taskgraph/transforms/job/toolchain.py'
 
 linux64-hfsplus/opt:
     description: "hfsplus toolchain build"
     treeherder:
         kind: build
         platform: toolchains/opt
         symbol: TL(hfs+)
         tier: 1
@@ -126,30 +114,24 @@ linux64-hfsplus/opt:
     worker-type: aws-provisioner-v1/gecko-{level}-b-linux
     worker:
         implementation: docker-worker
         docker-image: {in-tree: desktop-build}
         max-run-time: 36000
     when:
         files-changed:
             - 'build/unix/build-hfsplus/**'
-            - 'taskcluster/scripts/misc/build-hfsplus-linux.sh'
-            - 'taskcluster/taskgraph/transforms/job/toolchain.py'
 
 linux64-libdmg/opt:
     description: "libdmg-hfsplus toolchain build"
     treeherder:
         kind: build
         platform: toolchains/opt
         symbol: TL(libdmg-hfs+)
         tier: 1
     run:
         using: toolchain-script
         script: build-libdmg-hfsplus.sh
     worker-type: aws-provisioner-v1/gecko-{level}-b-linux
     worker:
         implementation: docker-worker
         docker-image: {in-tree: desktop-build}
         max-run-time: 36000
-    when:
-        files-changed:
-            - 'taskcluster/scripts/misc/build-libdmg-hfsplus.sh'
-            - 'taskcluster/taskgraph/transforms/job/toolchain.py'
--- a/taskcluster/ci/toolchain/macosx.yml
+++ b/taskcluster/ci/toolchain/macosx.yml
@@ -16,18 +16,16 @@ macosx64-clang/opt:
     worker-type: aws-provisioner-v1/gecko-{level}-b-macosx64
     worker:
         implementation: docker-worker
         docker-image: {in-tree: desktop-build}
         max-run-time: 36000
     when:
         files-changed:
             - 'build/build-clang/**'
-            - 'taskcluster/scripts/misc/build-clang-macosx.sh'
-            - 'taskcluster/taskgraph/transforms/job/toolchain.py'
 
 macosx64-clang-tidy/opt:
     description: "Clang-tidy build"
     index:
         product: static-analysis
         job-name: macosx64-clang-tidy
     treeherder:
         kind: build
@@ -42,18 +40,16 @@ macosx64-clang-tidy/opt:
     worker:
         implementation: docker-worker
         docker-image: {in-tree: desktop-build}
         max-run-time: 36000
     when:
         files-changed:
             - 'build/clang-plugin/**'
             - 'build/build-clang/**'
-            - 'taskcluster/scripts/misc/build-clang-tidy-macosx.sh'
-            - 'taskcluster/taskgraph/transforms/job/toolchain.py'
 
 macosx64-cctools-port/opt:
     description: "cctools-port toolchain build"
     treeherder:
         kind: build
         platform: toolchains/opt
         symbol: TM(cctools)
         tier: 1
@@ -61,12 +57,8 @@ macosx64-cctools-port/opt:
         using: toolchain-script
         script: build-cctools-port-macosx.sh
         tooltool-downloads: internal
     worker-type: aws-provisioner-v1/gecko-{level}-b-macosx64
     worker:
         implementation: docker-worker
         docker-image: {in-tree: desktop-build}
         max-run-time: 36000
-    when:
-        files-changed:
-            - 'taskcluster/scripts/misc/build-cctools-port-macosx.sh'
-            - 'taskcluster/taskgraph/transforms/job/toolchain.py'
--- a/taskcluster/ci/toolchain/windows.yml
+++ b/taskcluster/ci/toolchain/windows.yml
@@ -14,18 +14,16 @@ win32-clang-cl/opt:
         implementation: generic-worker
         max-run-time: 36000
     run:
         using: toolchain-script
         script: build-clang32-windows.sh
     when:
         files-changed:
             - 'build/build-clang/**'
-            - 'taskcluster/scripts/misc/build-clang32-windows.sh'
-            - 'taskcluster/taskgraph/transforms/job/toolchain.py'
 
 win64-clang-cl/opt:
     description: "Clang-cl toolchain build"
     treeherder:
         kind: build
         platform: toolchains/opt
         symbol: TW64(clang-cl)
         tier: 2
@@ -34,18 +32,16 @@ win64-clang-cl/opt:
         implementation: generic-worker
         max-run-time: 36000
     run:
         using: toolchain-script
         script: build-clang64-windows.sh
     when:
         files-changed:
             - 'build/build-clang/**'
-            - 'taskcluster/scripts/misc/build-clang64-windows.sh'
-            - 'taskcluster/taskgraph/transforms/job/toolchain.py'
 
 win32-clang-tidy/opt:
     description: "Clang-tidy toolchain build"
     index:
         product: static-analysis
         job-name: win32-clang-tidy
     treeherder:
         kind: build
@@ -57,18 +53,16 @@ win32-clang-tidy/opt:
         implementation: generic-worker
         max-run-time: 36000
     run:
         using: toolchain-script
         script: build-clang-tidy32-windows.sh
     when:
         files-changed:
             - 'build/build-clang/**'
-            - 'taskcluster/scripts/misc/build-clang-tidy32-windows.sh'
-            - 'taskcluster/taskgraph/transforms/job/toolchain.py'
 
 win64-clang-tidy/opt:
     description: "Clang-tidy toolchain build"
     index:
         product: static-analysis
         job-name: win64-clang-tidy
     treeherder:
         kind: build
@@ -80,10 +74,8 @@ win64-clang-tidy/opt:
         implementation: generic-worker
         max-run-time: 36000
     run:
         using: toolchain-script
         script: build-clang-tidy64-windows.sh
     when:
         files-changed:
             - 'build/build-clang/**'
-            - 'taskcluster/scripts/misc/build-clang-tidy64-windows.sh'
-            - 'taskcluster/taskgraph/transforms/job/toolchain.py'
--- a/taskcluster/taskgraph/transforms/job/toolchain.py
+++ b/taskcluster/taskgraph/transforms/job/toolchain.py
@@ -27,16 +27,24 @@ toolchain_run_schema = Schema({
     Required('tooltool-downloads', default=False): Any(
         False,
         'public',
         'internal',
     ),
 })
 
 
+def add_files_changed(run, taskdesc):
+    files = taskdesc.setdefault('when', {}).setdefault('files-changed', [])
+    # This file
+    files.append('taskcluster/taskgraph/transforms/job/toolchain.py')
+    # The script
+    files.append('taskcluster/scripts/misc/{}'.format(run['script']))
+
+
 @run_job_using("docker-worker", "toolchain-script", schema=toolchain_run_schema)
 def docker_worker_toolchain(config, job, taskdesc):
     run = job['run']
 
     worker = taskdesc['worker']
     worker['artifacts'] = []
     worker['caches'] = []
 
@@ -84,16 +92,18 @@ def docker_worker_toolchain(config, job,
         '--',
         'bash',
         '-c',
         'cd /home/worker && '
         './workspace/build/src/taskcluster/scripts/misc/{}'.format(
             run['script'])
     ]
 
+    add_files_changed(run, taskdesc)
+
 
 @run_job_using("generic-worker", "toolchain-script", schema=toolchain_run_schema)
 def windows_toolchain(config, job, taskdesc):
     run = job['run']
 
     worker = taskdesc['worker']
 
     worker['artifacts'] = [{
@@ -130,8 +140,10 @@ def windows_toolchain(config, job, taskd
     hg_command.append('.\\build\\src')
 
     bash = r'c:\mozilla-build\msys\bin\bash'
     worker['command'] = [
         ' '.join(hg_command),
         # do something intelligent.
         r'{} -c ./build/src/taskcluster/scripts/misc/{}'.format(bash, run['script'])
     ]
+
+    add_files_changed(run, taskdesc)