-
Notifications
You must be signed in to change notification settings - Fork 2.6k
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[bug] Pod's vendored libraries directory is passed to the downstream target #9559
Comments
Can you post the linker flags that are in the generated .xcconfig file for |
Here is the
And the
|
@amorde Hi Eric, have you had time to look at this issue? One of our clients just had the issue, they went with patching the |
Only briefly - I think this is a symptom of a more general issue with static linking. CocoaPods doesn't link vendored libraries to both the pod and the app, otherwise there would always be duplicate symbols in the binary. The problem here is that you have a vendored dependency "Crashlytics" which depends on libc++ but another pod "Tanker" which depends on the same library but a completely different version of it. Crashlytics may not work with your version of the c++ library, and if we link both then you'll end up with duplicate symbols, so CocoaPods is a bit stuck here. I do not think we can apply the change you suggest because it would break other projects. That said, I'm not an expert here so there may be other bits of information I'm missing. |
In the build flags of our Podspec, we use a linker script to only make visible the objective-c symbols, all of the others are hidden, to avoid any collision (including the The problem here is that the Only |
Does Tanker not have |
@amorde Here is the |
This line: will cause CocoaPods to put that directory into Since you're already manually exporting symbols, you might be able to manually link your library to your pod with something like this:
|
@amorde Hi Eric, thanks to you we managed to fix the problem by generating the Podspec with the correct linker flags. It would be great to change the documentation of Right now, it merely states that Also, I don't see a "real" use-case for that attribute, excepting maybe having multiple internal Pods and a final App that links static libs from those pods. |
This fixes using Tanker alongside Crashlytics in the same project for instance. See CocoaPods/CocoaPods#9559 for details
That said, the documentation could definitely be improved 👍 |
@amorde Right, but if two different pods wrap the same precompiled library, but a different version, there will be a symbol collision in the final app. That's why we chose to hide symbols in the first place. But I might miss something huge... |
Yes you're right, but usually in these cases they're depending on a
and CocoaPods will do the dependency resolution to ensure only 1 version of OpenSSL is included, and will complain about conflicts. But you are correct, if two pods bundle their own versions of libraries with |
@amorde Oh right I'm silly, those pods really wrap a library 🤦♂, nevermind my previous comment |
So, to be clear, I've been using both in a wrong way then. |
If you have a library which is effectively a private implementation detail and you do not expose any symbols from that library, then |
Actually this is less true for |
Thanks for the answer. In the end my problem was that the library wasn’t called libsomething.a, just something.a, and they were not found because of that. |
Is there anything to be done here? |
This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem 👍 |
@dnkoutso The only "fix" would be to make the doc more explicit about what |
Report
What did you do?
MyPod
)pod init
Podfile
with the following:pod install
open MyPod.xcworkspace
What did you expect to happen?
The project builds.
What happened instead?
The linker invocation fails.
Tanker bundles quite a lot of static libraries, which are all in the
Libraries
folder, and marked in theTanker.podspec
asvendored_libraries
.We do vendor our own version of
libc++
.Crashlytics
addsc++
to the list of required system libraries. It should not cause any issues, since theTanker
vendored libraries should be used during the build/link phase of theTanker
framework.Unfortunately, if you look at the failing link command line, there is a
-L${PODS_ROOT}/Tanker/Libraries
part, thus the linker picks uplibc++.a
from theTanker
pod, instead of the systemlibc++.tbd
.We found that the
Library Search Paths
was indeed populated with-L${PODS_ROOT}/Tanker/Libraries
in the Xcode project. After removing the following lines in Cocoapods' sources, it stopped populating this variable (but failed to pass integration tests):I've played with ruby only once or twice before, and I don't know the CocoaPods codebase at all, so I figured it would cost me a lot of time to fix it in the most proper way...
CocoaPods Environment
Stack
Installation Source
Plugins
EDIT: Same problem with the latest master commit (c59529f)
The text was updated successfully, but these errors were encountered: