Skip to content

Add Tuist setup for XCFramework generation#807

Draft
pepicrft wants to merge 1 commit intoOpenSwiftUIProject:mainfrom
tuist:feat/tuist-xcframework-setup
Draft

Add Tuist setup for XCFramework generation#807
pepicrft wants to merge 1 commit intoOpenSwiftUIProject:mainfrom
tuist:feat/tuist-xcframework-setup

Conversation

@pepicrft
Copy link

@pepicrft pepicrft commented Mar 4, 2026

Hey! I'm Pedro, co-founder of Tuist. I've been looking at OpenSwiftUI and thought it'd be useful to have a Tuist-based setup for producing XCFrameworks via xcodebuild, without relying solely on SPM.

This adds Tuist project manifests with a Project.swift covering all the existing targets (OpenSwiftUI, OpenSwiftUICore, OpenSwiftUI_SPI, COpenSwiftUI, OpenSwiftUIMacros, OpenSwiftUIExtension, OpenSwiftUIBridge, OpenSwiftUISymbolDualTestsSupport), a Tuist/Package.swift for external dependency resolution, and an availability-macros.xcconfig for the availability macro flags. I also added module maps for COpenSwiftUI and OpenSwiftUISymbolDualTestsSupport since Xcode needs them for module discovery, a package typealias in Path.swift to resolve an ORBPath ambiguity that arises from Xcode's transitive header search path propagation, and conditional compilation guards around BacklightServices-dependent code in the UIKit hosting views.

I've verified the build succeeds for macOS, iOS device, and iOS Simulator in both Debug and Release configurations, and successfully produced an XCFramework with xcodebuild -create-xcframework.

Add Tuist manifests (Project.swift, Tuist.swift, Tuist/Package.swift) to enable
building OpenSwiftUI as an XCFramework using xcodebuild. This includes module maps
for COpenSwiftUI and OpenSwiftUISymbolDualTestsSupport, a package typealias to
resolve ORBPath module ambiguity in Xcode, and conditional compilation guards for
BacklightServices-dependent code.
@pepicrft pepicrft requested a review from Kyle-Ye as a code owner March 4, 2026 14:39
@Kyle-Ye
Copy link
Collaborator

Kyle-Ye commented Mar 21, 2026

I try to tuist install and tuist generate before the xcodebuild. And I'll fail on the tuist generate step (error msg: CoreUI.xcframework is missing). Would you mind updating the README to state to how to use it before xcodebuild (I assume it is tuist install and tuist generate here)

tuist generate
Loading and constructing the graph
It might take a while if the cache is empty


! Warning

  The following items may need attention:
   ▸ CoreUI.xcframework is missing architecture macos-arm64e-arm64-x86_64/CoreUI.framework/CoreUI defined in the Info.plist
   ▸ CoreUI.xcframework is missing architecture ios-arm64-arm64e/CoreUI.framework/CoreUI defined in the Info.plist
   ▸ CoreUI.xcframework is missing architecture ios-arm64-x86_64-simulator/CoreUI.framework/CoreUI defined in the Info.plist
   ▸ CoreUI.xcframework is missing architecture xros-arm64-x86_64-simulator/CoreUI.framework/CoreUI defined in the Info.plist


✖ Error
  Couldn't find any supported architecture references at /Users/kyle/Workspace/OpenSwiftUIProject/OpenSwiftUI/Tuist/.build/checkouts/DarwinPrivateFrameworks/CoreUI/2024/CoreUI.xcframework. It's possible that the .xcframework was not generated properly or that it got corrupted. Please, double check with the author of the framework.

  Sorry this didn’t work. Here’s what to try next:
   ▸ If the error is actionable, address it
   ▸ If the error is not actionable, let's discuss it in the [Troubleshooting & how to](https://community.tuist.dev/c/troubleshooting-how-to/6)
   ▸ If you are very certain it's a bug, [file an issue](https://github.com/tuist/tuist)
   ▸ Check out the logs at <redacted>

@Kyle-Ye
Copy link
Collaborator

Kyle-Ye commented Mar 22, 2026

Since there is no reply yet, I have created #838 instead.

@pepicrft
Copy link
Author

@Kyle-Ye apologies for my delayed response. Turns out some business logic in Tuist didn't support .tbd files, causing the error that you just faced. Once we merge this we should be able to unblock this PR.

@Kyle-Ye
Copy link
Collaborator

Kyle-Ye commented Mar 24, 2026

apologies for my delayed response.

No worries at all on the timing.

I've verified the build succeeds for macOS, iOS device, and iOS Simulator in both Debug and Release configurations, and successfully produced an XCFramework with xcodebuild -create-xcframework.

I’m also a bit curious about the exact steps you used earlier, just to make sure we can reproduce the same setup reliably.

@Kyle-Ye Kyle-Ye linked an issue Mar 24, 2026 that may be closed by this pull request
2 tasks
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.

Add xcframework support

2 participants