Do not default to private visibility in rust_proto_library internal alias

PiperOrigin-RevId: 611607559
pull/16009/head
Marcel Hlopko 1 year ago committed by Copybara-Service
parent 7aac5538b4
commit 66ef7bc133
  1. 8
      rust/defs.bzl

@ -16,7 +16,7 @@ visibility([
"//rust/...", "//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. """Declares all the boilerplate needed to use Rust protobufs conveniently.
Hopefully no user will ever need to read this code. 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"): if not name.endswith("_rust_proto"):
fail("Name of each rust_proto_library target should end with `_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( native.alias(
name = name, name = name,
actual = select({ actual = select({
"//rust:use_upb_kernel": name + "_upb_kernel", "//rust:use_upb_kernel": name + "_upb_kernel",
"//conditions:default": name + "_cpp_kernel", "//conditions:default": name + "_cpp_kernel",
}), }),
visibility = visibility, **alias_args
) )
rust_upb_proto_library( rust_upb_proto_library(

Loading…
Cancel
Save