New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SR-14589] SPM doesn't support dynamic BinaryTargets #4426
Comments
@swift-ci create |
It does not make sense for a product to specify a type if the only content is a binary target because the binary has an inherent type. |
@neonichu Should this be marked Resolved / Won't Fix ? |
Sorry for the late response, but I only got the email with the last comment of theindigamer (JIRA User). Let me share my use case, to give more context. I'm developing a closed source XCFramework that other companies integrate, let's call it MyXCFramework. MyXCFramework has a closed source XCFramework dependency, [Twilio Video](https://github.com/twilio/twilio-video-ios). Twilio Video XCFramework dependency supports SPM, and I want to integrate it into MyXCFramework via SPM. The problem is that I don't want Twilio Video XCFramework dependency to be embedded in MyXCFramework, otherwise, MyXCFramework will end up becoming an umbrella framework, which is not is not recommended by Apple, nor supported in iOS, AFAIK. To fix this I need set this dependency as `Do Not embed`. The workaround that I found was to manually manage this dependency. When integrating Twilio Video XCFramework manually, Xcode recognises it as an actual XCFramework, and allows me to choose the option `Do Not embed`. How can I consume a Twilio Video XCFramework via SPM and choose the option `Do Not embed`? Thanks |
Any news on this? 🙂 |
Comment by Tadej (JIRA) I would very much appreciate this! Is it going to be implemented in a near future? |
Comment by Antonio Jesús Pallares (JIRA) I've also encountered this very issue. Is there any news about it? |
Any news about this issue ? |
Xcode 14 completely ignores the inherent mach-o type of the framework wrapped fro SPM and defaults to embedding behavior. This leads to a situation where static frameworks are embedded into a project, and Xcode fails to install an app bundle with a cryptic "The code signature version is no longer supported." message. I don't don't know who is responsible for this. Looks like a poor work from the Xcode team integrating SPM. |
@shengchalover Could you please share more information about this issue (ideally via Developer Feedback since this is an Xcode issue)? We are not aware of any issues here, static frameworks that are part of a binary target from a package should not be embedded into apps, only dynamic frameworks are. |
@neonichu I opened a radar about this in 2021, but never got an answer. |
We develop a turn-key WireGuard package so that our partners do not need to include the Golang tooling to build WireGuard for the PacketTunnelProvider which we publish here https://github.com/GuardianFirewall/GuardianWireGuard We are in the same situation now in which our partners are unable to mark the dependency as "Do Not Embed" in the app extension to avoid the warning about nested frameworks upon submitting the build to App Store Connect. I will have to ask them to manually manage it for the time being but any improvements on this matter would be very appreciated 👍 |
Attachment: Download
Additional Detail from JIRA
md5: 47cf50081421cc5894af17449be47d24
Issue Description:
When I tried to create a dynamic SPM that uses a BinaryTarget (XCFramework), I tried to make it dynamic, but Xcode is throwing the following error:
`invalid type for binary product 'MyLibrary'; products referencing only binary targets must have a type of 'library'`
According to the two following code references, SPM doesn't support
After looking at the two code references, it seems that SPM doesn't support Swift Packages with dynamic BinaryTarget (XCFramework) .
swift-package-manager/Sources/PackageLoading/ManifestLoader.swift
Lines 442 to 447 in a5f7859
swift-package-manager/Sources/PackageLoading/ManifestLoader.swift
Lines 976 to 978 in a5f7859
But this a nice improvement to SPM and feature that I need.
The text was updated successfully, but these errors were encountered: