Skip to content

Commit

Permalink
Do not default to private visibility in rust_proto_library internal a…
Browse files Browse the repository at this point in the history
…lias

PiperOrigin-RevId: 611607559
  • Loading branch information
hlopko authored and copybara-github committed Feb 29, 2024
1 parent 7aac553 commit 66ef7bc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions rust/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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(
Expand Down

0 comments on commit 66ef7bc

Please sign in to comment.