gecko-dev/taskcluster/scripts/misc/wrench-macos-build.sh
Kartikaya Gupta 10e1acc2e9 Bug 1516568 - Add jobs to cross-compile wrench and use the resulting binaries. r=glandium
One job (which runs on a Linux docker worker) cross compiles wrench in
two configurations (regular and headless) and publishes artifacts with
the binaries. The other job (which runs on macOS) downloads the
artifacts and uses them to run the WebRender macOS CI release-mode
scripts, which basically consists of running the WebRender reftest
suite.

Differential Revision: https://phabricator.services.mozilla.com/D19369

--HG--
extra : source : 028c0ed368b844a4e54f3c38177b0fe65211d484
2019-02-15 01:32:16 +00:00

46 lines
1.6 KiB
Bash
Executable file

#!/bin/bash
set -x -e -v
source ${GECKO_PATH}/taskcluster/scripts/misc/wr-macos-cross-build-setup.sh
# The osmesa-src build which we do as part of the headless build below
# doesn't seem to always use CFLAGS/CXXFLAGS where expected. Instead we
# just squash those flags into CC/CXX and everything works out.
export CC="${CC} ${CFLAGS}"
export CFLAGS=
export CXX="${CXX} ${CXXFLAGS}"
export CXXFLAGS=
export UPLOAD_DIR="${HOME}/artifacts"
mkdir -p "${UPLOAD_DIR}"
# Do a cross-build without the `headless` feature
pushd "${GECKO_PATH}/gfx/wr/wrench"
cargo build --release -vv --frozen --target=${TARGET_TRIPLE}
# Package up the resulting wrench binary
cd "../target/${TARGET_TRIPLE}"
mkdir -p wrench-macos/bin
mv release/wrench wrench-macos/bin/
tar cjf wrench-macos.tar.bz2 wrench-macos
mv wrench-macos.tar.bz2 "${UPLOAD_DIR}"
# Clean the build
cd "${GECKO_PATH}/gfx/wr"
rm -rf target
popd
# Do a cross-build with the `headless` feature
pushd "${GECKO_PATH}/gfx/wr/wrench"
cargo build --release -vv --frozen --target=${TARGET_TRIPLE} --features headless
# Package up the wrench binary and some libraries that we will need
cd "../target/${TARGET_TRIPLE}"
mkdir wrench-macos-headless
mv release wrench-macos-headless/
tar cjf wrench-macos-headless.tar.bz2 \
wrench-macos-headless/release/wrench \
wrench-macos-headless/release/build/osmesa-src*/out/src/gallium/targets/osmesa/.libs \
wrench-macos-headless/release/build/osmesa-src*/out/src/mapi/shared-glapi/.libs
mv wrench-macos-headless.tar.bz2 "${UPLOAD_DIR}"
# Clean the build
cd "${GECKO_PATH}/gfx/wr"
rm -rf target
popd