Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bazel build behind proxy

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.

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)

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!

like image 998
Jean Lin Avatar asked Jun 14 '26 18:06

Jean Lin


1 Answers

If you know your proxy server, you should be able to set:

export HTTPS_PROXY=http://me:[email protected]:myport
export HTTP_PROXY=http://me:[email protected]:myport

and run the bazel build again.

If you don't know the proxy server used by wget check /etc/wgetrc or ~/.wgetrc

I've seen conflicting statements about HTTPS_PROXY and HTTP_PROXY being uppercase and lowercase, so you might try setting both. (Some have used unset to remove the lowercase settings. See: https://github.com/bazelbuild/bazel/issues/587#issuecomment-412531604)

like image 183
William D. Irons Avatar answered Jun 17 '26 21:06

William D. Irons



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!