RUMM-1145 Carthage XCFrameworks support #439
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The main thing of
carthage
is building projects for every possible arch-platform so that they don't need to be rebuilt when the developer changes the target arch-platform.It was achieving this by
lipo
ingBuildProducts
for different arch-platforms and giving one single.framework
containing multiple slices.This model stopped working as
arm64-simulator
arch-platform came along with Apple Silicon; it duplicatedarm64-ios
andlipo
doesn't merge duplicate slices.Apple's solution
Apple introduced
XCFramework
s to solve this problem: this format can contain multiple.framework
s for different arch-platforms.Carthage's solution
carthage
started supporting this new format starting from0.37
.carthage
also maintains backward compatibility by not breaking projects that are configured for.framework
dependencies.For some reason (this looks like a bug in
carthage
to me),dd-sdk-ios
works only in this backward-compatibility mode although it is configured with.xcframework
Backward compatibility
If the target has
FRAMEWORK_SEARCH_PATH
set toCarthage/Build/
,carthage
assumes that it searches forExample.framework
whereas there isExample.xcframework
instead.In that case,
carthage
extracts the content ofExample.xcframework
and inject its location as an extraFRAMEWORK_SEARCH_PATH
toxcodebuild
Setting such a
FRAMEWORK_SEARCH_PATH
value triggers XCFramework extraction and compilation succeeds ✅ℹ️ Note that this build setting is not supposed to be needed for compilation.
ℹ️ Based on my trials, always the second target fails at building for
iphonesimulator
Build settings of
Kronos
Kronos
hadVALID_ARCHS
in its base xcconfig file and it was not updated after the introduction ofarm64-simulator
.I fixed it with MobileNativeFoundation/Kronos#76
I also asked for a hotfix version and I'm waiting for a response.
If
Kronos
ships a hotfix...We can update to this version and
dd-sdk-ios
can be used by Apple Silicon ownercarthage
users ✅Sooner or later, we will need to support this arch-platform.
Review checklist
Kronos
ships a hotfix, remove the content ofBase.xcconfig