Bug 1262729 - Allow to more conveniently build toolchains. r?dustin draft
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 27 Jan 2016 17:56:16 +0900
changeset 350218 73d2087c8b27affa4b8b497aa4728c580c4c9ebe
parent 350196 b9b725d135289eed40c18112555d7b009ac9ee47
child 350222 22ec64a05cb698fbf11c1d672991976369b2c8ed
push id15271
push userbmo:mh+mozilla@glandium.org
push dateTue, 12 Apr 2016 23:28:31 +0000
reviewersdustin
bugs1262729
milestone48.0a1
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.
testing/taskcluster/scripts/misc/build-gcc-linux.sh
testing/taskcluster/tasks/branches/base_jobs.yml
testing/taskcluster/tasks/builds/linux64_clang.yml
testing/taskcluster/tasks/builds/linux64_gcc.yml
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