well_known_types is deprecated and suggests using :descriptor_proto_srcs, which does not exist
What version of protobuf and what language are you using? Version: v21.12 Language: Python
What did you do? Steps to reproduce the behavior:
- Try to build a thing that depends on
@com_google_proto//:well_known_typesafter updating to v21.12 - Get WARNING message
depends on deprecated target '@com_google_protobuf//:well_known_protos': Prefer :well_known_type_protos instead. - Look in BUILD.bazel to see that this "Prefer" is an incomplete message, and the full message in the comment says
# DEPRECATED: Prefer :well_known_type_protos for the Well-Known Types # (https://developers.google.com/protocol-buffers/docs/reference/google.protobuf) # or :descriptor_proto(_srcs) for descriptor.proto (source), or # :compiler_plugin_proto for compiler/plugin.proto. - Try using variations of those to no avail.
- Look in BUILD.bazel again, and see that there is no
:descriptor_proto_srcstarget (I see it in themainbranch, but not in 21.12)
What did you expect to see
Some option that will work in the context where deps=["@com_google_protobuf//:well_known_types"] previously worked, without a deprecation warning. With :descriptor_proto_srcs the problem is the missing target. With the other three options as deps, there is a lengthy error message that I am not confident doesn't include NDA information so cannot include here. It seems reasonably clear that the issue is not including srcs, since that's the only difference between deps=[":well_known_types"] and deps=[the three that exist].
What did you see instead? No combination of the suggested alternatives will build that target.
My current workaround is to simply patch out the deprecation tag and continue to use :well_known_types for now.