Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Bazel's NO_PROXY doesn't work while setting HTTP_PROXY or HTTPS_PROXY #6400
Description of the problem / feature request:
I want to use bazel to build a go project using rules_go, I have some external packages in my
However, if I set the HTTP_PROXY, HTTPS_PROXY and NO_PROXY and execute
The interesting thing is that if I execute the command above directly in the terminal, it can be successfully executed and fetch the packages in the relative directory.
And if I unset HTTP_PROXY and HTTPS_PROXY, I can successfully fetch the internal packages by using bazel.
Feature requests: what underlying problem are you trying to solve with this feature?
I notice that while I set HTTP_PROXY, bazel will show a log about
I try to find it in the sources and discover that it seems bazel will set NO_PROXY directly to
However, using the bazel built by myself, it also not worked for me to respect NO_PROXY. It cannot fetch the internal packages yet. I also try to reference #4307 and #4299, but it seems not a solution for my problem.
What operating system are you running Bazel on?
I use bazel 0.17.2 in ubuntu 18.04 and 16.04, both have the same bug
What's the output of
It seems that it's the problem of bazel-gazelle, bazel-gazelle doesn't add NO_PROXY into it's fetcher, it only add HTTP_PROXY and HTTPS_PROXY. After add NO_PROXY into bazel-gazelle, it can successfully work.
referenced this issue
Feb 1, 2019
The correct fix for this is to use gRPC's grpc.enable_http_proxy channel argument. We should not be munging no_proxy/NO_PROXY env variables at all.
I have a commit ready internally which fixes it, but it's pending on updating the gRPC version bundled with Bazel (issue #2804). Stay tuned!