Skip to content

Fix Android CI (armv7 cross-compile + emulator stability)#10

Merged
colemancda merged 3 commits into
masterfrom
feature/code-coverage
Jul 18, 2026
Merged

Fix Android CI (armv7 cross-compile + emulator stability)#10
colemancda merged 3 commits into
masterfrom
feature/code-coverage

Conversation

@colemancda

Copy link
Copy Markdown
Member

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

  • armv7 cross-compile — the swift.org Android SDK bundle ships no
    ndk-sysroot (its libc/headers come from the Android NDK). A bare
    swift:6.3.3 container therefore can't cross-compile ('semaphore.h' file not found). The armv7 build now runs through skiptools/swift-android-action,
    which provisions the NDK and wires ANDROID_NDK_HOME, retargeting the compile
    to armv7-unknown-linux-android28 via swift-build-flags. Tests are disabled
    for this job so no emulator is launched.
  • Emulator stability — the hosted x86_64 emulator was intermittently dying
    with exit 137 (SIGKILL) right after boot, failing the unit-test job
    non-deterministically. Force a cold boot (-no-snapshot) with software
    rendering (-gpu swiftshader_indirect) and a longer boot timeout, plus
    free-disk-space: true for headroom.

Verification

  • Android (armv7 cross-compile) — passing.
  • Android (unit tests) — the emulator-hardening change is validated by this
    PR's own CI run.

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.
@colemancda
colemancda merged commit 731174c into master Jul 18, 2026
11 checks passed
@colemancda
colemancda deleted the feature/code-coverage branch July 18, 2026 05:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant