-
Notifications
You must be signed in to change notification settings - Fork 15.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
protobuf.pc pkgconfig file generated by protobuf's cmake build doesn't declare absl and utf8_range dependencies. #12439
Comments
CC @deannagarcia @mkruskal-google I have a dirty workaround I can use in our distribtests so fixing this isn't a strict blocker for grpc's protobuf 22.x upgrade, but of course this is something that still needs to be fixed in order for building via pkgconfig to become clean again. |
I have run into this trying to build grpc . In the grpc cmake build I'm declaring gRPC_PROTOBUF_PROVIDER=package and pointing Protobuf_DIR to the part of the protobuf install with the protobuf-config.cmake file. When the grpc config gets up to the protobuf part it fails saying the protobuf is marked as not found due to missing utf8_range dependency. What workarounds are there ? I'm trying various thing but no luck so far. Edit: actually I don't know if this is the same pkgconfig problem, but it seems related. |
You can use the gRPC's "distribtests" as a reference for what cmake flags/options you need to use to successfully build under different scenarios: https://github.com/grpc/grpc/tree/master/test/distrib/cpp (choose script that best matches your use case) Hope that helps. |
See protocolbuffers/protobuf#12439 for more information PiperOrigin-RevId: 525796488
See protocolbuffers/protobuf#12439 for more information PiperOrigin-RevId: 525796488
See protocolbuffers/protobuf#12439 for more information PiperOrigin-RevId: 525796488
This is impacting grpc-java as well (for the protoc plugin). Absl has an incredible 83 libraries, each with their own separate .pc. Although this will only solve our build on Linux, I'm still uncertain how we'll handle this many libraries on Windows. |
See protocolbuffers/protobuf#12439 for more information PiperOrigin-RevId: 525796488
See protocolbuffers/protobuf#12439 for more information PiperOrigin-RevId: 525856503
@mkruskal-google, this still seems broken. When building on 344f6de:
Manually adding
Looks like the problem is utf8_range doesn't add its library:
|
Whoops, that's what I get for copy pasting >.<! That |
See protocolbuffers/protobuf#12439 for more information PiperOrigin-RevId: 527418523
See protocolbuffers/protobuf#12439 for more information PiperOrigin-RevId: 527597255
Starting from 22.x, protobuf now depends on absl and utf8_range, but the protobuf.pc pkgconfig file doesn't properly declare those dependencies.
As a result, the build is broken if someone installs protobuf and then wants to include it via pkgconfig (since they'd be missing absl and utf8_validity symbols when trying to link).
See https://github.com/protocolbuffers/protobuf/blob/f11079b01f075bc7c5b3286d85a8feca798c09e9/cmake/protobuf.pc.cmake
This issue breaks grpc's build-and-install "distribtest" that tries to build helloworld example with grpc and protobuf:
https://github.com/grpc/grpc/blob/24d83cda9bb1caaff9c03ace6f418e946e88c49d/examples/cpp/helloworld/Makefile#L28
(which runs pkgconfig to get a list of libraries to link against when building a project that depends on grpc++ and protobuf).
The text was updated successfully, but these errors were encountered: