Skip to content

Port to Android#250

Merged
weichsel merged 1 commit into
weichsel:developmentfrom
finagolfin:development
Jul 10, 2022
Merged

Port to Android#250
weichsel merged 1 commit into
weichsel:developmentfrom
finagolfin:development

Conversation

@finagolfin

@finagolfin finagolfin commented Jun 30, 2022

Copy link
Copy Markdown
Contributor

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

weichsel commented Jul 1, 2022

Copy link
Copy Markdown
Owner

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
Copy Markdown
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
Copy Markdown
Contributor Author

Anything holding this up?

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

Copy link
Copy Markdown
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