Create pkg-config files from CMake#20211
Conversation
|
|
|
@zackgalbreath I started the tests. In the meantime, you'll need to sign the CLA. |
|
It would also be nice to add some check for the .pc files being setup correctly to one of our distribtests so that this gets continously tested. |
543cd21 to
c045366
Compare
|
@zackgalbreath have you been able to figure out the CLA signing process? |
|
@zackgalbreath can you please regenerate the CMakeLists.txt to resolve the merge conflict? It would be good to expand our distribtests to make sure the generated .pc files are actually installed and that they work as expected. |
c045366 to
b6dd719
Compare
c5f5d40 to
a4aac4c
Compare
examples/cpp/helloworld/Makefile
Outdated
| -Wl,--no-as-needed -lgrpc++_reflection -Wl,--as-needed\ | ||
| -laddress_sorting\ | ||
| -lcares\ | ||
| -lz\ |
There was a problem hiding this comment.
As you can see, I had to add some libraries to the helloworld Makefile to get it to build. Please let me know if you would've expected this to build cleanly without these modifications.
There was a problem hiding this comment.
I think the reason for the difference it that when built and installed via Makefile, address_sorting, cares and zlib are statically linked into libgrpc (as far as I can tell)
With cmake installation (as per the distribtest), we're actually building each of these libraries with gRPC_*_PROVIDER=package, so they end up installed as individual libraries (and thus need to be linked explicitly).
There was a problem hiding this comment.
That actually begs the question that if the deps are installed as separate libraries, perhaps the pkgconfig files should know about these dependencies? (which is kind of the point of pkgconfig).
There was a problem hiding this comment.
Discussed with @nicolasnoble offline -
the pkg config files need to carry information about what the dependencies are (gpr, address_sorting, cares, zlib) for them to be useful - that should make the original helloworld Makefile to work fine.
There was a problem hiding this comment.
👍 I updated the CMake and Makefile created .pc files to indicate these dependencies. I also updated Requires.private to Requires so pkg-config will find grpc for you if you ask for grpc++.
a4aac4c to
60b9f7b
Compare
|
The EasyCLA check is looking good, glad that it finally worked for you! |
|
Are these four failing checks something I should look into? |
|
tasks.distribtest.cpp_linux_x64_jessie_routeguide fails with The |
|
The above error seems to be happening because our Makefile build actually links all the dependent libraries statically (e.g. cares, libz) as part of libgrpc, so e.g. |
Change "Requires.private" to "Requires" so pkg-config can better provide gRPC's dependencies.
Use pkg-config to automatically find grpc as a dependency of grpc++.
60b9f7b to
d6f4891
Compare
jtattermusch
left a comment
There was a problem hiding this comment.
LGTM, thanks for the contribution!
I'll merge as soon once I doublecheck the test results.
|
This change breaks linux/grpc_distribtests_standalone test. https://fusion.corp.google.com/projectanalysis/summary/KOKORO/prod%3Agrpc%2Fcore%2Fmaster%2Flinux%2Fgrpc_distribtests_standalone |
|
@nanahpang I think you're wrong. The first failing build is https://source.cloud.google.com/results/invocations/3323a229-9ae7-4c3a-abd3-3ef410cacd9d/targets This PR got integrated earlier at https://source.cloud.google.com/results/invocations/e821ab54-3f6d-4ac1-859b-5e40a841a63c/targets |
|
LGTM, btw. |
|
@zackgalbreath it looks like we might be failing to reference openssl as one of the dependencies in the pkgconfig files. A seemingly unrelated PR is triggering the problem: |

Fixes #10727
@nanahpang
@jtattermusch