Repository navigation
Build for armv7 Android in CI and fix the resulting build errors - #387
Merged
Merged
Conversation
Add android_sdk_triples to the pull request workflow so the Swift SDK for Android build covers aarch64, armv7 and x86_64. x86_64 stays last because the reusable workflow uses the final triple for emulator testing, and it must match the host architecture. Building for armv7 failed because on 32-bit Android `st_mode` is a UInt32 while `mode_t` is a UInt16, so masking `st_mode` with `mode_t(S_IFMT)` does not type-check. Convert the S_IF* constants to `st_mode`'s own type with numericCast instead of assuming it is `mode_t`. The constants fit in every platform's `st_mode` type, so the conversion is lossless.
iCharlesHu
approved these changes
Oct 15, 2026
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.
Adds
android_sdk_triplesto the pull request workflow so the Swift SDK for Android build covers all three architectures: aarch64, armv7, and x86_64. x86_64 stays last because the reusable workflow uses the final triple for emulator testing, and it must match the host architecture.Building for armv7 then failed because on 32-bit Android
st_modeis aUInt32whilemode_tis aUInt16, sostatus.st_mode & mode_t(S_IFMT)does not type-check. This affectedexecutableAccessibleand the working-directory validation in the spawn path. Both now convert theS_IF*constants tost_mode's own type withnumericCastinstead of assuming it ismode_t. The constants fit in every platform'sst_modetype, so the conversion is lossless.Testing
Built locally with the Swift 6.4.0 release toolchain:
aarch64,armv7, andx86_64(API 28, with--build-tests), plus armv7 in releaseaarch64-swift-linux-muslandx86_64-swift-linux-musl--build-tests