Commit 11bdf92
authored
fix(bazel): allow CustomProtoInfo in gapic_compat_proto_library (#18417)
In #17882
gapic_compat_proto_library was introduced to wrap srcs passed to
py_gapic_library and adapt modern @rules_proto StarlarkProtoInfo
(ProtoInfo) targets into CustomProtoInfo expected by
@rules_gapic//:gapic.bzl's proto_custom_library.
However, several targets pass `srcs = [":<api>_proto_with_info"]` (a
proto_library_with_info rule from @rules_gapic//:gapic.bzl which returns
CustomProtoInfo rather than StarlarkProtoInfo). Because
gapic_compat_proto_library strictly mandated `providers =
[StarlarkProtoInfo]`, Bazel analysis failed on those targets with:
`'<target>_proto_with_info' does not have mandatory providers:
'ProtoInfo'`.
Updated gapic_compat_proto_library_impl to check if CustomProtoInfo in
dep: and return [dep[DefaultInfo], dep[CustomProtoInfo]] directly
without re-wrapping.
Updated gapic_compat_proto_library attrs["dep"] to accept either
provider: providers = [[StarlarkProtoInfo], [CustomProtoInfo]].
Tested against several afflicted targets in googleapis manually and
running entire workspace presubmit in cl/983453303.
Fixes regression blocking b/559815865.1 parent 773373e commit 11bdf92
1 file changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
28 | 33 | | |
29 | 34 | | |
30 | 35 | | |
| |||
41 | 46 | | |
42 | 47 | | |
43 | 48 | | |
44 | | - | |
| 49 | + | |
45 | 50 | | |
46 | 51 | | |
47 | 52 | | |
| |||
0 commit comments