Bug 1386588 - Add a toolchain job for Clang 4. r?gps draft
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 02 Aug 2017 19:53:28 +0900
changeset 619733 49d45ae7a573f799025a23749581bc1270780e55
parent 619732 d8954e252860c2b471fa2454a1a191402c5c239c
child 619734 f838fe547c61d0009c7556e94677f06a491d87d8
push id71785
push userbmo:mh+mozilla@glandium.org
push dateWed, 02 Aug 2017 13:26:36 +0000
reviewersgps
bugs1386588
milestone56.0a1
Bug 1386588 - Add a toolchain job for Clang 4. r?gps
build/build-clang/clang-4-linux64.json
taskcluster/ci/toolchain/linux.yml
taskcluster/scripts/misc/build-clang-4-linux.sh
new file mode 100644
--- /dev/null
+++ b/build/build-clang/clang-4-linux64.json
@@ -0,0 +1,20 @@
+{
+    "llvm_revision": "305830",
+    "stages": "3",
+    "build_libcxx": true,
+    "build_type": "Release",
+    "assertions": false,
+    "llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_401/final",
+    "clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_401/final",
+    "compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_401/final",
+    "libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_401/final",
+    "libcxxabi_repo": "https://llvm.org/svn/llvm-project/libcxxabi/tags/RELEASE_401/final",
+    "python_path": "/usr/bin/python2.7",
+    "gcc_dir": "/home/worker/workspace/build/src/gcc",
+    "cc": "/home/worker/workspace/build/src/gcc/bin/gcc",
+    "cxx": "/home/worker/workspace/build/src/gcc/bin/g++",
+    "as": "/home/worker/workspace/build/src/gcc/bin/gcc",
+    "patches": [
+      "llvm-debug-frame.patch"
+    ]
+}
--- a/taskcluster/ci/toolchain/linux.yml
+++ b/taskcluster/ci/toolchain/linux.yml
@@ -20,16 +20,38 @@ linux64-clang-3.9:
             - 'build/build-clang/build-clang.py'
             - 'build/build-clang/clang-3.9-linux64.json'
             - 'taskcluster/scripts/misc/tooltool-download.sh'
         toolchain-alias: linux64-clang
         toolchain-artifact: public/build/clang.tar.xz
     toolchains:
         - linux64-gcc-4.8
 
+linux64-clang-4:
+    description: "Clang 4 toolchain build"
+    treeherder:
+        kind: build
+        platform: toolchains/opt
+        symbol: TL(clang4)
+        tier: 1
+    worker-type: aws-provisioner-v1/gecko-{level}-b-linux
+    worker:
+        docker-image: {in-tree: desktop-build}
+        max-run-time: 36000
+    run:
+        using: toolchain-script
+        script: build-clang-4-linux.sh
+        resources:
+            - 'build/build-clang/build-clang.py'
+            - 'build/build-clang/clang-4-linux64.json'
+            - 'taskcluster/scripts/misc/tooltool-download.sh'
+        toolchain-artifact: public/build/clang.tar.xz
+    toolchains:
+        - linux64-gcc-4.8
+
 linux64-clang-tidy:
     description: "Clang-tidy build"
     index:
         product: static-analysis
         job-name: linux64-clang-tidy
     treeherder:
         kind: build
         platform: toolchains/opt
new file mode 100755
--- /dev/null
+++ b/taskcluster/scripts/misc/build-clang-4-linux.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+set -x -e -v
+
+# This script is for building clang for Linux.
+
+WORKSPACE=$HOME/workspace
+HOME_DIR=$WORKSPACE/build
+UPLOAD_DIR=$HOME/artifacts
+
+cd $HOME_DIR/src
+
+. taskcluster/scripts/misc/tooltool-download.sh
+
+# gets a bit too verbose here
+set +x
+
+cd build/build-clang
+# |mach python| sets up a virtualenv for us!
+../../mach python ./build-clang.py -c clang-4-linux64.json
+
+set -x
+
+# Put a tarball in the artifacts dir
+mkdir -p $UPLOAD_DIR
+cp clang.tar.* $UPLOAD_DIR