Hive
Cached dynamic wrapper loses a static xcframework’s module map for downstream consumers
GitHub issue · Open
What happened?
When an external dynamic framework imports a C module from a static xcframework that a different external package wraps, and both externals come from the binary cache, consumers of the cached framework can no longer resolve the C module. No target in the generated workspace references the xcframework’s module map, so the first local target that imports the cached framework fails.
Graph:
App → Feature (local framework) → EngineKit (external, .framework) → VendorWrapper (external, .framework) → CVendor (static C xcframework with module.modulemap)
EngineKit does import CVendor, so its .swiftmodule depends on the CVendor module. Built from source, everything works. With EngineKit and VendorWrapper replaced by cached binaries, Feature fails to compile.
Expected: the generated workspace keeps the CVendor module map visible to targets that compile against the cached EngineKit (either by Xcode processing the xcframework or through the derived module map from StaticXCFrameworkModuleMapGraphMapper), as it does for the source build.
This looks close to what #12757, #12807, #13603 and #13618 address, but the case still fails on 4.212.0 and 4.213.0-rc.1. Our workaround is excluding the wrapper from the cache profile (except:), which also keeps the framework that depends on it built from source.
How do we reproduce it?
Sample project: https://github.com/shgew/tuist-cached-static-xcframework-repro
mise install(pins Tuist 4.212.0)tuist installtuist cache(storesEngineKit,Feature,VendorWrapper)tuist generate --no-open(prints “Using cache binaries for the following targets: EngineKit, VendorWrapper”)xcodebuild build -workspace App.xcworkspace -scheme App -destination 'platform=iOS Simulator,name=iPhone 17 Pro' -derivedDataPath DerivedData- See the error below
Control: tuist generate --no-open --cache-profile none followed by the same build succeeds.
Error log
error: Unable to resolve module dependency: 'CVendor' (in target 'Feature' from project 'App')
note: A dependency of Swift module 'EngineKit': '<repro>/DerivedData/Build/Products/Debug-iphonesimulator/EngineKit.framework/Modules/EngineKit.swiftmodule/arm64-apple-ios-simulator.swiftmodule'
note: A dependency of main module 'Feature'
macOS version
27.0.1
Tuist version
4.212.0 (also reproduces on 4.213.0-rc.1)
Xcode version
27.1 (27A9275)
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.
No GitHub comments yet.