Bug 1262729 - Allow to more conveniently build toolchains. r?dustin
Currently, we have in-tree scripts that allow to build our toolchains.
We also have a taskcluster script for clang that can be used in with
manually created taskcluster tasks. I wrote a similar script for gcc a
while ago, for the same usage.
This change hooks all these up such that one can do a try push with
`-j linux64-clang` or `-j linux64-gcc` and get a toolchain built as a
result.
It also hooks things up such that changes to the toolchain build scripts
trigger those jobs as well, so as to ensure they are not broken by the
changes.
new file mode 100755
--- /dev/null
+++ b/testing/taskcluster/scripts/misc/build-gcc-linux.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+set -e
+
+# This script is for building GCC for Linux.
+
+WORKSPACE=$HOME/workspace
+HOME_DIR=$WORKSPACE/build
+UPLOAD_DIR=$WORKSPACE/artifacts
+
+cd $HOME_DIR/src
+
+build/unix/build-gcc/build-gcc.sh $HOME_DIR
+
+# Put a tarball in the artifacts dir
+mkdir -p $UPLOAD_DIR
+cp $HOME_DIR/gcc.tar.* $UPLOAD_DIR
--- a/testing/taskcluster/tasks/branches/base_jobs.yml
+++ b/testing/taskcluster/tasks/branches/base_jobs.yml
@@ -327,8 +327,22 @@ tasks:
file_patterns:
- 'testing/mozharness/**'
marionette-harness:
task: tasks/tests/harness_marionette.yml
root: true
when:
file_patterns:
- 'testing/marionette/harness/**'
+ linux64-gcc:
+ task: tasks/builds/linux64_gcc.yml
+ root: true
+ when:
+ file_patterns:
+ - 'build/unix/build-gcc/**'
+ - 'testing/taskcluster/scripts/misc/build-gcc-linux.sh'
+ linux64-clang:
+ task: tasks/builds/linux64_clang.yml
+ root: true
+ when:
+ file_patterns:
+ - 'build/build-clang/**'
+ - 'testing/taskcluster/scripts/misc/build-clang-linux.sh'
new file mode 100644
--- /dev/null
+++ b/testing/taskcluster/tasks/builds/linux64_clang.yml
@@ -0,0 +1,51 @@
+$inherits:
+ from: 'tasks/builds/firefox_base.yml'
+ variables:
+ build_name: 'linux64-clang'
+ build_type: 'opt'
+task:
+ metadata:
+ name: '[TC] Clang'
+ description: 'Clang'
+
+ workerType: opt-linux64
+
+ routes:
+ - 'index.buildbot.branches.{{project}}.clang'
+ - 'index.buildbot.revisions.{{head_rev}}.{{project}}.clang'
+
+ scopes:
+ - 'docker-worker:cache:tooltool-cache'
+
+ payload:
+ cache:
+ tooltool-cache: '/home/worker/tooltool-cache'
+
+ env:
+ MOZHARNESS_DISABLE: 'true'
+ TOOLS_DISABLE: 'true'
+ TOOLTOOL_CACHE: '/home/worker/tooltool-cache'
+
+ maxRunTime: 36000
+
+ command: ["/bin/bash", "-c", "cd /home/worker/ && ./bin/checkout-sources.sh && ./workspace/build/src/testing/taskcluster/scripts/misc/build-clang-linux.sh" ]
+
+ artifacts:
+ 'public/clang.tar.xz':
+ type: file
+ path: '/home/worker/workspace/artifacts/clang.tar.xz'
+ expires: '{{#from_now}}1 year{{/from_now}}'
+
+ extra:
+ treeherderEnv:
+ - staging
+ - production
+ treeherder:
+ groupSymbol: Cc
+ groupName: Compilers, submitted by taskcluster
+ symbol: Clang
+ machine:
+ platform: linux64
+ locations:
+ build: null
+ tests: null
new file mode 100644
--- /dev/null
+++ b/testing/taskcluster/tasks/builds/linux64_gcc.yml
@@ -0,0 +1,44 @@
+$inherits:
+ from: 'tasks/builds/firefox_base.yml'
+ variables:
+ build_name: 'linux64-gcc'
+ build_type: 'opt'
+task:
+ metadata:
+ name: '[TC] GCC'
+ description: 'GCC'
+
+ workerType: opt-linux64
+
+ routes:
+ - 'index.buildbot.branches.{{project}}.gcc'
+ - 'index.buildbot.revisions.{{head_rev}}.{{project}}.gcc'
+
+ payload:
+ env:
+ MOZHARNESS_DISABLE: 'true'
+ TOOLS_DISABLE: 'true'
+
+ maxRunTime: 36000
+
+ command: ["/bin/bash", "-c", "cd /home/worker/ && ./bin/checkout-sources.sh && ./workspace/build/src/testing/taskcluster/scripts/misc/build-gcc-linux.sh" ]
+
+ artifacts:
+ 'public/gcc.tar.xz':
+ type: file
+ path: '/home/worker/workspace/artifacts/gcc.tar.xz'
+ expires: '{{#from_now}}1 year{{/from_now}}'
+
+ extra:
+ treeherderEnv:
+ - staging
+ - production
+ treeherder:
+ groupSymbol: Cc
+ groupName: Compilers, submitted by taskcluster
+ symbol: GCC
+ machine:
+ platform: linux64
+ locations:
+ build: null
+ tests: null