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

tools fetched from upstream rust static repo even when override URL template is provided #867

Closed
wt opened this issue Jul 30, 2021 · 3 comments · Fixed by #874
Closed

tools fetched from upstream rust static repo even when override URL template is provided #867

wt opened this issue Jul 30, 2021 · 3 comments · Fixed by #874
Assignees

Comments

@wt
Copy link
Contributor

wt commented Jul 30, 2021

My WORKSPACE for the rules_rust looks like this:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

local_repository(
    name = "rules_rust",
    path = "/Users/wturkal/projects/rust/rules_rust",
)

load("@rules_rust//rust:repositories.bzl", "rust_repositories")

rust_repositories(
    version="1.54.0",
    urls=[
        "https://{internal_mirror_site}/generic-3rdparty-local/bazel/build-support/rust/toolchains/1.54.0/{}.tar.gz"
    ],
)

When running a build, it still fetches from the default rust upstream location (i.e. "https://static.rust-lang.org/..."). This happens because the urls provided in my workspace config are just appended to a list whose first entry is always the default site. See https://github.com/bazelbuild/rules_rust/blob/main/rust/private/repository_utils.bzl#L529-L535 for the relevant code.

I think that the code should only add the default location iff urls are not specified.

@illicitonion
Copy link
Collaborator

This sounds very reasonable - if people really want the current behaviour, it's easy for them to re-add the default value.

Can I tempt you to put together a PR?

Thanks!

@wt
Copy link
Contributor Author

wt commented Jul 30, 2021

You can. I am working on making sure I have appropriate permission from my company. We already have a corp CLA with you.

wt pushed a commit to wt/rules_rust that referenced this issue Aug 3, 2021
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
@wt
Copy link
Contributor Author

wt commented Aug 3, 2021

Permission granted. :)

wt pushed a commit to wt/rules_rust that referenced this issue Aug 3, 2021
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
illicitonion pushed a commit that referenced this issue Aug 3, 2021
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 #867
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

Successfully merging a pull request may close this issue.

2 participants