protobuf icon indicating copy to clipboard operation
protobuf copied to clipboard

well_known_types is deprecated and suggests using :descriptor_proto_srcs, which does not exist

Open ravenblackx opened this issue 3 years ago • 0 comments

What version of protobuf and what language are you using? Version: v21.12 Language: Python

What did you do? Steps to reproduce the behavior:

  1. Try to build a thing that depends on @com_google_proto//:well_known_types after updating to v21.12
  2. Get WARNING message depends on deprecated target '@com_google_protobuf//:well_known_protos': Prefer :well_known_type_protos instead.
  3. 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.
    
  4. Try using variations of those to no avail.
  5. Look in BUILD.bazel again, and see that there is no :descriptor_proto_srcs target (I see it in the main branch, 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.

ravenblackx avatar Dec 29 '22 22:12 ravenblackx