From abf333337fcfc167be1f4bc7ab0c6bb9775fbc5b Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 18 May 2022 20:46:58 -0700 Subject: [PATCH] [visibility] Give grpc_cli explicit visibility (#29717) * [visibility] Give grpc_cli explicit visibility * x * fix --- bazel/grpc_build_system.bzl | 7 +++++-- test/cpp/util/BUILD | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/bazel/grpc_build_system.bzl b/bazel/grpc_build_system.bzl index fac7f3d36f3..3d0ff5d7b22 100644 --- a/bazel/grpc_build_system.bzl +++ b/bazel/grpc_build_system.bzl @@ -77,7 +77,7 @@ def _update_visibility(visibility): if visibility == None: return None - # Visibility rules prefixed with '@grpc_' are used to flag different visibility rule + # Visibility rules prefixed with '@grpc:' are used to flag different visibility rule # classes upstream. PUBLIC = ["//visibility:public"] PRIVATE = ["//:__subpackages__"] @@ -89,6 +89,7 @@ def _update_visibility(visibility): "alts_frame_protector": PRIVATE, "channelz": PRIVATE, "client_channel": PRIVATE, + "cli": PRIVATE, "debug_location": PRIVATE, "endpoint_tests": PRIVATE, "grpclb": PRIVATE, @@ -407,7 +408,7 @@ def grpc_cc_test(name, srcs = [], deps = [], external_deps = [], args = [], data **test_args ) -def grpc_cc_binary(name, srcs = [], deps = [], external_deps = [], args = [], data = [], language = "C++", testonly = False, linkshared = False, linkopts = [], tags = [], features = []): +def grpc_cc_binary(name, srcs = [], deps = [], external_deps = [], args = [], data = [], language = "C++", testonly = False, linkshared = False, linkopts = [], tags = [], features = [], visibility = None): """Generates a cc_binary for use in the gRPC repo. Args: @@ -423,7 +424,9 @@ def grpc_cc_binary(name, srcs = [], deps = [], external_deps = [], args = [], da linkopts: linkopts to supply to the cc_binary. tags: Tags to apply to the target. features: features to be supplied to the cc_binary. + visibility: The visibility of the target. """ + visibility = _update_visibility(visibility) copts = [] if language.upper() == "C": copts = ["-std=c99"] diff --git a/test/cpp/util/BUILD b/test/cpp/util/BUILD index 9330f90df76..696abc3d292 100644 --- a/test/cpp/util/BUILD +++ b/test/cpp/util/BUILD @@ -313,6 +313,9 @@ grpc_cc_binary( external_deps = [ "absl/flags:flag", ], + visibility = [ + "@grpc:cli", + ], deps = [ ":grpc++_proto_reflection_desc_db", ":grpc_cli_libs",