bazel should have better support of proxy
ATTENTION! Please read and follow:
- if this is a question about how to build / test / query / deploy using Bazel, ask it on StackOverflow instead: https://stackoverflow.com/questions/tagged/bazel
- if this is a discussion starter, send it to [email protected]
- if this is a bug or feature request, fill the form below as best as you can.
Description of the problem / feature request:
bazel doesn't read and configure properly when downloading maven and downloading go protos.
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
I can reproduce the problem by building kythe (http://kythe.io) bazel build //kythe/release
Our network is behind proxy so traffic has to go through proxy. Currently http download in bazel has good support, however, when bazel downloads from maven or download go protos, bazel fails because proxy is ignored.
What operating system are you running Bazel on?
Linux/Ubuntu
What's the output of bazel info release?
zwang@pony:~/src/kythe$ bazel info WARNING: ignoring http_proxy in environment. bazel-bin: /home/zwang/.cache/bazel/_bazel_zwang/005ad83881df469ea1906a265233a0e7/execroot/io_kythe/bazel-out/k8-fastbuild/bin bazel-genfiles: /home/zwang/.cache/bazel/_bazel_zwang/005ad83881df469ea1906a265233a0e7/execroot/io_kythe/bazel-out/k8-fastbuild/genfiles bazel-testlogs: /home/zwang/.cache/bazel/_bazel_zwang/005ad83881df469ea1906a265233a0e7/execroot/io_kythe/bazel-out/k8-fastbuild/testlogs character-encoding: file.encoding = ISO-8859-1, defaultCharset = ISO-8859-1 command_log: /home/zwang/.cache/bazel/_bazel_zwang/005ad83881df469ea1906a265233a0e7/command.log committed-heap-size: 2507MB execution_root: /home/zwang/.cache/bazel/_bazel_zwang/005ad83881df469ea1906a265233a0e7/execroot/io_kythe gc-count: 8 gc-time: 403ms install_base: /home/zwang/.cache/bazel/_bazel_zwang/install/6338e49942acfd59d75bbd9bec01f065 java-home: /usr/lib/jvm/java-8-openjdk-amd64/jre java-runtime: OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-0ubuntu0.16.04.2-b12) by Oracle Corporation java-vm: OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode) by Oracle Corporation max-heap-size: 28631MB message_log: /home/zwang/.cache/bazel/_bazel_zwang/005ad83881df469ea1906a265233a0e7/message.log output_base: /home/zwang/.cache/bazel/_bazel_zwang/005ad83881df469ea1906a265233a0e7 output_path: /home/zwang/.cache/bazel/_bazel_zwang/005ad83881df469ea1906a265233a0e7/execroot/io_kythe/bazel-out package_path: %workspace% release: release 0.11.1 server_pid: 47272 used-heap-size: 167MB
Have you found anything relevant by searching the web?
Yes, I did.
Any other information, logs, or outputs that you want to share?
I worked around these two problems by
- maven download problem in MavenDownloader.java RemoteRepository repository = new RemoteRepository.Builder(name, MavenServerValue.DEFAULT_ID, url) .setAuthentication(new MavenAuthentication(server))
-
.setProxy(proxy) // we should setup proxy .build();
- go proto download problem I'm not 100% understand this problem, seems bazel calls golang to use "git clone" download artifacts, and this process ignore local gitconfig. I worked around by adding git config --system http.proxy="my_proxy"
Seems (1) is an easy fix, I can contribute a small patch (2) is bit beyond my knowledge, bazel should have better idea and fix in the best way.
Thanks!
@cgrushko I believe you are now working on the maven rules?
@buchgr not really, but it might be I'm the closest to this now. Let's ask @dslomov if that's the case.
Getting the proxy settings right is part of proxy support. We still might need to do the work to use SSL root certificates which come from the user's machine rather than what we are shipped. This is often needed at sites that use MITM decrypting proxies (for example, financial institutions). This, of course, is a security problem in itself. The work on proxies should be combined with resolution for https://github.com/bazelbuild/bazel/issues/5741
Both issues should be gone now with Starlark git rules and https://github.com/bazelbuild/rules_jvm_external