Hive
Tuist generates inconsistent “Build Phases” output when linking a common xcframework
GitHub issue · Open
What happened?
I found Tuist (tuist generate) generates inconsistent “Build Phases” output at “Link Binary With Libraries” and “Embed Frameworks” phases when linking a common xcframework that is depended on by multiple targets. (I attached an example project zip file at the bottom of this description)
Let’s say we have tuist-app project of Tuist, and the project has the following dependency graph:
tuist-app->XCFramework A(note:binaryTargetforXCFramework Ais declared in an umbrellaPackage.swiftfile to follow this workaround)tuist-app->Swift Package BSwift Package B->XCFramework A(This is declared in theSwift Package B’sPackage.swiftfile)
And then, execute tuist generate command, the result of Xcode project (workspace) would be either of these:
XCFramework Aappears in both “Link Binary With Libraries” and “Embed Frameworks” (1st screenshot)XCFramework Aappears only in “Link Binary With Libraries” (2nd screenshot)
I roughly executed tuist generate command 10 times after removing generated projects, workspaces, Tuist/.build, and all Derived directories. The result was like 8 times with “Link + Embed” cases and 2 times with only “Link” cases. (though I’m not sure whether this would help or not)
In addition, although I couldn’t reproduce it in the attached example project of the minimum case, I encountered an issue of duplicated xcframeworks in the “Link Binary With Libraries” phase. In that case, XCFramework A was linked twice. The one came from tuist-app itself dependency (Tuist/.build/artifacts/binarytargets/XCFrameworkA/XCFrameworkA.xcframework) and the other one came from Swift Package B ’s dependency (Tuist/.build/artifacts/SwiftPackageB/XCFrameworkA/XCFrameworkA.xcframework)
Here is a minimum example project: tuist-app.zip
In this project, FBAudienceNetwork is depended on by the tuist-app project and NimbusKit Swift Package here
How do we reproduce it?
- Use the attached sample project
- Execute
tuist installandtuist generate - Open
Build Phasespanel oftuist-apptarget
Error log
The inconsistent result of the Build Phases panel
macOS version
15.6.1
Tuist version
4.109.1
Xcode version
26.1.1
Investigate, reproduce, or fix this item in an isolated repository. Each Flight preserves its outcome and agent session.
Start a Flight and preserve its objective, outcome, and session here.