summaryrefslogtreecommitdiffhomepage
path: root/tools/bazeldefs
diff options
context:
space:
mode:
Diffstat (limited to 'tools/bazeldefs')
-rw-r--r--tools/bazeldefs/BUILD13
-rw-r--r--tools/bazeldefs/go.bzl5
2 files changed, 16 insertions, 2 deletions
diff --git a/tools/bazeldefs/BUILD b/tools/bazeldefs/BUILD
index c2c1287a1..24e6f8a94 100644
--- a/tools/bazeldefs/BUILD
+++ b/tools/bazeldefs/BUILD
@@ -1,6 +1,9 @@
-load("//tools:defs.bzl", "bzl_library")
+load("//tools:defs.bzl", "bzl_library", "go_proto_library")
-package(licenses = ["notice"])
+package(
+ default_visibility = ["//:sandbox"],
+ licenses = ["notice"],
+)
bzl_library(
name = "platforms_bzl",
@@ -45,3 +48,9 @@ genrule(
stamp = True,
visibility = ["//:sandbox"],
)
+
+go_proto_library(
+ name = "worker_protocol_go_proto",
+ importpath = "gvisor.dev/bazel/worker_protocol_go_proto",
+ proto = "@bazel_tools//src/main/protobuf:worker_protocol_proto",
+)
diff --git a/tools/bazeldefs/go.bzl b/tools/bazeldefs/go.bzl
index d16376032..da027846b 100644
--- a/tools/bazeldefs/go.bzl
+++ b/tools/bazeldefs/go.bzl
@@ -8,8 +8,13 @@ load("//tools/bazeldefs:defs.bzl", "select_arch", "select_system")
gazelle = _gazelle
go_embed_data = _go_embed_data
go_path = _go_path
+bazel_worker_proto = "//tools/bazeldefs:worker_protocol_go_proto"
def _go_proto_or_grpc_library(go_library_func, name, **kwargs):
+ if "importpath" in kwargs:
+ # If importpath is explicit, pass straight through.
+ go_library_func(name = name, **kwargs)
+ return
deps = [
dep.replace("_proto", "_go_proto")
for dep in (kwargs.pop("deps", []) or [])