Skip to content

Commit

Permalink
Make url overrides for downloading toolchains work.
Browse files Browse the repository at this point in the history
Previously, the default url template for downloading toolchains
was always present as the first place to download tools from. This
prevents overriding the default location for the tools so that an
internal mirror can be used.

Fixes bazelbuild#867
  • Loading branch information
Wren Turkal committed Aug 2, 2021
1 parent c2f5701 commit 5c4c651
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions rust/private/repository_utils.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,7 @@ def load_arbitrary_tool(ctx, tool_name, tool_subdirectories, version, iso_date,
# View the indices mentioned in the docstring to find the tool_suburl for a given
# tool.
tool_suburl = produce_tool_suburl(tool_name, target_triple, version, iso_date)
static_rust = ctx.os.environ.get("STATIC_RUST_URL", "https://static.rust-lang.org")
urls = ["{}/dist/{}.tar.gz".format(static_rust, tool_suburl)]
urls = []

for url in getattr(ctx.attr, "urls", DEFAULT_STATIC_RUST_URL_TEMPLATES):
new_url = url.format(tool_suburl)
Expand Down

0 comments on commit 5c4c651

Please sign in to comment.