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
Embed external xcframeworks regardless of linking type #6217
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @fortmarek
switch self { | ||
case .macro: return false | ||
case let .xcframework(xcframework): | ||
return xcframework.linking == .dynamic | ||
return xcframework.linking == .dynamic || xcframework.isExternal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I can see, we need to also restrict by xcframework type framework (.framework
)
XCFramework Type | Result | Note |
---|---|---|
Static Library .a |
β | Embedding simply copies the .a to /Frameworks with all the symbols included |
Dynamic Library .dylib |
β | Embedding copies the .dylib to /Frameworks as expected |
Static Framework .framework |
β | Embedding copies the .framework to /Frameworks and strips symbols from framework binary |
Dynamic Framework .framework |
β | Embedding copies the .framework to /Frameworks as expected |
e.g. MyStaticLibrary.xcframework
gets processed to a libMyStaticLibrary.a
which shouldn't be embed.
It doesn't look like we capture the framework type information in the xcframework metadata - we can base it based on the library extension
return xcframework.linking == .dynamic || xcframework.isExternal | |
return xcframework.linking == .dynamic || (xcframework.isExternal && xcframework.infoPlist.libraries.first?.path.extension == "framework") |
or can uplift this to be a property on the metadata
return xcframework.linking == .dynamic || xcframework.isExternal | |
return xcframework.linking == .dynamic || (xcframework.isExternal && xcframework.type == .framework) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha π I updated the PR with the first suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please see also the wrong linking for xcframeworks https://github.com/tuist/tuist/pull/6153/files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe xcframework.linking is just wrong
This reverts commit 3bebe42.
Resolves #6100
Short description π
This PR supersedes #6182 and #6183. I discussed this issue with @kwridan at SwiftHeroes and we both agreed that the best approach for the missing privacy report is to follow what Apple is doing by embedding xcframeworks. That being said, to minimise the impact this change might have (especially regarding resources), we will be only embedding xcframeworks if they are external.
How to test the changes locally π§
Generating privacy report for
app_with_spm_dependencies
should includeGoogleMobileAds
Contributor checklist β
mise run lint:fix
Reviewer checklist β
changelog:added
,changelog:fixed
, orchangelog:changed
, and the title is usable as a changelog entry