MODULE.bazel
module(
name = "proto_test"
)
bazel_dep(name = "grpc", version = "1.41.0", repo_name = "com_github_grpc_grpc")
BUILD:
load("@com_github_grpc_grpc//bazel:grpc_build_system.bzl", "grpc_proto_library")
grpc_proto_library(
name = "rpc_proto",
srcs = [
"rpc.proto"
],
use_external = True,
)
when I run command, error occurred, what should I do, thanks for any help!
bazel build :rpc_proto
ERROR: /tmp/BUILD:3:19: every rule of type _generate_cc implicitly depends upon the target '//external:protocol_compiler', but this target could not be found because of: no such target '//external:protocol_compiler': target 'protocol_compiler' not declared in package 'external' defined by /tmp/WORKSPACE (Tip: use `query "//external:*"` to see all the targets in that package)
gRPC does not support Bazel module builds at this time (1.41.0 is a really ancient version). You should setup the usual Bazel build and use more up-to-date gRPC version. Please consult this link: