Skip to content

Add Tuist-based single XCFramework build#856

Open
Kyle-Ye wants to merge 13 commits intomainfrom
codex/tuist-single-xcframework
Open

Add Tuist-based single XCFramework build#856
Kyle-Ye wants to merge 13 commits intomainfrom
codex/tuist-single-xcframework

Conversation

@Kyle-Ye
Copy link
Copy Markdown
Collaborator

@Kyle-Ye Kyle-Ye commented May 5, 2026

A replacement of #807

Summary

  • add Tuist support for generating the OpenSwiftUI Xcode workspace/project
  • update the XCFramework build path to archive from the generated workspace and emit one OpenSwiftUI.xcframework
  • update CI/release artifact plumbing for the single XCFramework
  • trim release artifacts by omitting dSYMs and Swift ABI JSON unless --debug is passed
  • force Objective-C categories from static COpenSwiftUI into the final dynamic OpenSwiftUI framework

Verification

  • mise install
  • swift package dump-package
  • tuist generate --no-open
  • bash -n Scripts/build_xcframework.sh
  • git diff --check
  • full default XCFramework build at /tmp/openswiftui-xcframework-objc-full/OpenSwiftUI.xcframework
  • confirmed final artifact has macOS + iOS simulator slices, no dSYMs, no *.abi.json, and is ~46M
  • confirmed NSMenu(OpenSwiftUI_SPI) category methods are present in the final OpenSwiftUI Mach-O
  • copied artifact into local DemoKit package and verified swift run DemoKit starts without the NSMenu unrecognized selector crash
  • xcodebuild -scheme DemoKit -destination "platform=macOS" -derivedDataPath /tmp/DemoKit-objc-full-dd build

Notes

The current single-binary package consumption still needs module search path flags for nested Swift modules copied into OpenSwiftUI.framework/Modules. The paired OpenSwiftUI-spm PR updates the binary package template to publish only the OpenSwiftUI binary target.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 27.19%. Comparing base (51da570) to head (e896965).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #856      +/-   ##
==========================================
- Coverage   27.19%   27.19%   -0.01%     
==========================================
  Files         673      673              
  Lines       44165    44165              
==========================================
- Hits        12012    12011       -1     
- Misses      32153    32154       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Kyle-Ye
Copy link
Copy Markdown
Collaborator Author

Kyle-Ye commented May 5, 2026

Hit a upstream issue tuist/tuist#10616

@Kyle-Ye Kyle-Ye marked this pull request as ready for review May 5, 2026 13:20
@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented May 5, 2026

🤖 Augment PR Summary

Summary: This PR switches XCFramework packaging to emit a single OpenSwiftUI.xcframework built from a Tuist-generated Xcode workspace, replacing the prior multi-XCFramework pipeline.

Changes:

  • Add Tuist + mise tooling (Tuist.swift, mise.toml) and CI setup to install/generate the workspace.
  • Update the XCFramework build script to run tuist generate, archive via xcodebuild from the generated workspace, and create one XCFramework output.
  • Stop producing separate stub XCFrameworks for dependency modules; instead copy their Swift module/interface artifacts into the distributable framework’s Modules directory.
  • Trim release artifacts by default (omit dSYMs and Swift ABI JSON unless --debug is used).
  • Adjust release/CI workflows and composite action outputs to zip/upload/checksum only OpenSwiftUI.xcframework.
  • Add linker flag to force Objective-C categories from static COpenSwiftUI into the final dynamic framework.

Technical Notes: Package manifest gains #if TUIST branches and Tuist PackageSettings to control product types during Tuist evaluation.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread Scripts/build_xcframework.sh Outdated
local swiftmodule
swiftmodule="$(find_swiftmodule "$build_products_path" "$archive_path" "$module_name")"
if [ -z "$swiftmodule" ]; then
echo "Warning: No swiftmodule found for $module_name."
Copy link
Copy Markdown

@augmentcode augmentcode Bot May 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy_swiftmodule only warns when a module’s .swiftmodule can’t be found, but DEP_MODULES are described as being referenced by public .swiftinterfaces; proceeding could silently produce a broken XCFramework that fails for consumers. Consider making missing swiftmodules a hard failure (at least for DEP_MODULES) so CI/release artifacts can’t be published incomplete.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

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.

1 participant