From 047574b0bd874e4b6f2f4c53ff2e83163fcd0414 Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Fri, 21 Sep 2018 10:56:47 +0200 Subject: [PATCH] Bug 1492159 - Build Linux and Mac grcov in a toolchain task. r=ahal --HG-- extra : rebase_source : 922e19f9d2a77fd3dec33c84f3c675ed37ece6b7 --- taskcluster/ci/toolchain/linux.yml | 20 +++++++++++ taskcluster/ci/toolchain/macosx.yml | 20 +++++++++++ taskcluster/scripts/misc/build-grcov.sh | 46 +++++++++++++++++++++++++ 3 files changed, 86 insertions(+) create mode 100755 taskcluster/scripts/misc/build-grcov.sh diff --git a/taskcluster/ci/toolchain/linux.yml b/taskcluster/ci/toolchain/linux.yml index c913f0fa477c..1770d268e70b 100755 --- a/taskcluster/ci/toolchain/linux.yml +++ b/taskcluster/ci/toolchain/linux.yml @@ -665,6 +665,26 @@ linux64-rust-size: toolchains: - linux64-rust-1.28 +linux64-grcov: + description: "grcov toolchain build" + treeherder: + kind: build + platform: toolchains/opt + symbol: TL(grcov) + tier: 1 + worker-type: aws-provisioner-v1/gecko-{level}-b-linux + worker: + max-run-time: 1800 + run: + using: toolchain-script + script: build-grcov.sh + resources: + - 'taskcluster/scripts/misc/tooltool-download.sh' + toolchain-artifact: public/build/grcov.tar.xz + toolchains: + - linux64-rust-1.28 + - linux64-clang-6 + linux64-gn: description: "gn toolchain build" treeherder: diff --git a/taskcluster/ci/toolchain/macosx.yml b/taskcluster/ci/toolchain/macosx.yml index 42a190114867..26c971697960 100644 --- a/taskcluster/ci/toolchain/macosx.yml +++ b/taskcluster/ci/toolchain/macosx.yml @@ -132,3 +132,23 @@ macosx64-node: script: repack-node.sh arguments: ['macosx64'] toolchain-artifact: public/build/node.tar.xz + +macosx64-grcov: + description: "grcov toolchain build" + treeherder: + kind: build + platform: toolchains/opt + symbol: TM(grcov) + tier: 1 + worker-type: aws-provisioner-v1/gecko-{level}-b-linux + worker: + max-run-time: 1800 + run: + using: toolchain-script + script: build-grcov.sh + resources: + - 'taskcluster/scripts/misc/tooltool-download.sh' + toolchain-artifact: public/build/grcov.tar.xz + toolchains: + - linux64-rust-1.28 + - linux64-clang-6 diff --git a/taskcluster/scripts/misc/build-grcov.sh b/taskcluster/scripts/misc/build-grcov.sh new file mode 100755 index 000000000000..cb07d75db8c0 --- /dev/null +++ b/taskcluster/scripts/misc/build-grcov.sh @@ -0,0 +1,46 @@ +#!/bin/bash +set -x -e -v + +# This script is for building grcov + +OWNER=marco-c +PROJECT=grcov +PROJECT_REVISION=376ab00c79682a9138f54d7756e503babf140af3 + +WORKSPACE=$HOME/workspace +UPLOAD_DIR=$HOME/artifacts +COMPRESS_EXT=xz + +PATH="$WORKSPACE/build/src/clang/bin/:$PATH" + +cd $WORKSPACE/build/src + +. taskcluster/scripts/misc/tooltool-download.sh + +# cargo gets mad if the parent directory has a Cargo.toml file in it +if [ -e Cargo.toml ]; then + mv Cargo.toml Cargo.toml.back +fi + +PATH="$PWD/rustc/bin:$PATH" + +git clone -n https://github.com/${OWNER}/${PROJECT} ${PROJECT} + +pushd $PROJECT + +git checkout $PROJECT_REVISION + +cargo build --verbose --release + +mkdir $PROJECT +cp target/release/${PROJECT}* ${PROJECT}/ +pushd $PROJECT +tar -acf ../${PROJECT}.tar.$COMPRESS_EXT * +popd +mkdir -p $UPLOAD_DIR +cp ${PROJECT}.tar.$COMPRESS_EXT $UPLOAD_DIR + +popd +if [ -e Cargo.toml.back ]; then + mv Cargo.toml.back Cargo.toml +fi