diff --git a/mk/cargo.sh b/mk/cargo.sh index 48ac92d711..7ddb5dd628 100755 --- a/mk/cargo.sh +++ b/mk/cargo.sh @@ -26,7 +26,8 @@ qemu_mipsel="qemu-mipsel -L /usr/mipsel-linux-gnu" # directory like `clang` that would conflict with the same-named tools that may # be needed to compile the build script, or to compile for other targets. if [ -n "${ANDROID_HOME-}" ]; then - ndk_version=25.1.8937393 + # Keep the next line in sync with the corresponding line in install-build-tools.sh. + ndk_version=25.2.9519653 ANDROID_NDK_ROOT=${ANDROID_NDK_ROOT:-${ANDROID_HOME}/ndk/$ndk_version} fi if [ -n "${ANDROID_NDK_ROOT-}" ]; then diff --git a/mk/install-build-tools.sh b/mk/install-build-tools.sh index 6bb73c2643..77b01cdcb8 100755 --- a/mk/install-build-tools.sh +++ b/mk/install-build-tools.sh @@ -27,8 +27,22 @@ function install_packages { use_clang= case $target in --target*android*) + # https://blog.rust-lang.org/2023/01/09/android-ndk-update-r25.html says + # "Going forward the Android platform will target the most recent LTS NDK, + # allowing Rust developers to access platform features sooner. These updates + # should occur yearly and will be announced in release notes." Assume that + # means that we should always prefer to be using the latest 25.x.y version of + # the NDK until the Rust project announces that we should use a higher major + # version number. + # + # TODO: This should probably be implemented as a map of Rust toolchain version + # to NDK version; e.g. our MSRV might (only) support an older NDK than the + # latest stable Rust toolchain. + # + # Keep the following line in sync with the corresponding line in cargo.sh. + ndk_version=25.2.9519653 + mkdir -p "${ANDROID_HOME}/licenses" - ndk_version=25.1.8937393 android_license_file="${ANDROID_HOME}/licenses/android-sdk-license" accept_android_license=24333f8a63b6825ea9c5514f83c2829b004d1fee grep --quiet --no-messages "$accept_android_license" "$android_license_file" \