上层Bazel依赖性

时间:2019-08-06 18:57:33

标签: bazel

我遇到了Bazel无法解决python目标的上级依赖的问题。看起来就是这样。

我有一个名为//path/to/target1/target1-child:target1_object的目标,它依赖于//path/to/target2:target2_objective

//path/to/target1/target1-child:target1_objectpath/to/target1/target1-child/BUILD文件中定义为:

py_library(
    name = "target1_object",
    srcs = ["target1_object.py"],
    deps = [
        ...
        "//path/to/target2:target2_objective",
        requirement("..."),
    ],
)

//path/to/target2:target2_objectivepath/to/BUILD文件中定义为:

py_library(
    name = "target2",
    srcs = ["target2.py"],
    deps = [
        requirement("django"),
    ],
)

但是bazel build返回:

ERROR: Analysis of target '//path/to/target1/target1-child:target1_object'  
failed; build aborted: no such package 'path/to/target2': BUILD file not 
found on package path

但是目标已经正确定义。

使target2可以使用target1-child的正确方法是什么?

0 个答案:

没有答案