Skip to content

Commit cc89f61

Browse files
committed
Auto merge of rust-lang#120593 - maurer:android-bump, r=Mark-Simulacrum,workingjubilee
Update Android in CI We are currently using a 10+ year old Android image, and it has caused trouble when working on rust-lang#120326. Our current NDK (25) only supports API 19+, so we were already out of spec. This PR: 1. Bumps the API used by the emulator in CI to 21, as per [NDK-26's release notes](https://github.com/android/ndk/wiki/Changelog-r26) deprecating 19 and 20 as targets. 2. Activates aarch64 testing on the emulator, since the base image is now a 64-bit image. 3. Bumps the NDK to 26b
2 parents 0824b30 + a9724f3 commit cc89f61

File tree

9 files changed

+21
-18
lines changed

9 files changed

+21
-18
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ jobs:
204204
- self-hosted
205205
- ARM64
206206
- linux
207-
- name: arm-android
207+
- name: aarch64-android
208208
os: ubuntu-20.04-8core-32gb
209209
env: {}
210210
- name: armhf-gnu

config.example.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@
392392
#metrics = false
393393

394394
# Specify the location of the Android NDK. Used when targeting Android.
395-
#android-ndk = "/path/to/android-ndk-r25b"
395+
#android-ndk = "/path/to/android-ndk-r26b"
396396

397397
# =============================================================================
398398
# General install configuration options

src/bootstrap/src/utils/cc_detect.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -239,18 +239,16 @@ pub(crate) fn ndk_compiler(compiler: Language, triple: &str, ndk: &Path) -> Path
239239
triple.to_string()
240240
};
241241

242-
// API 19 is the earliest API level supported by NDK r25b but AArch64 and x86_64 support
243-
// begins at API level 21.
244-
let api_level =
245-
if triple.contains("aarch64") || triple.contains("x86_64") { "21" } else { "19" };
242+
// The earliest API supported by NDK r26b is 21.
243+
let api_level = "21";
246244
let compiler = format!("{}{}-{}", triple_translated, api_level, compiler.clang());
247245
let host_tag = if cfg!(target_os = "macos") {
248246
// The NDK uses universal binaries, so this is correct even on ARM.
249247
"darwin-x86_64"
250248
} else if cfg!(target_os = "windows") {
251249
"windows-x86_64"
252250
} else {
253-
// NDK r25b only has official releases for macOS, Windows and Linux.
251+
// NDK r26b only has official releases for macOS, Windows and Linux.
254252
// Try the Linux directory everywhere else, on the assumption that the OS has an
255253
// emulation layer that can cope (e.g. BSDs).
256254
"linux-x86_64"

src/bootstrap/src/utils/change_tracker.rs

+5
Original file line numberDiff line numberDiff line change
@@ -170,4 +170,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[
170170
severity: ChangeSeverity::Warning,
171171
summary: "`rust.split-debuginfo` has been moved to `target.<triple>.split-debuginfo` and its default value is determined for each target individually.",
172172
},
173+
ChangeInfo {
174+
change_id: 120593,
175+
severity: ChangeSeverity::Info,
176+
summary: "Removed android-ndk r25b support in favor of android-ndk r26b.",
177+
},
173178
];

src/ci/docker/host-x86_64/arm-android/Dockerfile renamed to src/ci/docker/host-x86_64/aarch64-android/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ RUN sh /scripts/android-base-apt-get.sh
66

77
COPY scripts/android-ndk.sh /scripts/
88
RUN . /scripts/android-ndk.sh && \
9-
download_ndk android-ndk-r25b-linux.zip
9+
download_ndk android-ndk-r26b-linux.zip
1010

1111
RUN dpkg --add-architecture i386 && \
1212
apt-get update && \
@@ -21,14 +21,14 @@ RUN dpkg --add-architecture i386 && \
2121

2222
COPY scripts/android-sdk.sh /scripts/
2323
COPY scripts/android-sdk-manager.py /scripts/
24-
COPY host-x86_64/arm-android/android-sdk.lock /android/sdk/android-sdk.lock
24+
COPY host-x86_64/aarch64-android/android-sdk.lock /android/sdk/android-sdk.lock
2525
RUN /scripts/android-sdk.sh
2626

2727
ENV PATH=$PATH:/android/sdk/emulator
2828
ENV PATH=$PATH:/android/sdk/tools
2929
ENV PATH=$PATH:/android/sdk/platform-tools
3030

31-
ENV TARGETS=arm-linux-androideabi
31+
ENV TARGETS=arm-linux-androideabi,aarch64-linux-android
3232

3333
ENV RUST_CONFIGURE_ARGS --android-ndk=/android/ndk/
3434

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
emulator emulator-linux_x64-11237101.zip 0fd36dd5a7be6ee8770776a95c2933541d9243f3
2+
patcher;v4 3534162-studio.sdk-patcher.zip 046699c5e2716ae11d77e0bad814f7f33fab261e
3+
platform-tools platform-tools_r34.0.5-linux.zip 96097475cf7b279fdd8f218f5d043ffe94104ec3
4+
platforms;android-21 android-21_r02.zip 53536556059bb29ae82f414fd2e14bc335a4eb4c
5+
system-images;android-21;default;arm64-v8a sys-img/android/arm64-v8a-21_r04.zip c4375f1b4b4cd21a8617660e25f621cedcbd8332
6+
tools sdk-tools-linux-4333796.zip 8c7c28554a32318461802c1291d76fccfafde054

src/ci/docker/host-x86_64/arm-android/android-sdk.lock

-6
This file was deleted.

src/ci/docker/host-x86_64/dist-android/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ RUN sh /scripts/android-base-apt-get.sh
66
# ndk
77
COPY scripts/android-ndk.sh /scripts/
88
RUN . /scripts/android-ndk.sh && \
9-
download_ndk android-ndk-r25b-linux.zip
9+
download_ndk android-ndk-r26b-linux.zip
1010

1111
# env
1212
ENV TARGETS=arm-linux-androideabi

src/ci/github-actions/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ jobs:
381381
- name: aarch64-gnu
382382
<<: *job-aarch64-linux
383383

384-
- name: arm-android
384+
- name: aarch64-android
385385
<<: *job-linux-8c
386386

387387
- name: armhf-gnu

0 commit comments

Comments
 (0)