跳过目标的特使问题

时间:2018-06-28 09:06:09

标签: bazel envoyproxy

特使:v1.7.0 以下规则

load("@envoy//bazel:repositories.bzl", "envoy_dependencies")
envoy_dependencies(repository="@envoy", skip_targets=["io_bazel_rules_go"])
local_repository(
    name = "io_bazel_rules_go",
    path = "/root/io_bazel_rules_go",
)

给我错误:

ERROR: xxx/WORKSPACE:47:1: unexpected keyword 'repository' in call to envoy_dependencies(path = "@envoy_deps//", skip_targets = [])
ERROR: Error evaluating WORKSPACE file
ERROR: error loading package '': Encountered error while reading extension file 'bazel/repositories.bzl': no such package '@envoy_api//bazel': error loading package 'external': Could not load //external package
ERROR: error loading package '': Encountered error while reading extension file 'bazel/repositories.bzl': no such package '@envoy_api//bazel': error loading package 'external': Could not load //external package
INFO: Elapsed time: 6.944s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)

任何有关如何跳过io_bazel_rules_go构建的输入都会很有用。

1 个答案:

答案 0 :(得分:0)

第一个错误消息是相关的,您可以忽略其他错误:

ERROR: xxx/WORKSPACE:47:1: unexpected keyword 'repository' in call to envoy_dependencies(path = "@envoy_deps//", skip_targets = [])

这告诉我们envoy_dependencies没有名为repository的属性,并且签名显示那里是path

您可以自己在规则的实现中进行检查:https://github.com/envoyproxy/envoy/blob/3f59fb5c0f6554f8b3f2e73ab4c1437a63d42668/bazel/repositories.bzl#L182