-
Notifications
You must be signed in to change notification settings - Fork 133
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
Failed to build module this SDK is not supported by the compiler #1402
Comments
Hey @akovalov 👋. We use Regarding the issue, I think there might be 2 unrelated problems, but we need a bit more information to help you. Notably:
What exactly you mean by "adding DD to XCFramework via SPM" 🙂? Is it that your framework declares DD as dependency in The latter problem might be unrelated to DD SDK, as the error message only mentions your
On our side, Module Stability seems to work as expected - producing |
Hi @ncreated Thank you for the detailed reply. The DD is added to the OurCustomSDK Xcode project in the "Package Dependencies" section on the screenshot And the XCFramework build script looks like this
Regarding the We provide a binary xcframework only and the Package.swift to add OurCustomSDK with DD dependency looks as follows. Using this Package.swift I get these errors.
So it's the kinda general question of how to link a third-party library in a binary xcframewok. Do you have any ideas or examples? Also, even when xcframework is built with Xcode 14.3.1 and I use it in Xcode 14.3.1 I get the error
Not sure if it is because of the above error or is a different one. |
Thanks for sharing more context @akovalov 👍
I think you're right on that part. While the
Sorry, no quick answer to this question. I'll create a backlog item and we will investigate it internally, hopefully coming up with a solution for adding DD as dependency to Vendor frameworks through SPM. I assume |
Thank you for your reply @ncreated Yes, the It seems to work OK if I would add built Datadog's
That would be great, thanks. Wondering, if you have any other solutions for adding DD as a dependency to Vendor frameworks in other ways than SPM? |
Hi @ncreated just an update that I got it working by importing all DD modules with
In this way, the DD symbols stay internal to the OurCustomSDK only and are not visible to the project that adds this SDK.
However, I didn't experience an error because of it and the DD instance continues working fine in the SDK. I guess if both project and SDK will use the same DD SDK version then should be no issues at all. Maybe, if the project's DD version is different than SDK's version and for example, the class has some function in one version but does not have it in another and the system picked the one without the function and if the function will be called the app could crash. But it's just an assumption right now, can't confirm or deny this yet. |
Just tested both cases when the integrator project has DD v2.0 and v1.23 dependency. Seems no errors (except the above console log) in the behavior and both logs from the app and SDK are visible in the dashboard. Also no crashes so far. So I guess we are fine with it for now and the question can be closed unless you got any more thoughts to share. Thanks! |
Hi @akovalov ! Thank you very much for sharing your conclusions, it's very helpful! You are facing a limitation of SPM, there is an opened issue swiftlang/swift-package-manager#4449 as well as an evolution pitch on that matter. What you did is actually the workaround described in here, but it indeed results in duplicated symbols warnings. Sadly, there is nothing we can do on our side to make this setup work. With a fair amount of refactoring, you could workaround this by removing the dependency to Datadog in I will close this issue but feel free to add more comments if you have any findings. |
Hi @akovalov, I am facing the same issue you mentioned but your workaround in this comment #1402 (comment) didn't work for me. Can you please provide more details how you link the Frameworks in your Thanks, |
Hi @mnabulsi92 I have Datadog added via SPM in the OurCustomSDK project. We provide SDK as a binary file, so during .xcframework generation, the Datadog frameworks are embedded inside the OurCustomSDK automatically during building by In your case, you do not embed in SDK and link as a dependency of your SDK. Your error is that SPM does not load the DD library for some reason during runtime. So yes, my solution will not work for you, cause this is a different issue. We provide SDK by xcframework file and via SPM and Cocoapods. I can't confirm at this moment that Cocoapods works with this solution, will need to test it. However, it will not help you anyway. |
Hi @akovalov, thanks for your reply. I tried to embed the Datadog into our Did you face the same issue with your SDK? |
@mnabulsi92 we just started using Datadog and didn't release a public version to try this case. Thank you for sharing it, we need to verify it asap on our end because it will be a blocker. |
The issue
We have a custom XCFramework where we add the latest Datadog v2.0.0 via SPM (only DatadogCore and DatadogLogs are used).
On "import DatadogCore" the Xcode gives a warning:
warning: module 'DatadogCore' was not compiled with library evolution support; using it means binary compatibility for 'OurCustomSDK' can't be guaranteed
Then we build a binary .xcframework and it is built successfully. But when adding this .xcframework to other projects and having Datadog added via SPM in that project there is such a build error in Xcode
Failed to build module 'OurCustomSDK'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.8.1 (swiftlang-5.8.0.124.5 clang-1403.0.22.11.100)', while this compiler is 'Apple Swift version 5.9 (swiftlang-5.9.0.124.4 clang-1500.0.38.1)'). Please select a toolchain that matches the SDK.
and also
Missing required module 'DatadogPrivate'
We have
BUILD_LIBRARIES_FOR_DISTRIBUTION
set toYES
during XCFramework building.Do you have any suggestions? Thanks!
Datadog SDK version:
2.0.0
Dependency Manager:
SPM
Xcode version:
Xcode 14.3.1 (14E300c) and Xcode 15 Beta
Deployment Target:
iOS 14
The text was updated successfully, but these errors were encountered: