bazel http_archive不处理WORKSPACE文件

时间:2019-06-10 15:00:30

标签: bazel

我有一个空项目,只有一个WORKSPCE文件,该文件正在加载containerregistry存储库:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "containerregistry",
    urls = ["https://github.com/google/containerregistry/archive/v0.0.36.zip"],
    strip_prefix = "containerregistry-0.0.36",
)

当我从containerregistry(bazel run @containerregistry//:puller.par -- --help here)的自述文件运行命令时,该命令失败了,因为bazel无法加载containerregistry所需的依赖项subpar。

如果我签出containerregistry存储库,然后运行bazel run :puller.par -- --help),它将按预期运行。

所以我的问题是http_archive是否将运行第三方库的WORKSPACE文件?如果没有,我该怎么做才能使用第三方目标?

我的bazel版本为0.25.3,并且bazel信息如下:

bazel-bin: /home/jenkins/.cache/bazel/_bazel_jenkins/df50e4fbdcf11307a31c00a96d9b7800/execroot/__main__/bazel-out/k8-fastbuild/bin
bazel-genfiles: /home/jenkins/.cache/bazel/_bazel_jenkins/df50e4fbdcf11307a31c00a96d9b7800/execroot/__main__/bazel-out/k8-fastbuild/bin
bazel-testlogs: /home/jenkins/.cache/bazel/_bazel_jenkins/df50e4fbdcf11307a31c00a96d9b7800/execroot/__main__/bazel-out/k8-fastbuild/testlogs
character-encoding: file.encoding = ISO-8859-1, defaultCharset = ISO-8859-1
command_log: /home/jenkins/.cache/bazel/_bazel_jenkins/df50e4fbdcf11307a31c00a96d9b7800/command.log
committed-heap-size: 160MB
execution_root: /home/jenkins/.cache/bazel/_bazel_jenkins/df50e4fbdcf11307a31c00a96d9b7800/execroot/__main__
gc-count: 36
gc-time: 1134ms
install_base: /home/jenkins/.cache/bazel/_bazel_jenkins/install/ca77b88f427d00f38348e68efd650f7d
java-home: /home/jenkins/.cache/bazel/_bazel_jenkins/install/ca77b88f427d00f38348e68efd650f7d/_embedded_binaries/embedded_tools/jdk
java-runtime: OpenJDK Runtime Environment (build 11.0.2+7-LTS) by Azul Systems, Inc.
java-vm: OpenJDK 64-Bit Server VM (build 11.0.2+7-LTS, mixed mode) by Azul Systems, Inc.
max-heap-size: 1860MB
output_base: /home/jenkins/.cache/bazel/_bazel_jenkins/df50e4fbdcf11307a31c00a96d9b7800
output_path: /home/jenkins/.cache/bazel/_bazel_jenkins/df50e4fbdcf11307a31c00a96d9b7800/execroot/__main__/bazel-out
package_path: %workspace%
release: release 0.25.3
repository_cache: /home/jenkins/.cache/bazel/_bazel_jenkins/cache/repos/v1
server_log: /home/jenkins/.cache/bazel/_bazel_jenkins/df50e4fbdcf11307a31c00a96d9b7800/java.log.izj6cezwhlhq4htg6eflvrz.jenkins.log.java.20190610-220143.28148
server_pid: 28148
used-heap-size: 30MB
workspace: /home/jenkins/workspace/test

错误是:

INFO: SHA256 (https://github.com/google/containerregistry/archive/v0.0.36.zip) = c675694b6a3b0a7f741ce53157eb6b35ef49e12f857ae12325f6636c9391aab6
DEBUG: Rule 'containerregistry' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "c675694b6a3b0a7f741ce53157eb6b35ef49e12f857ae12325f6636c9391aab6"
ERROR: Skipping '@containerregistry//:puller.par': error loading package '@containerregistry//': Unable to find package for @subpar//:subpar.bzl: The repository '@subpar' could not be resolved.
WARNING: Target pattern parsing failed.
ERROR: error loading package '@containerregistry//': Unable to find package for @subpar//:subpar.bzl: The repository '@subpar' could not be resolved.

0 个答案:

没有答案