Commit ba20433b authored by Mike Hommey's avatar Mike Hommey
Browse files

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
parent f8d51bf5
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ Compiling and running:
        cd wrench
        export ANDROID_SDK_ROOT=$HOME/.mozbuild/android-sdk-linux # exact path may vary
        export ANDROID_NDK_ROOT=$HOME/.mozbuild/android-ndk-r21d  # exact path may vary
        cargo apk build
        cargo apk build --lib

    Install the APK:
        adb install -r ../target/debug/apk/wrench.apk
@@ -57,7 +57,7 @@ Release mode:
        cd wrench
        export ANDROID_SDK_ROOT=$HOME/.mozbuild/android-sdk-linux # exact path may vary
        export ANDROID_NDK_ROOT=$HOME/.mozbuild/android-ndk-r21d  # exact path may vary
        cargo apk build --release
        cargo apk build --lib --release

    Now the APK at ../target/release/apk/wrench.apk
    should be signed and installable (you may need to uninstall the debug APK first if you
+2 −2
Original line number Diff line number Diff line
@@ -16,9 +16,9 @@ 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
    ../cargo-apk/bin/cargo-apk apk build --frozen --verbose --lib
elif [ "$MODE" == "release" ]; then
    ../cargo-apk/bin/cargo-apk apk build --frozen --verbose --release
    ../cargo-apk/bin/cargo-apk apk build --frozen --verbose --lib --release
else
    echo "Unknown mode '${MODE}'; must be 'debug' or 'release'"
    exit 1