Support Archiving for Mac Catalyst #116
Merged
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.
Motivation
I've got a multiplatform project that uses Catalyst for macOS and I discovered (through testing the
sharing-grdb-icloudalpha) that I could not archive my Mac Catalyst app to generate test builds for macOS.Unfortunately, there seems to be a bug (Xcode or SPM?) where a package
targetand a packagemacrocannot share code from anothertarget, else you get compilation errors when attempting to build in release for Mac Catalyst. Here is a graphic I've put together in preparation for posting in the Swift forums and/or filing a feedback:What's in this PR?
After trying several things, the only thing that I could come up with is to borrow a page out of the swift-docc-plugin playbook where they use symbolic links as a workaround for a limitation where plugins cannot share code.
It's quite odd that this limitation seems to only apply to Mac Catalyst destinations (at least with Xcode 16.4). However, I did attempt to archive with Xcode 26 beta 3 (on macOS Sequoia 15.5) and, iirc,
I was seeing the build errors even for iOS destinations.Update: I had not downloaded fresh iOS sims so there is no way I tested iOS. The bug is still an issue with Swift 6.2 and Xcode 26 for Mac Catalyst.
How to test?
mainbranch (so not including this PR) set Xcode's destination toMy Mac (Mac Catalyst)and try to archive theStructuredQueriesscheme:Alternatives considered
StructuredQueriesSupporttarget altogether.Next Steps
sharing-grdb-icloudsharing-grdb-icloudthat prevents archiving for Mac Catalyst. I can follow up with a separate PR over there once it contains the fix from this PR.