Bug 1324488 - Add a TaskCluster job to build clang-tidy on Linux; r=dustin
authorEhsan Akhgari <ehsan@mozilla.com>
Sun, 18 Dec 2016 01:04:11 -0500
changeset 375359 84e0ff8ca28fdc5601a43e7cf2a0511ea0b30549
parent 375358 73dae2d9869edc721b053629d766d66074d1ce68
child 375360 8f6512e0df5783135231579c87a0b86d72eb1a09
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdustin
bugs1324488
milestone53.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 1324488 - Add a TaskCluster job to build clang-tidy on Linux; r=dustin
build/build-clang/clang-tidy-linux64.json
taskcluster/ci/toolchain/linux.yml
taskcluster/scripts/misc/build-clang-tidy-linux.sh
new file mode 100644
--- /dev/null
+++ b/build/build-clang/clang-tidy-linux64.json
@@ -0,0 +1,18 @@
+{
+    "llvm_revision": "290055",
+    "stages": "1",
+    "build_libcxx": true,
+    "build_type": "Release",
+    "assertions": false,
+    "import_clang_tidy": true,
+    "llvm_repo": "https://llvm.org/svn/llvm-project/llvm/trunk",
+    "clang_repo": "https://llvm.org/svn/llvm-project/cfe/trunk",
+    "extra_repo": "https://llvm.org/svn/llvm-project/clang-tools-extra/trunk",
+    "compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/trunk",
+    "libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/trunk",
+    "libcxxabi_repo": "https://llvm.org/svn/llvm-project/libcxxabi/trunk",
+    "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++"
+}
--- a/taskcluster/ci/toolchain/linux.yml
+++ b/taskcluster/ci/toolchain/linux.yml
@@ -18,16 +18,38 @@ linux64-clang/opt:
         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"
+    treeherder:
+        kind: build
+        platform: linux64/opt
+        symbol: Cc(Clang-Tidy)
+        tier: 1
+    run:
+        using: toolchain-script
+        script: build-clang-tidy-linux.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:
+            - '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: linux64/opt
         symbol: Cc(GCC)
         tier: 1
     run:
new file mode 100755
--- /dev/null
+++ b/taskcluster/scripts/misc/build-clang-tidy-linux.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+set -x -e -v
+
+# This script is for building clang for Linux.
+
+WORKSPACE=$HOME/workspace
+HOME_DIR=$WORKSPACE/build
+UPLOAD_DIR=$WORKSPACE/artifacts
+
+# Fetch our toolchain from tooltool
+cd $HOME_DIR
+wget -O tooltool.py https://raw.githubusercontent.com/mozilla/build-tooltool/master/tooltool.py
+chmod +x tooltool.py
+: TOOLTOOL_CACHE                ${TOOLTOOL_CACHE:=/home/worker/tooltool-cache}
+export TOOLTOOL_CACHE
+cd src
+$HOME_DIR/tooltool.py -m browser/config/tooltool-manifests/linux64/releng.manifest fetch
+
+# 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-tidy-linux64.json
+
+set -x
+
+# Put a tarball in the artifacts dir
+mkdir -p $UPLOAD_DIR
+cp clang.tar.* $UPLOAD_DIR