Skip to content

Commit 9ef11b9

Browse files
authored
fix: restrict proto package visibility to private (#1117)
This is to prevent accidentally leaking targets that shouldn't be accessible. The `:python_toolchain` target is public because it's an implicit dependency of `py_proto_library`.
1 parent 25e4175 commit 9ef11b9

File tree

1 file changed

+4
-1
lines changed
  • python/private/proto

1 file changed

+4
-1
lines changed

python/private/proto/BUILD

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
1616
load("@rules_proto//proto:defs.bzl", "proto_lang_toolchain")
1717

18-
package(default_visibility = ["//visibility:public"])
18+
package(default_visibility = ["//visibility:private"])
1919

2020
licenses(["notice"])
2121

@@ -40,4 +40,7 @@ proto_lang_toolchain(
4040
command_line = "--python_out=%s",
4141
progress_message = "Generating Python proto_library %{label}",
4242
runtime = "@com_google_protobuf//:protobuf_python",
43+
# NOTE: This isn't *actually* public. It's an implicit dependency of py_proto_library,
44+
# so must be public so user usages of the rule can reference it.
45+
visibility = ["//visibility:public"],
4346
)

0 commit comments

Comments
 (0)