-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add macCatalyst to the PlatformChecks #524
Conversation
When compiling an iOS app, you run the generator on your macOS developer environment (usually by using the Swift package plugin), but you only link the runtime library to your app. The platform checks here are to stop you linking the generator itself in applications by mistake. Are you trying to compile for MacCatalyst or on MacCatalyst? |
@simonjbeaumont Good question! I wrote about this in the issue a bit more
So importantly, no, I did not link to the generator. With the changes |
Here's an Xcode project reproducing the issue. The same configuration compiles on iOS while failing to compile on Catalyst. |
Thanks for the response and for the reproducer. I can see locally with a dummy package that, when compiling the application code:
This is all expected in the code for the application. What's unexpected is the compiler conditions that are used to build the package plugin:
I think this is a bug in the build system. For now, we can workaround it with this patch—although I've suggested an edit to document it clearer. Would you mind filing an issue using Feedback Assistant and let us know the issue number? |
@simonjbeaumont Here's the feedback identifier: FB13589581 |
@swift-server-bot test this please |
Nightly failure is a compiler crash:
Merging over this. |
Thanks @lennartkerkvliet! |
Motivation
When attempting to compile the Swift OpenAPI Generator on MacCatalyst, code that compiles on iOS will not compile as it will fail on the
PlatformChecks
.Modifications
Added an extra condition in
PlatformChecks
to allow running on MacCatalyst.Result
fixes #523
Test Plan
I've tried to familiarize myself with the project, but could not come up with a good way to add a test for running the tool on MacCatalyst. In my manual testing giving the instructions in the issue, it now works as expected.