taskcluster/docker/rust-build/build_rust_mac.sh
author CuriousLearner <sanyam.khurana01@gmail.com>
Thu, 20 Oct 2016 18:25:34 +0530
changeset 326973 f374e4333d3a17f72d89063670115d71a9643a5f
parent 326508 testing/docker/rust-build/build_rust_mac.sh@0f3603e365f029bc9ea5f926d32f6f0f8aa4d998
child 341997 e0c38f8b6ebcc23320ede1928c09eda7526b71da
permissions -rw-r--r--
Bug 1302763 - Move docker images out of testing/docker into taskcluster/docker; r=dustin r=CuriousLearner MozReview-Commit-ID: 7v1uCDB5qoN

#!/bin/bash -vex

set -e

: WORKSPACE ${WORKSPACE:=$PWD}
: TOOLTOOL ${TOOLTOOL:=python $WORKSPACE/tooltool.py}

CORES=$(nproc || grep -c ^processor /proc/cpuinfo || sysctl -n hw.ncpu)
echo Building on $CORES cpus...

OPTIONS="--enable-debuginfo --disable-docs"
TARGETS="x86_64-apple-darwin,i686-apple-darwin"

PREFIX=${WORKSPACE}/rustc

set -v

mkdir -p ${WORKSPACE}/gecko-rust-mac
pushd ${WORKSPACE}/gecko-rust-mac

export MACOSX_DEPLOYMENT_TARGET=10.7
${WORKSPACE}/rust/configure --prefix=${PREFIX} --target=${TARGETS} ${OPTIONS}
make -j ${CORES}

rm -rf ${PREFIX}
mkdir ${PREFIX}
make dist
make install
popd

# Package the toolchain for upload.
pushd ${WORKSPACE}
rustc/bin/rustc --version
tar cvjf rustc.tar.bz2 rustc/*
${TOOLTOOL} add --visibility=public --unpack rustc.tar.bz2
popd