Update Android testing to API 21, matching NDK 26

We were running testing on API 18, which was already out of support for
NDK 25, and some of the ancient behavior in that image was causing
trouble when developing `rustc` features (#120326).

Update to the current LTS NDK 26, and to its minimum supported API 21.

Fixes: #120567
This commit is contained in:
Matthew Maurer 2024-02-02 23:13:05 +00:00
parent eb10639928
commit 8bf9aeaa80
7 changed files with 15 additions and 12 deletions

View file

@ -247,10 +247,8 @@ pub(crate) fn ndk_compiler(compiler: Language, triple: &str, ndk: &Path) -> Path
triple.to_string()
};
// API 19 is the earliest API level supported by NDK r25b but AArch64 and x86_64 support
// begins at API level 21.
let api_level =
if triple.contains("aarch64") || triple.contains("x86_64") { "21" } else { "19" };
// The earliest API supported by NDK r26d is 21.
let api_level = "21";
let compiler = format!("{}{}-{}", triple_translated, api_level, compiler.clang());
let host_tag = if cfg!(target_os = "macos") {
// The NDK uses universal binaries, so this is correct even on ARM.
@ -258,7 +256,7 @@ pub(crate) fn ndk_compiler(compiler: Language, triple: &str, ndk: &Path) -> Path
} else if cfg!(target_os = "windows") {
"windows-x86_64"
} else {
// NDK r25b only has official releases for macOS, Windows and Linux.
// NDK r26d only has official releases for macOS, Windows and Linux.
// Try the Linux directory everywhere else, on the assumption that the OS has an
// emulation layer that can cope (e.g. BSDs).
"linux-x86_64"

View file

@ -210,4 +210,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[
severity: ChangeSeverity::Info,
summary: "the `wasm-component-ld` tool is now built as part of `build.extended` and can be a member of `build.tools`",
},
ChangeInfo {
change_id: 120593,
severity: ChangeSeverity::Info,
summary: "Removed android-ndk r25b support in favor of android-ndk r26d.",
},
];