From 66ef7bc1330df93c760d52480582efeaed5fe11e Mon Sep 17 00:00:00 2001 From: Marcel Hlopko Date: Thu, 29 Feb 2024 15:02:53 -0800 Subject: [PATCH] Do not default to private visibility in rust_proto_library internal alias PiperOrigin-RevId: 611607559 --- rust/defs.bzl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rust/defs.bzl b/rust/defs.bzl index 544b18142f..25f8d3d086 100644 --- a/rust/defs.bzl +++ b/rust/defs.bzl @@ -16,7 +16,7 @@ visibility([ "//rust/...", ]) -def rust_proto_library(name, deps, visibility = [], **args): +def rust_proto_library(name, deps, **args): """Declares all the boilerplate needed to use Rust protobufs conveniently. Hopefully no user will ever need to read this code. @@ -29,13 +29,17 @@ def rust_proto_library(name, deps, visibility = [], **args): """ if not name.endswith("_rust_proto"): fail("Name of each rust_proto_library target should end with `_rust_proto`") + + alias_args = {} + if "visibility" in args: + alias_args["visibility"] = args.pop("visibility") native.alias( name = name, actual = select({ "//rust:use_upb_kernel": name + "_upb_kernel", "//conditions:default": name + "_cpp_kernel", }), - visibility = visibility, + **alias_args ) rust_upb_proto_library(