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

Do not download non-local binaries #12

Closed
wants to merge 8 commits into from

Conversation

mark-thm
Copy link
Contributor

@mark-thm mark-thm commented Mar 6, 2024

Today, we download all the declared binaries in our lockfile. This can be slow/expensive.

After this PR, we skip downloading any binary that doesn't match the local machine's OS or CPU. We're not users of remote execution, and it's not clear if/how this affects remote execution. If it negatively affects RBE, we can always drop this functionality behind a flag on our repository rules.

rahul-theorem
rahul-theorem previously approved these changes Mar 6, 2024
Copy link

@rahul-theorem rahul-theorem left a comment

Choose a reason for hiding this comment

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

Seems reasonable

@alexeagle
Copy link
Contributor

The way Bazel is meant for this to work (and works with remote execution as well) is via toolchain resolution.

See https://github.com/aspect-build/rules_py/blob/main/py/private/toolchain/repo.bzl as an example: the "hub" repo just registers a bunch of toolchain() calls. the toolchain attribute points to a platform-specific repo where the tool is downloaded. This way bazel only fetches the ones for the toolchains it selected.

@mark-thm
Copy link
Contributor Author

mark-thm commented Mar 7, 2024

Still not sure I follow how to defer downloads in a repository rule — it seems like even if I create a repository for each of the platforms for each of the tools that I’m going to end up needing a download call in that rule, which ends up largely the same?

@mark-thm mark-thm closed this Mar 7, 2024
@mark-thm mark-thm deleted the me/only-download-local-bins branch March 7, 2024 03:49
@alexeagle
Copy link
Contributor

I'll try to send the PR for this :)

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 this pull request may close these issues.

None yet

3 participants