Skip to content

Commit

Permalink
Update Android testing to API 21, matching NDK 26
Browse files Browse the repository at this point in the history
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 (rust-lang#120326).

We'll be updating to NDK 26 (latest LTS) shortly, so rather than
updating to API 19, then again to API 21 in a bit, just jump straight
to 21.

Fixes: rust-lang#120567
  • Loading branch information
maurer committed Mar 24, 2024
1 parent 6a92312 commit 93acd1b
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ jobs:
- self-hosted
- ARM64
- linux
- name: arm-android
- name: aarch64-android
os: ubuntu-20.04-8core-32gb
env: {}
- name: armhf-gnu
Expand Down
6 changes: 2 additions & 4 deletions src/bootstrap/src/utils/cc_detect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,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 r26b 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ RUN dpkg --add-architecture i386 && \

COPY scripts/android-sdk.sh /scripts/
COPY scripts/android-sdk-manager.py /scripts/
COPY host-x86_64/arm-android/android-sdk.lock /android/sdk/android-sdk.lock
COPY host-x86_64/aarch64-android/android-sdk.lock /android/sdk/android-sdk.lock
RUN /scripts/android-sdk.sh

ENV PATH=$PATH:/android/sdk/emulator
Expand Down
6 changes: 6 additions & 0 deletions src/ci/docker/host-x86_64/aarch64-android/android-sdk.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
emulator emulator-linux_x64-11237101.zip 0fd36dd5a7be6ee8770776a95c2933541d9243f3
patcher;v4 3534162-studio.sdk-patcher.zip 046699c5e2716ae11d77e0bad814f7f33fab261e
platform-tools platform-tools_r34.0.5-linux.zip 96097475cf7b279fdd8f218f5d043ffe94104ec3
platforms;android-21 android-21_r02.zip 53536556059bb29ae82f414fd2e14bc335a4eb4c
system-images;android-21;default;arm64-v8a sys-img/android/arm64-v8a-21_r04.zip c4375f1b4b4cd21a8617660e25f621cedcbd8332
tools sdk-tools-linux-4333796.zip 8c7c28554a32318461802c1291d76fccfafde054
6 changes: 0 additions & 6 deletions src/ci/docker/host-x86_64/arm-android/android-sdk.lock

This file was deleted.

2 changes: 1 addition & 1 deletion src/ci/github-actions/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ jobs:
- name: aarch64-gnu
<<: *job-aarch64-linux

- name: arm-android
- name: aarch64-android
<<: *job-linux-8c

- name: armhf-gnu
Expand Down

0 comments on commit 93acd1b

Please sign in to comment.