protobuf icon indicating copy to clipboard operation
protobuf copied to clipboard

any_proto weirdness under Bazel 0.15 -c opt vs fastbuild

Open zrlk opened this issue 8 years ago • 3 comments

When I link in the any_proto target and build my executable with -c opt, at startup the program tries to add any.proto to the internal descriptor pool twice and fails. With the default configuration (fastbuild), it does not do this. I can't drop any_proto as a transitive dependency because I have other messages that require the definition of the Any message. What could be going wrong, and why would it differ between build configurations?

I've got an open issue in our project (https://github.com/google/kythe/issues/2834) with more details. The target I'm trying to fix is //kythe/cxx/common:path_utils_test

zrlk avatar Jul 13 '18 23:07 zrlk

It seems like the any proto is linked into the binary twice? Can you try to add a test in the protobuf code base to reproduce the issue?

xfxyjwf avatar Jul 16 '18 21:07 xfxyjwf

Yes, that's what it looks like. Why would this only happen with -c opt? It seems to affect any target that depends (transitively) on any_proto.

zrlk avatar Jul 16 '18 21:07 zrlk

Fixed by updating to protobuf 3.6.0. Further details in https://github.com/google/kythe/commit/27addcb0b06688d3b080486d57cab0459e9f0f06

zrlk avatar Jul 17 '18 21:07 zrlk