Bazel 在代理后面构建 [英] Bazel build behind proxy

查看:122
本文介绍了Bazel 在代理后面构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想按照 tensorflow 示例构建 generate_streaming_test_wav 以生成测试 wav.而我的 bazel 版本是 0.16.1.

I would like to follow tensorflow example to build generate_streaming_test_wav to generate test wav. And my bazel version is 0.16.1.

问题是当我使用命令 bazel run tensorflow/examples/speech_commands:generate_streaming_test_wav,出现如下错误信息:

The problem is when I use command bazel run tensorflow/examples/speech_commands:generate_streaming_test_wav , the following error message shown up:

xxx@xxx:~/kws/tensorflow-0911$ bazel run tensorflow/examples/speech_commands:generate_streaming_test_wav
Starting local Bazel server and connecting to it...
ERROR: error loading package '': Encountered error while reading extension file 'closure/defs.bzl': no such package '@io_bazel_rules_closure//closure': Error downloading [https://mirror.bazel.build/github.com/bazelbuild/rules_closure/archive/dbb96841cc0a5fb2664c37822803b06dab20c7d1.tar.gz, https://github.com/bazelbuild/rules_closure/archive/dbb96841cc0a5fb2664c37822803b06dab20c7d1.tar.gz] to /home/janet/.cache/bazel/_bazel_janet/2d14dc1ff5782da202e00efcc3cd86bc/external/io_bazel_rules_closure/dbb96841cc0a5fb2664c37822803b06dab20c7d1.tar.gz: All mirrors are down: []
ERROR: error loading package '': Encountered error while reading extension file 'closure/defs.bzl': no such package '@io_bazel_rules_closure//closure': Error downloading [https://mirror.bazel.build/github.com/bazelbuild/rules_closure/archive/dbb96841cc0a5fb2664c37822803b06dab20c7d1.tar.gz, https://github.com/bazelbuild/rules_closure/archive/dbb96841cc0a5fb2664c37822803b06dab20c7d1.tar.gz] to /home/janet/.cache/bazel/_bazel_janet/2d14dc1ff5782da202e00efcc3cd86bc/external/io_bazel_rules_closure/dbb96841cc0a5fb2664c37822803b06dab20c7d1.tar.gz: All mirrors are down: []
INFO: Elapsed time: 57.573s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
FAILED: Build did NOT complete successfully (0 packages loaded)

不过,我可以使用 wget 下载这两个包.1.https://mirror.bazel.build/github.com/bazelbuild/rules_closure/archive/dbb96841cc0a5fb2664c37822803b06dab20c7d1.tar.gz 2.https://github.com/bazelbuild/rules/archive/dbb96841cc0a5fb2664c37822803b06dab20c7d1.tar.gz我觉得我的网络应该没问题.我不知道为什么它不能下载这些文件.

However, I can use wget download those two packages. 1.https://mirror.bazel.build/github.com/bazelbuild/rules_closure/archive/dbb96841cc0a5fb2664c37822803b06dab20c7d1.tar.gz 2.https://github.com/bazelbuild/rules_closure/archive/dbb96841cc0a5fb2664c37822803b06dab20c7d1.tar.gz I think my network should be fine. I have no idea why it can't download those files.

任何想法或建议将不胜感激!

Any idea or suggestions would be very appreciated!

推荐答案

这可能是 Bazel 的存储库规则中的错误.如果您愿意提交错误,那就太好了!

This might be a bug in Bazel's repository rules. If you'd be so kind to file a bug, that'd be great!

作为一种解决方法,将下载的存档解压缩到某处,并将 WORKSPACE 文件中的 io_bazel_rules_closure 规则替换为指向该目录的 local_repository 规则您解压缩存档的位置.

As a workaround, extract the downloaded archive somewhere and replace the io_bazel_rules_closure rule in the WORKSPACE file with a local_repository rule pointing to the directory where you extracted the archive.

这篇关于Bazel 在代理后面构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆