Use xcodebuild for Swift XCFramework assembly - #666
Merged
Conversation
i386
marked this pull request as ready for review
May 24, 2026 08:38
Collaborator
Author
|
Addressed the review feedback in dd34aaa:\n\n- Documented that this PR depends on #665's inner framework layout fix: xcodebuild wraps input frameworks and does not repair a flat macOS bundle.\n- Added release-artifact verification that every macOS slice has the versioned Versions/A layout and canonical symlinks.\n- Strengthened the zipped SwiftPM consumer smoke to call generateOwnerKeypairHex() through the packaged UniFFI binary target, not just compile wrapper code.\n- Added a release workflow job that runs the Swift package artifact preparation path and uploads MeshLLMFFI.xcframework.zip before publication. |
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.
Summary
Follow-up to #665. The Swift SDK packaging scripts now let
xcodebuild -create-xcframeworkwrite the XCFramework structure instead of carrying a shell fallback that hand-writesInfo.plistand library metadata.This PR depends on #665's inner framework-bundle layout fix:
xcodebuild -create-xcframeworkwraps the input frameworks, but it does not validate or repair a flat macOS.framework. Flat-in would still be flat-out. The release verifier now checks that every macOS slice has the requiredVersions/Alayout and canonical symlinks before it runs a consumer smoke.The scripts still wrap the Rust static archive in framework bundles before calling
xcodebuild, because the SDK needsPrivacyInfo.xcprivacyto live in each framework slice. The docs now call out why the tempting-library -headerspath is not enough unless another App Store-visible SDK target carries the privacy manifest.This also hardens the release path:
MeshLLMFFI.xcframework.zipartifactPackage.swiftalready points at the exact release URL and checksum for the built artifactgenerateOwnerKeypairHex()through the packaged UniFFI binary targetMeshLLMFFI.xcframework.zipValidation
bash -n sdk/swift/scripts/build-xcframework.shbash -n sdk/swift/scripts/build-host-macos-xcframework.shbash -n scripts/verify-swift-privacy-manifest.shbash -n scripts/verify-swift-release-artifact.shbash -n scripts/verify-swift-package-manifest.shbash -n scripts/ci-swift-sdk-smoke.shbash -n scripts/prepare-swift-package-release.shplutil -lint sdk/swift/PrivacyInfo.xcprivacyscripts/check-sdk-contract.sh./sdk/swift/scripts/build-host-macos-xcframework.shscripts/verify-swift-privacy-manifest.sh sdk/swift/PrivacyInfo.xcprivacy sdk/swift/Generated/MeshLLMFFI.xcframeworkscripts/verify-swift-release-artifact.sh <tmp>/MeshLLMFFI.xcframework.zip; this verified the versioned macOS framework slice and ran a SwiftPM consumer that calls UniFFIscripts/verify-swift-package-manifest.sh v0.0.0-test <tmp>/MeshLLMFFI.xcframework.zip <tmp>/Package.swiftswift testcargo run -p xtask -- repo-consistency release-targetscargo run -p xtask -- repo-consistency ci-crate-listsNotes
The fully native long-term shape is an Xcode-built static framework target archived per platform and then assembled into an XCFramework. This PR is a narrower step: remove hand-built XCFramework metadata now while preserving the privacy manifest behavior from #665 and adding checks that catch SwiftPM release packaging regressions.
A release tag must already contain the prepared SwiftPM URL/checksum in
Package.swift; release CI now verifies that instead of mutating the manifest after the tag has been checked out.