Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure when HTTP_PROXY doesn't have a scheme #541

Closed
alexeagle opened this issue Mar 25, 2021 · 0 comments
Closed

Failure when HTTP_PROXY doesn't have a scheme #541

alexeagle opened this issue Mar 25, 2021 · 0 comments

Comments

@alexeagle
Copy link
Contributor

my env had HTTP_PROXY=localhost:8888

and then subsequent builds fail with

ERROR: Error fetching repository: Traceback (most recent call last):
	File "/private/var/tmp/_bazel_alex.eagle/03c50bd9f989d25b88a1be300d53820c/external/rules_jvm_external/coursier.bzl", line 513, column 24, in _pinned_coursier_fetch_impl
		_add_outdated_files(repository_ctx, artifacts, repositories)
	File "/private/var/tmp/_bazel_alex.eagle/03c50bd9f989d25b88a1be300d53820c/external/rules_jvm_external/coursier.bzl", line 331, column 58, in _add_outdated_files
		"{proxy_opts}": " ".join(_get_java_proxy_args(repository_ctx)),
	File "/private/var/tmp/_bazel_alex.eagle/03c50bd9f989d25b88a1be300d53820c/external/rules_jvm_external/coursier.bzl", line 167, column 31, in _get_java_proxy_args
		return get_java_proxy_args(http_proxy, https_proxy, no_proxy)
	File "/private/var/tmp/_bazel_alex.eagle/03c50bd9f989d25b88a1be300d53820c/external/rules_jvm_external/private/proxy.bzl", line 39, column 37, in get_java_proxy_args
		proxy_user = _get_proxy_user(http_proxy)
	File "/private/var/tmp/_bazel_alex.eagle/03c50bd9f989d25b88a1be300d53820c/external/rules_jvm_external/private/proxy.bzl", line 2, column 33, in _get_proxy_user
		netloc = url.split("://", 1)[1]
Error: index out of range (index is 1, but sequence has 1 elements)

All this split logic needs to handle the case of a URI with no scheme https://github.com/bazelbuild/rules_jvm_external/blob/master/private/proxy.bzl#L2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants