build(plugins): ship TableProPluginKit as an XCFramework so a driver can live in its own repo - #2213
Merged
Merged
Conversation
…can live in its own repo
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The other half of #2212.
#2212 lets a plugin signed by someone else load. This lets someone else build one. Both are needed: a third-party driver that loads but can only be compiled from a checkout of this repository is not really third party.
Why every driver lives under
Plugins/todayNot because the plugin system requires it. A plugin has to link TableProPluginKit, and the only way to obtain that framework was to check out this repository and build the app project. So a driver had to live here, be declared in
project.yml, get a hand-written arm inbuild-plugin.yml, and be tagged by a maintainer. That is a packaging limit that grew into an architecture.scripts/build-pluginkit-xcframework.shproduces a distributableTableProPluginKit.xcframework. A driver author links that from their own Xcode project and needs nothing else from here.Verified by running it: one
macos-arm64_x86_64slice,lipo -archsreportsx86_64 arm64, and.swiftinterfacepresent for both architectures. 1.8 MB zipped.Two things the script asserts
Both failure modes produce a framework that links today and breaks every consumer on the next release, which is exactly the class of bug CLAUDE.md's ABI section is about.
.swiftinterfacemeansBUILD_LIBRARY_FOR_DISTRIBUTIONdid not take. Without Library Evolution the ABI is not resilient, so a plugin built against it stops loading the moment PluginKit changes. The script fails rather than shipping that.lipo -archsmust list both architectures. A silently arm64-only framework works on the machine that built it and fails on every Intel Mac.One design correction worth recording
The first version built arm64 and x86_64 separately and passed both to
-create-xcframework. That is wrong and the tool says so:An XCFramework separates slices by platform, never by architecture. Several architectures for one platform belong in one universal binary, so it is a single build with
ARCHS="arm64 x86_64" ONLY_ACTIVE_ARCH=NO.DERIVED_DATAalso sits outside the directory the script wipes. Inside it, every run re-resolved every SwiftPM dependency from scratch, which is minutes per build.Not included
No CI job and no published release yet. Publishing is a one-liner the script prints, and it should happen deliberately alongside a PluginKit version rather than on every merge. The zip is not reproducible (ditto records timestamps), so the checksum to pin is the one from the artifact actually published, which is noted in the script.
Docs: a new "Building outside this repository" section in plugin-development.mdx, including that the XCFramework must be linked as Do Not Embed, since the app supplies PluginKit at runtime and a second copy inside the plugin bundle would conflict.