Skip to content

Commit 382ae8d

Browse files
authored
Fix compatibility with rules_proto 7 (#30)
* Fix compatibility with rules_proto 7 * Apply buildifier fixes
1 parent 0ffd305 commit 382ae8d

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

examples/BUILD.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
load("@rules_go//proto:def.bzl", "go_proto_library")
12
load("@rules_proto//proto:defs.bzl", "proto_library")
23
load("@rules_python//python:proto.bzl", "py_proto_library")
3-
load("@rules_go//proto:def.bzl", "go_proto_library")
44

55
package(default_visibility = ["//visibility:public"])
66

examples/MODULE.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ register_toolchains("@toolchains_protoc_hub//:all")
2929
# - proto_lang_toolchain rule [name]
3030
# - toolchain rule [name]_toolchain
3131
# and the second one is valid for registration.
32-
# Attempting to register a proto_lang_toolchain rule as a toolchain gives a baffling error like
32+
# Attempting to register a proto_lang_toolchain rule as a toolchain gives a baffling error like
3333
# Misconfigured toolchains: //tools:protoc_java_toolchain is declared as a toolchain but has inappropriate dependencies.
3434
# Declared toolchains should be created with the 'toolchain' rule and should not have dependencies that themselves require toolchains.
3535
register_toolchains("//tools/toolchains:all")

examples/tools/toolchains/BUILD.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ define a cc toolchain that doesn't work, by using 'false' as the compiler.
55
See https://bazel.build/tutorials/ccp-toolchain-config
66
"""
77

8-
load("defs.bzl", "cc_toolchain_config")
98
load("@rules_proto//proto:defs.bzl", "proto_lang_toolchain")
9+
load("defs.bzl", "cc_toolchain_config")
1010

1111
# Configure protoc to have the right arguments for generating Python stubs.
1212
# NB: the protobuf team intends to remove --python_out and instead use a protoc plugin for Python stub emit.

protoc/private/prebuilt_protoc_toolchain.bzl

+4-3
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,15 @@ def _prebuilt_protoc_repo_impl(rctx):
4242
)
4343
build_content = """\
4444
# Generated by @rules_proto//proto/toolchains:prebuilt_protoc_toolchain.bzl
45-
load("@rules_proto//proto/private/rules:proto_toolchain_rule.bzl", "proto_toolchain")
4645
47-
package(default_visibility=["//visibility:public"])
46+
# This is a workaround for proto_toolchain not allowing to set visibility.
47+
package(default_visibility = ["//visibility:public"])
48+
49+
load("@rules_proto//proto:proto_toolchain.bzl", "proto_toolchain")
4850
4951
proto_toolchain(
5052
name = "prebuilt_protoc_toolchain",
5153
proto_compiler = "{protoc_label}",
52-
visibility = ["//visibility:public"],
5354
)
5455
""".format(
5556
protoc_label = ":bin/protoc.exe" if rctx.attr.platform.startswith("win") else ":bin/protoc",

0 commit comments

Comments
 (0)