我尝试在Ubuntu上使用bazel(0.13.0rc2和0.20)构建gerrit。我的公司使用需要身份验证的代理。设置了环境变量http_proxy和https_proxy(以及其他工具,如wget,maven,... work),但是bazel报告“需要HTTP / 1.0 407代理身份验证”错误:
$ bazel build gerrit
WARNING: ignoring http_proxy in environment.
ERROR: error loading package '': Encountered error while reading extension file 'closure/defs.bzl': no such package '@io_bazel_rules_closure//closure': Error downloading [https://github.com/bazelbuild/rules_closure/archive/08039ba8ca59f64248bb3b6ae016460fe9c9914f.tar.gz] to /home/xxxxxx/.cache/bazel/_bazel_xxxxxx/5fb8c741228852f6bc57df1fc04917a8/external/io_bazel_rules_closure/08039ba8ca59f64248bb3b6ae016460fe9c9914f.tar.gz: Unable to tunnel through proxy. Proxy returns "HTTP/1.0 407 Proxy Authentication Required"
欢迎任何建议!
答案 0 :(得分:0)
如果其他人有类似的问题:
经过一段时间的搜索和e。 G。试图指定环境变量HTTP_PROXY和HTTPS_PROXY(另见bazel issue #587)我找到了this discussion并使用gerritforge / jenkins-slave-bazel进行构建(也为docker配置了代理):
# use docker the docker container gerritforge/jenkins-slave-bazel to build gerrit
$ docker run --privileged -ti --entrypoint=bash --user jenkins gerritforge/jenkins-slave-bazel
$ cd && git clone --recursive https://gerrit.googlesource.com/gerrit
$ cd gerrit && bazel build gerrit
至少解决了bazel代理问题。