Fix Android CI (armv7 cross-compile + emulator stability)#10
Merged
Conversation
The Swift Android SDK names its armv7 target triples armv7-unknown-linux-android<api> (not androideabi), so build against armv7-unknown-linux-android28 directly. Also free disk space before the emulator job, which was getting OOM-killed (adb exit 137) right after boot.
A bare swift:6.3.3 container can't cross-compile for Android: the SDK bundle's ndk-sysroot (semaphore.h, libc, etc.) comes from the Android NDK, which the container lacks. Run the armv7 build through skiptools/swift-android-action, which installs the NDK and wires ANDROID_NDK_HOME, retargeting the compile to armv7 via swift-build-flags. Tests are disabled so no emulator is launched.
The GitHub-hosted x86_64 emulator was dying with SIGKILL (exit 137) right after reporting boot, failing the unit-test job non-deterministically. Force a cold boot with software rendering and a longer boot timeout so the emulator starts deterministically instead of restoring a crash-prone snapshot.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #8, which was merged before the Android jobs were fully green.
These three commits fix the two Android CI jobs. Net change is limited to
.github/workflows/swift-android.yml.Changes
ndk-sysroot(its libc/headers come from the Android NDK). A bareswift:6.3.3container therefore can't cross-compile ('semaphore.h' file not found). The armv7 build now runs throughskiptools/swift-android-action,which provisions the NDK and wires
ANDROID_NDK_HOME, retargeting the compileto
armv7-unknown-linux-android28viaswift-build-flags. Tests are disabledfor this job so no emulator is launched.
with exit 137 (SIGKILL) right after boot, failing the unit-test job
non-deterministically. Force a cold boot (
-no-snapshot) with softwarerendering (
-gpu swiftshader_indirect) and a longer boot timeout, plusfree-disk-space: truefor headroom.Verification
Android (armv7 cross-compile)— passing.Android (unit tests)— the emulator-hardening change is validated by thisPR's own CI run.