Skip to content

Conversation

@finagolfin
Copy link
Contributor

@finagolfin finagolfin commented Jun 30, 2022

Changes proposed in this PR

  • Add a FILEPointer type alias, as FILE is an opaque struct since Android 7.
  • Add Android to existing OS specializations where needed.
  • Convert to mode_t in FIleManager+ZIP for Android armv7, where mode_t is narrower than st_mode.

Tests performed

I ran swift test on both linux x86_64 and Android AArch64 with this pull and all tests passed.

Further info for the reviewer

I used this pull when porting CookCLI as a package for Android, termux/termux-packages#11081. I used a similar typealias when porting swiftlang/swift-tools-support-core#243 for Android last year.

Open Issues

None

@weichsel
Copy link
Owner

weichsel commented Jul 1, 2022

Nice - thanks for the PR.
How do you execute the test suite on Android?

If we add Android as supported platform, I'd like to add a GitHub workflow for that.

@finagolfin
Copy link
Contributor Author

How do you execute the test suite on Android?

I ran it in the Termux app on an Android AArch64 tablet, using the packaged Swift 5.6.2 compiler in the app.

If we add Android as supported platform, I'd like to add a GitHub workflow for that.

You could do that with the Android x86_64 SDK that I provide, which I use to run a daily CI that cross-compiles several Swift packages and runs their tests on the Android x86_64 emulator. While I have my CI download the various Swift compilers and build the SDK from source, you could simply use the Swift release compiler and NDK installed in the github Actions environment and download my SDK instead, as laid out in my doc.

I don't think that's necessary, but it is doable.

@finagolfin
Copy link
Contributor Author

Anything holding this up?

@weichsel weichsel merged commit 3a67680 into weichsel:development Jul 10, 2022
@weichsel
Copy link
Owner

Merged - Thanks for contributing Android support!

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