-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
asio-grpc: Fix grpc++ linkage #19070
Conversation
I detected other pull requests that are modifying asio-grpc/all recipe: This message is automatically generated by https://github.com/ericLemanissier/conan-center-conflicting-prs so don't hesitate to report issues/improvements there. |
I don't think this addresses the exact problem I mentioned in #18102 - my CMakeLists.txt file uses ASIO_GRPC_DISABLE_AUTOLINK because it has to build without using conan in some instances. Choosing to link either grpc++ or grpc++_unsecure in asio-grpc therefore inevitably has some library linked twice unless I manually remove it (as shown in that bug report) |
to be clear, this is because in my own CMakeLists.txt (having used DISABLE_AUTOLINK) I then explicitly link in grpc++ to the target. If conan does that as well I think we end up linking it twice... this actually isn't a problem in my particular build as I'm using it as a shared library, but if you used it as static you end up with duplicated code... THen again, using it as static I'm not sure triggers the original issue anyway... |
a second issue (that I also brought up in another thread somewhere) is that grpc build with "secure=False" does not mean you always want to link against grpc++_unsecure does it? Both libraries are built in that case as far as I can see... |
I don't see how that can happen when you use CMake, it will automatically deduplicate.
As is, the option isn't really applicable, if you link with |
@ conan-team, this pull request is now ready for review. The conflicting pull request has been closed, see #18529 (comment) |
Conan v1 pipeline ✔️All green in build 1 (
Conan v2 pipeline ❌
The v2 pipeline failed. Please, review the errors and note this is required for pull requests to be merged. In case this recipe is still not ported to Conan 2.x, please, ping See details:Failure in build 1 (
Note: To save resources, CI tries to finish as soon as an error is found. For this reason you might find that not all the references have been launched or not all the configurations for a given reference. Also, take into account that we cannot guarantee the order of execution as it depends on CI workload and workers availability. |
Contained in #22910 |
Specify library name and version: asio-grpc/*
Fixes #18102 in the following ways:
It seems that no other recipe handles the difference between gRPC secure and unsecure correctly. See for example google-cloud-cpp or opentelemetry-cpp. I think this is a problem with the gRPC recipe itself where
grpc++
should aliasgrpc++_unsecure
whengrpc:secure=False
and it should not be addressed in dependent recipes. Linking with bothgrpc++
andgrpc++_unsecure
leads to the issues described in this issue: ServerBuilder::BuildAndStart hangs on Ubuntu 19.10 grpc/grpc#21213 (comment).It fixes another problem given the following conanfile.txt:
fails with
No because these instructions don't seem to work anymore with conan 2.0.9: https://github.com/conan-io/hooks#conan-config-as-installerTested with conan v1 now.