Make UpbWrappedGeneratedSrcsInfo private.

It is not actually needed by other Bazel rules.

PiperOrigin-RevId: 504993976
pull/13171/head
Joshua Haberman 2 years ago committed by Copybara-Service
parent b29761fece
commit ceba58d6e7
  1. 14
      bazel/upb_proto_library.bzl
  2. 9
      protos/bazel/upb_cc_proto_library.bzl

@ -198,7 +198,7 @@ GeneratedSrcsInfo = provider(
UpbWrappedCcInfo = provider("Provider for cc_info for protos", fields = ["cc_info"])
_UpbDefsWrappedCcInfo = provider("Provider for cc_info for protos", fields = ["cc_info"])
UpbWrappedGeneratedSrcsInfo = provider("Provider for generated sources", fields = ["srcs"])
_UpbWrappedGeneratedSrcsInfo = provider("Provider for generated sources", fields = ["srcs"])
_WrappedDefsGeneratedSrcsInfo = provider(
"Provider for generated reflective sources",
fields = ["srcs"],
@ -248,10 +248,10 @@ def _upb_proto_rule_impl(ctx):
if _WrappedDefsGeneratedSrcsInfo in dep:
srcs = dep[_WrappedDefsGeneratedSrcsInfo].srcs
elif UpbWrappedGeneratedSrcsInfo in dep:
srcs = dep[UpbWrappedGeneratedSrcsInfo].srcs
elif _UpbWrappedGeneratedSrcsInfo in dep:
srcs = dep[_UpbWrappedGeneratedSrcsInfo].srcs
else:
fail("proto_library rule must generate UpbWrappedGeneratedSrcsInfo or " +
fail("proto_library rule must generate _UpbWrappedGeneratedSrcsInfo or " +
"_WrappedDefsGeneratedSrcsInfo (aspect should have handled this).")
if _UpbDefsWrappedCcInfo in dep:
@ -297,7 +297,7 @@ def _upb_proto_aspect_impl(target, ctx, generator, cc_provider, file_provider):
return [cc_provider(cc_info = cc_info), file_provider(srcs = files)]
def upb_proto_library_aspect_impl(target, ctx):
return _upb_proto_aspect_impl(target, ctx, "upb", UpbWrappedCcInfo, UpbWrappedGeneratedSrcsInfo)
return _upb_proto_aspect_impl(target, ctx, "upb", UpbWrappedCcInfo, _UpbWrappedGeneratedSrcsInfo)
def _upb_proto_reflection_library_aspect_impl(target, ctx):
return _upb_proto_aspect_impl(target, ctx, "upbdefs", _UpbDefsWrappedCcInfo, _WrappedDefsGeneratedSrcsInfo)
@ -339,7 +339,7 @@ upb_proto_library_aspect = aspect(
implementation = upb_proto_library_aspect_impl,
provides = [
UpbWrappedCcInfo,
UpbWrappedGeneratedSrcsInfo,
_UpbWrappedGeneratedSrcsInfo,
],
attr_aspects = ["deps"],
fragments = ["cpp"],
@ -392,7 +392,7 @@ _upb_proto_reflection_library_aspect = aspect(
],
required_aspect_providers = [
UpbWrappedCcInfo,
UpbWrappedGeneratedSrcsInfo,
_UpbWrappedGeneratedSrcsInfo,
],
attr_aspects = ["deps"],
fragments = ["cpp"],

@ -28,7 +28,7 @@
"""
load("@bazel_skylib//lib:paths.bzl", "paths")
load("//bazel:upb_proto_library.bzl", "GeneratedSrcsInfo", "UpbWrappedCcInfo", "UpbWrappedGeneratedSrcsInfo", "upb_proto_library_aspect")
load("//bazel:upb_proto_library.bzl", "GeneratedSrcsInfo", "UpbWrappedCcInfo", "upb_proto_library_aspect")
# begin:google_only
# load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain", "use_cpp_toolchain")
@ -204,11 +204,9 @@ def _upb_cc_proto_rule_impl(ctx):
if _WrappedCcGeneratedSrcsInfo in dep:
srcs = dep[_WrappedCcGeneratedSrcsInfo].srcs
elif UpbWrappedGeneratedSrcsInfo in dep:
srcs = dep[UpbWrappedGeneratedSrcsInfo].srcs
else:
fail("proto_library rule must generate UpbWrappedGeneratedSrcsInfo or " +
"_WrappedCcGeneratedSrcsInfo (aspect should have handled this).")
fail("proto_library rule must generate _WrappedCcGeneratedSrcsInfo (aspect should have " +
"handled this).")
if _UpbCcWrappedCcInfo in dep:
cc_info = dep[_UpbCcWrappedCcInfo].cc_info
@ -298,7 +296,6 @@ _upb_cc_proto_library_aspect = aspect(
],
required_aspect_providers = [
UpbWrappedCcInfo,
UpbWrappedGeneratedSrcsInfo,
],
attr_aspects = ["deps"],
fragments = ["cpp"],

Loading…
Cancel
Save