Bug 1316537 part 1 - Add 64-bit clang-cl toolchain build. r?dustin draft
authorTing-Yu Chou <janus926@gmail.com>
Tue, 15 Nov 2016 09:06:08 +0800
changeset 438832 43413c59ff57d9881370859e7625647c993000b4
parent 435666 783356f1476eafd8e4d6fa5f3919cf6167e84f8d
child 438833 37858ea5c0970ef5edf484c9f911810e33755e2d
child 438836 217c470a7a9e5071292644590933c735edb52aec
push id35828
push userbmo:janus926@gmail.com
push dateTue, 15 Nov 2016 04:25:23 +0000
reviewersdustin
bugs1316537
milestone52.0a1
Bug 1316537 part 1 - Add 64-bit clang-cl toolchain build. r?dustin MozReview-Commit-ID: 5EKWZ94TrMD
taskcluster/ci/toolchain/windows.yml
taskcluster/scripts/misc/build-clang-windows.sh
taskcluster/scripts/misc/build-clang32-windows.sh
taskcluster/scripts/misc/build-clang64-windows.sh
--- a/taskcluster/ci/toolchain/windows.yml
+++ b/taskcluster/ci/toolchain/windows.yml
@@ -10,14 +10,34 @@ win32-clang-cl/opt:
         symbol: Cc(ClangCL)
         tier: 2
     worker-type: aws-provisioner-v1/gecko-{level}-b-win2012
     worker:
         implementation: generic-worker
         max-run-time: 36000
     run:
         using: toolchain-script
-        script: build-clang-windows.sh
+        script: build-clang32-windows.sh
     when:
         files-changed:
             - 'build/build-clang/**'
-            - 'taskcluster/scripts/misc/build-clang-windows.sh'
+            - 'taskcluster/scripts/misc/build-clang32-windows.sh'
             - 'taskcluster/taskgraph/transforms/job/toolchain.py'
+
+win64-clang-cl/opt:
+    description: "Clang-cl toolchain build"
+    treeherder:
+        kind: build
+        platform: windows-2012-64/opt
+        symbol: Cc(ClangCL)
+        tier: 2
+    worker-type: aws-provisioner-v1/gecko-{level}-b-win2012
+    worker:
+        implementation: generic-worker
+        max-run-time: 36000
+    run:
+        using: toolchain-script
+        script: build-clang64-windows.sh
+    when:
+        files-changed:
+            - 'build/build-clang/**'
+            - 'taskcluster/scripts/misc/build-clang64-windows.sh'
+            - 'taskcluster/taskgraph/transforms/job/toolchain.py'
rename from taskcluster/scripts/misc/build-clang-windows.sh
rename to taskcluster/scripts/misc/build-clang32-windows.sh
new file mode 100644
--- /dev/null
+++ b/taskcluster/scripts/misc/build-clang64-windows.sh
@@ -0,0 +1,60 @@
+#!/bin/bash
+
+set -x -e -v
+
+# This script is for building clang-cl on Windows.
+
+# Fetch our toolchain from tooltool.
+wget -O tooltool.py ${TOOLTOOL_REPO}/raw/${TOOLTOOL_REV}/tooltool.py
+chmod +x tooltool.py
+: TOOLTOOL_CACHE                ${TOOLTOOL_CACHE:=/home/worker/tooltool-cache}
+export TOOLTOOL_CACHE
+
+TOOLTOOL_AUTH_FILE=/c/builds/relengapi.tok
+if [ ! -e ${TOOLTOOL_AUTH_FILE} ]; then
+    echo cannot find ${TOOLTOOL_AUTH_FILE}
+    exit 1
+fi
+
+TOOLTOOL_MANIFEST=build/src/browser/config/tooltool-manifests/win32/build-clang-cl.manifest
+./tooltool.py --authentication-file="${TOOLTOOL_AUTH_FILE}" -m "${TOOLTOOL_MANIFEST}" fetch
+
+# Set up all the Visual Studio paths.
+MSVC_DIR=vs2015u3
+VSWINPATH="$(cd ${MSVC_DIR} && pwd)"
+
+echo vswinpath ${VSWINPATH}
+
+export WINDOWSSDKDIR="${VSWINPATH}/SDK"
+export WIN32_REDIST_DIR="${VSWINPATH}/VC/redist/x64/Microsoft.VC140.CRT"
+export WIN_UCRT_REDIST_DIR="${VSWINPATH}/SDK/Redist/ucrt/DLLs/x64"
+
+export PATH="${VSWINPATH}/VC/bin/amd64:${VSWINPATH}/VC/bin:${VSWINPATH}/SDK/bin/x64:${VSWINPATH}/VC/redist/x64/Microsoft.VC140.CRT:${VSWINPATH}/SDK/Redist/ucrt/DLLs/x64:${VSWINPATH}/DIA SDK/bin/amd64:${PATH}"
+
+export INCLUDE="${VSWINPATH}/VC/include:${VSWINPATH}/VC/atlmfc/include:${VSWINPATH}/SDK/Include/10.0.14393.0/ucrt:${VSWINPATH}/SDK/Include/10.0.14393.0/shared:${VSWINPATH}/SDK/Include/10.0.14393.0/um:${VSWINPATH}/SDK/Include/10.0.14393.0/winrt:${VSWINPATH}/DIA SDK/include"
+export LIB="${VSWINPATH}/VC/lib/amd64:${VSWINPATH}/VC/atlmfc/lib/amd64:${VSWINPATH}/SDK/lib/10.0.14393.0/ucrt/x64:${VSWINPATH}/SDK/lib/10.0.14393.0/um/x64:${VSWINPATH}/DIA SDK/lib/amd64"
+
+export PATH="$(cd svn && pwd)/bin:${PATH}"
+export PATH="$(cd cmake && pwd)/bin:${PATH}"
+export PATH="$(cd ninja && pwd)/bin:${PATH}"
+
+# We use |mach python| to set up a virtualenv automatically for us.  We create
+# a dummy mozconfig, because the default machinery for config.guess-choosing
+# of the objdir doesn't work very well.
+MOZCONFIG="$(pwd)/mozconfig"
+cat > ${MOZCONFIG} <<EOF
+mk_add_options MOZ_OBJDIR=$(pwd)/objdir
+EOF
+
+# gets a bit too verbose here
+set +x
+
+BUILD_CLANG_DIR=build/src/build/build-clang
+MOZCONFIG=${MOZCONFIG} build/src/mach python ${BUILD_CLANG_DIR}/build-clang.py -c ${BUILD_CLANG_DIR}/clang-static-analysis-win64.json
+
+set -x
+
+# Put a tarball in the artifacts dir
+UPLOAD_PATH=public/build
+mkdir -p ${UPLOAD_PATH}
+cp clang.tar.* ${UPLOAD_PATH}