rules_proto_grpc icon indicating copy to clipboard operation
rules_proto_grpc copied to clipboard

Fix wrong toolchains label in Custom Plugins document

Open Ginakira opened this issue 1 year ago • 0 comments

Version: v4.6.0 In custom plugin, if I defined toolchain attribute as @rules_proto_grpc//protoc:toolchain_type in proto compile rule just same as document:

# Create compile rule
example_compile = rule(
    implementation = proto_compile_impl,
    attrs = dict(
       ...
    ),
    toolchains = [str(Label("@rules_proto_grpc//protoc:toolchain_type"))],
)

It has error when build:

(11:16:43) ERROR: /.../BUILD:29:20: While resolving toolchains for target //foo_protoc:foo_proto: com.google.devtools.build.lib.packages.BuildFileNotFoundException: no such package '@rules_proto_grpc//protoc': BUILD file not found in directory 'protoc' of external repository @rules_proto_grpc. Add a BUILD file to a directory to mark it as a package.

Replace it to @rules_proto_grpc//protobuf:toolchain_type will resolve this problem. And I found there is no folder named protoc under the <bazel_cache_dir>/external/rules_proto_grpc.

Maybe code of the document is outdated. Please review this pull request, thanks!

Ginakira avatar Jun 13 '24 03:06 Ginakira