-
Notifications
You must be signed in to change notification settings - Fork 134
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
RUMM-1145 Carthage XCFrameworks support #439
Conversation
77e38dd
to
9d84210
Compare
there is still something that i don't understand: |
9d84210
to
b1bbbfe
Compare
1. .frameworks replaced with .xcframeworks 2. FRAMEWORK_SEARCH_PATH is set for both Datadog and DatadogObjc Otherwise `carthage build` fails with no module found errors
b1bbbfe
to
4c6b489
Compare
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.
Looks good 👌. I'm assuming something extra would have to be done for the crash-reporting
branch once it's merged, but that's another work. Let's ship this as a hotfix?
PWD := $(shell pwd) | ||
# TODO: RUMM-760 Remove this workaround once Carthage fixes their Xcode 12 issue | ||
# https://github.com/Carthage/Carthage/issues/3019 | ||
export XCODE_XCCONFIG_FILE := $(PWD)/tmp.xcconfig |
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.
Great to see it gone 💪
for the records: |
RUMM-1145 Carthage XCFrameworks support
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