-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
ODR violation when building protobuf with bazel as a dependency of grpc #12314
Comments
@deannagarcia @mkruskal-google this is one of the issues that block grpc's upgrade to 22.x |
I have never seen this issue and I would guess it has more to do with how grpc uses protobuf (this file/line looks particularly suspect: https://github.com/grpc/grpc/blob/451b2303588965f7110526e4ae57f88ca4abfce7/bazel/protobuf.bzl#L270). Can you link me to where this is being run/can you create a simpler reproduction case? |
To reproduce:
That gave me the same error as on the CI
|
I think this is still too grpc-specific for us to help debug, especially with the custom server and bazel rules. Do you ever see the odr violation anywhere else? Can you point us to a proto rule that is making either of these files? |
@jtattermusch can you help me understand what these virtual imports are needed for? I don't really understand why this is an issue on our side? Can you help me understand the need for all this? I am seeing this |
Ok, I looked at the situation more in depths are here are my findings:
AFAICT, the Is seems that the @com_google_protobuf//src/google/protobuf:wkt_cc_proto dependency comes the dependency chain The wkt_cc_proto target was added here: https://github.com/protocolbuffers/protobuf/pull/10576/files Questions: Should grpc_proto_library not depend on |
I see the issue, and the I think the easiest workaround is for you to use proto_lang_toolchain like we were using before. You can blacklist the wkt protos to stop the extra definition from being pulled in. We are taking over these rules from bazel long term, so this is an issue we can hopefully look to resolve in the future. |
Update: this was fixed in #12419. |
When running gRPC bazel build with an upgraded protobuf dependency (to 22.x), ASAN reports and ODR violation.
Indeed, it seems that
wrappers.pb.cc
(one of the WKT) gets included twice - once ascom_google_protobuf/src/google/protobuf/_virtual_imports/wrappers_proto/google/protobuf/wrappers.pb.cc
and another time ascom_google_protobuf/src/google/protobuf/wkt/google/protobuf/wrappers.pb.cc
error details:
https://source.cloud.google.com/results/invocations/87f26bb4-8652-484c-96a5-125bd2e15da7/targets/%2F%2Ftest%2Fcpp%2Futil:error_details_test@poller%3Depoll1/log
Looks like this could be a problem with protobuf's bazel build (TBH I don't understand where the file from under the
_virtual_imports
tree is coming from).The text was updated successfully, but these errors were encountered: