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
Prevent Transitive Dependency Errors in Swift Project with Vendored Frameworks #3289
Comments
I'm assuming that LayerKit is only used via Atlas in this case? Could you also try what happens if you were to import and use LayerKit directly in the target app? |
@neonichu Do you mean import it as a direct dependency also in the podfile? |
@blakewatters No, I meant actually importing the module and using it inside the app directly. |
We have a similar structure where one Pod of our app ( Is there any reason this is an error instead of a warning?? PS: If I recall correct we link the static library to the app target and use PPS: We hope this is a temporary workaround until @blakewatters releases a dynamic framework version of |
We made this fail to front-load inevitable build failures, a warning that basically says "this will not build" would be weird :) It obviously shouldn't stop any working cases, though, so it might need to be even more specific. |
eh sigh @neonichu you are correct — it’s having trouble resolving the Obj-C imports both within Atlas and if you directly import LayerKit. I’ll pull the source file workaround that prevented the build failure as its just moved it from Pod install time to build time. What’s the remedy here? Do I need to declare Swift as unsupported until the packager can output dynamic frameworks? |
Well, you can support Swift as long as your users are using a bridging header
|
@segiddins and are not integrating any Swift pods. One way out could be moving the vendored LayerKit into the Atlas podspec directly, instead of a dependency, then it would all be linked into one dynamic framework. |
Would building LayerKit as a dynamic framework improve the situation or is vendoring LayerKit such that it rolls up into one installable unit the only choice? I’m still trying to get my head around the exact problem space here as I haven’t done any Swift work yet |
Pretty sure that building it as a dynamic framework is all that's needed. |
Building as a dynamic framework would also eventually work, the vendoring approach was more a workaround suggestion. At the moment, CP doesn't handle dynamic frameworks properly (see #1993) and there's possibly additional changes involved to make them work as transitive dependencies once that is done. |
Until this issue is resolved we worked around the static library check by simply disabling it in the pre_install do |installer|
internalInstaller = installer.installer
def internalInstaller.verify_no_static_framework_transitive_dependencies; end
end We can build again :) |
Closing, as there is nothing for us to do here. |
@fluidsonic how do you do pod lint? The error still happend |
We're just using such a pod dependency and don't use |
fix for pre_install do |installer|
def installer.verify_no_static_framework_transitive_dependencies; end
end |
@cooler333 are you sure it can be written in |
@k06a read again) |
@cooler333 I am working on library that have a problem with dependency pod. And I have problems with |
@k06a look at YandexMapKit Podspec. how they integrate static library. "ios": {
"vendored_libraries": "libYandexMapKit.a"
} I'm trying do the same in my swift library, but with no success. |
@k06a Does You try to integrate |
My podspec have |
@neonichu we are unable to have a dependencies with static libraries inside because can not manipulate |
It was not added to the latest cocoapod, which is 1.5 something |
@fluidsonic Thanks |
Thanks!! |
I publish a pod that requires apps to add this workaround to their Podfile. However, when I try to |
Thank you @fluidsonic ❤️ |
I believe in the latest version of Pods it's not
but:
|
I’ve recently had to push a release of two of my libraries that included a workaround for the transitive dependency error:
The setup of the pods is this:
vendors_frameworks
(see the podspec here)Under Objective-C projects in v0.35.0 and v0.36.0, this installs without issue. In a project with a Podfile that includes Swift dependencies such as:
You run into the transitive dependency issue referenced above. In researching this problem I found mention somewhere that the problem is that since the dependency (LayerKit) doesn’t have any source files, its linking process is different from a source based pod and the error is triggered.
I managed to work around this in Atlas v1.0.2 by adding a dummy source file to my distribution repository and pulling it into the podspec. See the file here and the relevant podspec change here.
So my question is:
/cc @neonichu @segiddins
The text was updated successfully, but these errors were encountered: