From ceba58d6e74d33ab9617e3cd8518c40b579799de Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Thu, 26 Jan 2023 18:35:17 -0800 Subject: [PATCH] Make UpbWrappedGeneratedSrcsInfo private. It is not actually needed by other Bazel rules. PiperOrigin-RevId: 504993976 --- bazel/upb_proto_library.bzl | 14 +++++++------- protos/bazel/upb_cc_proto_library.bzl | 9 +++------ 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/bazel/upb_proto_library.bzl b/bazel/upb_proto_library.bzl index b9fd121d85..b1eb3eb48d 100644 --- a/bazel/upb_proto_library.bzl +++ b/bazel/upb_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"], diff --git a/protos/bazel/upb_cc_proto_library.bzl b/protos/bazel/upb_cc_proto_library.bzl index 555d01419a..8fad95abc6 100644 --- a/protos/bazel/upb_cc_proto_library.bzl +++ b/protos/bazel/upb_cc_proto_library.bzl @@ -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"],