Skip to content

Conversation

@marcprux
Copy link
Contributor

@marcprux marcprux commented Jun 6, 2025

This PR adds support for building and testing on Android. It mostly just adds #if os(Android) checks and some Android-specific fixes for things like errno and O_SYNC, which are implemented differently in Bionic than Linux/Musl.

Android does require swift-system 1.5+, so I made the dependency upToNextMajor from "1.3.0" rather than upToNextMinor. If that presents an issue, we could probably finagle some mechanism for having different swift-system version requirements based on the platform.

Test cases are run with swift-android-action, which installs the Android SDK and runs the test cases on an Android emulator. Some of the tests that expect hard-coded file paths had to be disabled because the Android emulator doesn't have access to the local filesystem. This could potentially be resolved by copying the necessary files, but would require re-working all the #filePath references to use either relative paths, or accept some sort of override file root (perhaps based on an environment variable), and seemed like it would be a more intrusive change than would be warranted.

@marcprux marcprux changed the title Android support and bump swift-system to 1.5.0 Android support Jun 6, 2025
@kateinoigakukun
Copy link
Member

Would you mind rebasing on the top of the latest main branch?

@marcprux
Copy link
Contributor Author

marcprux commented Jun 6, 2025

Would you mind rebasing on the top of the latest main branch?

Done!

Copy link
Member

@kateinoigakukun kateinoigakukun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@kateinoigakukun kateinoigakukun merged commit 16683fd into swiftwasm:main Jun 7, 2025
15 checks passed
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.

2 participants