我正在尝试运行一个依赖于gRPC的简单程序。我尝试了几个示例,但仍然得到以下错误:
ERROR: /home/git/examples/WORKSPACE:1:1: name 'git_repository' is not defined
ERROR: Error evaluating WORKSPACE file
这是我的bazel版本:
➜ git:(master) ✗ bazel version
Build label: 0.23.2
下面是工作区文件的内容:
git_repository(
name = "com_github_grpc_grpc",
commit = "ac0808b107d73613191b66617a547a201871a845",
remote = "https://github.com/grpc/grpc.git",
)
load("@com_github_grpc_grpc//:bazel/grpc_deps.bzl", "grpc_deps")
grpc_deps()
bind(
name = "grpc_cpp_plugin",
actual = "@com_github_grpc_grpc//:grpc_cpp_plugin",
)
bind(
name = "grpc++_codegen_proto",
actual = "@com_github_grpc_grpc//:grpc++_codegen_proto",
)
任何帮助都将不胜感激!
发布于 2019-03-17 03:20:17
git_repository
不再是原生规则。您需要将其包含在WORKSPACE
的顶部,并使用:
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
https://stackoverflow.com/questions/55190124
复制相似问题