Bug 1328199 - Part 2: Add a TaskCluster job to build clang-tidy for OSX on Linux; r=dustin
authorEhsan Akhgari <ehsan@mozilla.com>
Mon, 02 Jan 2017 17:02:55 -0500
changeset 373077 0026f22490e25d2e4a8f9cadd8ff188c5506e8e7
parent 373076 8f6512e0df5783135231579c87a0b86d72eb1a09
child 373078 b4faf5602cc780291ff418e0bd830776e5b83439
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdustin
bugs1328199
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 1328199 - Part 2: Add a TaskCluster job to build clang-tidy for OSX on Linux; r=dustin
browser/config/tooltool-manifests/macosx64/cross-clang.manifest
build/build-clang/clang-tidy-macosx64.json
taskcluster/ci/toolchain/kind.yml
taskcluster/ci/toolchain/macosx.yml
taskcluster/scripts/misc/build-clang-tidy-macosx.sh
new file mode 100644
--- /dev/null
+++ b/browser/config/tooltool-manifests/macosx64/cross-clang.manifest
@@ -0,0 +1,43 @@
+[
+{
+"version": "clang 3.8.0, libgcc 4.9.4 + PR64905",
+"size": 155933720,
+"digest": "7a3a9a5ff455554d120596fe4bc06c19e41ecbd1e67b1e95e778c0b8ce6d9472f30fd4a27c66d48d9c047aac7a077f23f87397711dd6f33175f95cf4a2ada862",
+"algorithm": "sha512",
+"filename": "clang.tar.xz",
+"unpack": true
+},
+{
+"version": "gcc 4.9.4 + PR64905",
+"size": 101297752,
+"digest": "42aa2e3fdd232b5e390472a788e7f7db71a1fee4221e260b6cb58c9a1d73e6cdd10afcbac137f7844290169cd6b561b424ecc92b159e9726b0ad5de3f478a8be",
+"algorithm": "sha512",
+"filename": "gcc.tar.xz",
+"unpack": true
+},
+{
+"size": 3008804,
+"visibility": "public",
+"digest": "ba6937f14f3d8b26dcb2d39490dee6b0a8afb60f672f5debb71d7b62c1ec52103201b4b1a3d258f945567de531384b36ddb2ce4aa73dc63d72305b11c146847c",
+"algorithm": "sha512",
+"unpack": true,
+"filename": "cctools.tar.gz"
+},
+{
+"size": 30823112,
+"visibility": "internal",
+"digest": "0c58e06a3ea8f4641c991a7406fc8733c574f0b4aa773bce0feaa5468d2b8440fa33cea056e16fad2b8a7ef4409ca7228113eb12adc87c3e115129d8a3b3b565",
+"algorithm": "sha512",
+"unpack": true,
+"filename": "MacOSX10.10.sdk.tar.xz"
+},
+{
+"version": "sccache rev b21198a7183a2fe226ff49348b1c0b51bae9f4f8",
+"algorithm": "sha512",
+"visibility": "public",
+"filename": "sccache2.tar.xz",
+"unpack": true,
+"digest": "b89c40dbf28c2bd54fadf017c15a8789f6e7611252a623cc3a1507e3dd6fc9e5a50d746e81776ba856e33fdc99b4a6413ba7c3ac0aed5f4835705da2b758ef22",
+"size": 1020700
+}
+]
new file mode 100644
--- /dev/null
+++ b/build/build-clang/clang-tidy-macosx64.json
@@ -0,0 +1,22 @@
+{
+    "llvm_revision": "290055",
+    "stages": "1",
+    "build_libcxx": true,
+    "build_type": "Release",
+    "assertions": false,
+    "import_clang_tidy": true,
+    "osx_cross_compile": 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/clang/bin/clang",
+    "cxx": "/home/worker/workspace/build/src/clang/bin/clang++",
+    "ar": "/home/worker/workspace/build/src/cctools/bin/x86_64-apple-darwin10-ar",
+    "ranlib": "/home/worker/workspace/build/src/cctools/bin/x86_64-apple-darwin10-ranlib",
+    "ld": "/home/worker/workspace/build/src/clang/bin/clang"
+}
--- a/taskcluster/ci/toolchain/kind.yml
+++ b/taskcluster/ci/toolchain/kind.yml
@@ -6,9 +6,10 @@ implementation: taskgraph.task.transform
 
 transforms:
    - taskgraph.transforms.build_attrs:transforms
    - taskgraph.transforms.job:transforms
    - taskgraph.transforms.task:transforms
 
 jobs-from:
    - linux.yml
+   - macosx.yml
    - windows.yml
new file mode 100644
--- /dev/null
+++ b/taskcluster/ci/toolchain/macosx.yml
@@ -0,0 +1,27 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+macosx64-clang-tidy/opt:
+    description: "Clang-tidy build"
+    treeherder:
+        kind: build
+        platform: osx-10-10/opt
+        symbol: Cc(Clang-Tidy)
+        tier: 1
+    run:
+        using: toolchain-script
+        script: build-clang-tidy-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:
+            - 'build/clang-plugin/**'
+            - 'build/build-clang/**'
+            - 'taskcluster/scripts/misc/build-clang-tidy-macosx.sh'
+            - 'taskcluster/taskgraph/transforms/job/toolchain.py'
+
new file mode 100755
--- /dev/null
+++ b/taskcluster/scripts/misc/build-clang-tidy-macosx.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+set -x -e -v
+
+# This script is for building clang for Mac OS X on Linux.
+
+WORKSPACE=$HOME/workspace
+HOME_DIR=$WORKSPACE/build
+UPLOAD_DIR=$WORKSPACE/artifacts
+
+cd $HOME_DIR/src
+
+chmod +x taskcluster/docker/recipes/tooltool.py
+: TOOLTOOL_CACHE                ${TOOLTOOL_CACHE:=/home/worker/tooltool-cache}
+export TOOLTOOL_CACHE
+
+
+TOOLTOOL_MANIFEST=browser/config/tooltool-manifests/macosx64/cross-clang.manifest
+./taskcluster/docker/recipes/tooltool.py --url=http://relengapi/tooltool/ -m "${TOOLTOOL_MANIFEST}" fetch
+
+# ld needs libLTO.so from llvm
+export LD_LIBRARY_PATH=$HOME_DIR/src/clang/lib
+# these variables are used in build-clang.py
+export CROSS_CCTOOLS_PATH=$HOME_DIR/src/cctools
+export CROSS_SYSROOT=$HOME_DIR/src/MacOSX10.10.sdk
+export LIBCXX_INCLUDE_PATH=$HOME_DIR/src/clang/include/c++/v1
+# cmake doesn't allow us to specify a path to lipo on the command line.
+ln -sf $CROSS_CCTOOLS_PATH/bin/x86_64-apple-darwin10-lipo /usr/bin/lipo
+
+# 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-macosx64.json
+
+set -x
+
+# Put a tarball in the artifacts dir
+mkdir -p $UPLOAD_DIR
+cp clang-tidy.tar.* $UPLOAD_DIR