[SR-13075] Swift Package that has @objc
in Swift code causes Objective-C module failure with transitive depdency
#4531
Labels
@objc
in Swift code causes Objective-C module failure with transitive depdency
#4531
Environment
Xcode 11.5 (11E608c)
Xcode 12.0 beta (12A6159)
Additional Detail from JIRA
md5: d0de46f3d4acb3486ea389af9cfdde7a
is blocked by:
Issue Description:
When the Xcode target (such as Application) has a transitive dependency to the Swift Package, such as it is importing a dynamic framework that is importing Swift Package that has public
@objc
interface, such as a delegate protocol, we can’t build the target due to Objective-C module failure.Reproducible project is at https://github.com/niw/swift_package_objc_module_failure.
Error message you will see is like this.
In this example, the dependency is like this.
Since if the middle dynamic link library is using Swift package or not is unrelated to both the application target owner and package owner, all Swift packages that have
@objc
can have this issue.Therefore, currently basically
@objc
can't be use feely in Swift Package.A few observations:
This is caused by missing
-Xcc -module-map-file
forswift -frontend
for the transitive Swift package dependency used for the Swift files in the application target.This is not happening if the module that Swift Package provided is written in Objective-C.
The text was updated successfully, but these errors were encountered: