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

Avoid downloading multiple resolvers #694

Merged
merged 1 commit into from
Apr 19, 2021

Conversation

illicitonion
Copy link
Collaborator

Instead, download just the one that's needed for the host platform.

Fixes #693

@google-cla google-cla bot added the cla: yes label Apr 19, 2021
@illicitonion illicitonion force-pushed the avoid-multi-downloads branch 2 times, most recently from 44bb5d0 to 812be9b Compare April 19, 2021 15:56
Instead, download just the one that's needed for the host platform.
Copy link
Collaborator

@UebelAndre UebelAndre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean each crate_universe repository will download it's own binary? I think this is a step forward but it might be worth having a second repository rule for downloading the resolver and have crate_universe proper depend on that.

I feel like this would be a pretty quick change, it's just moving the downloading logic into it's own rule. Your thoughts?

@illicitonion
Copy link
Collaborator Author

Does this mean each crate_universe repository will download it's own binary?

Ish - if you set the sha256, bazel should deduplicate the downloads. If you don't, it will probably perform multiple downloads.

it might be worth having a second repository rule for downloading the resolver and have crate_universe proper depend on that.

I feel like this would be a pretty quick change, it's just moving the downloading logic into it's own rule. Your thoughts?

I'd rather not invent a separate "avoid downloading the same file multiple times" mechanism, given the sha256 deduping is designed for that, but can add one if you think it'd be a big problem.

@UebelAndre
Copy link
Collaborator

Ish - if you set the sha256, bazel should deduplicate the downloads. If you don't, it will probably perform multiple downloads.

If Bazel will use a cached binary based on the sha256 value then that works for me 😄

I'd rather not invent a separate "avoid downloading the same file multiple times" mechanism, given the sha256 deduping is designed for that, but can add one if you think it'd be a big problem.

No, if there's an existing mechanism for doing this that's all I care about.

@UebelAndre UebelAndre merged commit ce29485 into bazelbuild:main Apr 19, 2021
@illicitonion illicitonion deleted the avoid-multi-downloads branch April 19, 2021 16:07
@UebelAndre
Copy link
Collaborator

Oh crap, this broke bootstrapping. Totally didn't think about that 😞

Can you add a followup PR to update the bootstrap script so users can easily iterate on changes?

@UebelAndre
Copy link
Collaborator

I opened #697 to track the over all plan for CI, but I had setup the bootstrapping to initially solve for this. I wanted to open a PR which runs the bootstrapping script as a shell_command when building examples/crate_universe which would have run as it's own job. Maybe that's a bad idea? We should continue this conversation on the issue I opened or some other one if we want to be more granular.

illicitonion added a commit to illicitonion/rules_rust that referenced this pull request Apr 20, 2021
UebelAndre pushed a commit that referenced this pull request Apr 20, 2021
yagehu pushed a commit to yagehu/rules_rust that referenced this pull request Apr 23, 2021
Instead, download just the one that's needed for the host platform.
yagehu pushed a commit to yagehu/rules_rust that referenced this pull request Apr 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

crate_universe currently downloads a resolver for every triple
2 participants