fune/taskcluster/scripts/misc/wrench-android-build.sh
Mike Hommey ba20433bd5 Bug 1823842 - Explicitly only build the wrench library on android. r=gfx-reviewers,jnicol
When upgrading the NDK to r23, the wrench builds for android fail
because cargo apk starts adding flags to the cargo rustc call it does,
and that's not compatible with the wrench crate having both a lib and a
bin target.

As cargo apk only packages the lib in the apk, we can just be explicit
and build the library only.

Differential Revision: https://phabricator.services.mozilla.com/D173244
2023-03-22 09:02:37 +00:00

26 lines
840 B
Bash
Executable file

#!/bin/bash
set -x -e -v
MODE=${1?"First argument must be debug|release"}
pushd "${MOZ_FETCHES_DIR}"
mv wrench-deps/{vendor,.cargo,cargo-apk} ${GECKO_PATH}/gfx/wr
popd
pushd "${GECKO_PATH}/gfx/wr/wrench"
# These things come from the toolchain dependencies of the job that invokes
# this script (webrender-wrench-android-build).
export PATH="${PATH}:${MOZ_FETCHES_DIR}/rustc/bin"
export PATH="${PATH}:${JAVA_HOME}/bin"
export ANDROID_SDK_ROOT="${MOZ_FETCHES_DIR}/android-sdk-linux"
export ANDROID_NDK_ROOT="${MOZ_FETCHES_DIR}/android-ndk"
if [ "$MODE" == "debug" ]; then
../cargo-apk/bin/cargo-apk apk build --frozen --verbose --lib
elif [ "$MODE" == "release" ]; then
../cargo-apk/bin/cargo-apk apk build --frozen --verbose --lib --release
else
echo "Unknown mode '${MODE}'; must be 'debug' or 'release'"
exit 1
fi
popd