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

[Feature Request] Bazel diff should honor external repos loaded in MODULE.bazel #255

Open
tgeng opened this issue Nov 15, 2024 · 2 comments

Comments

@tgeng
Copy link
Contributor

tgeng commented Nov 15, 2024

Currently, if one loads an http_archive from MODULE.bazel and reference things from the loaded in a target, the generated hash does not capture parameters of this http_archive. Using --fineGrainedHashExternalRepos flag can work around this issue. But it can get costly.

Under the hood this is because bazel query //external:all-targets at here does not return any repos loaded from MODULE.bazel. One way to get the modules from MODULE.bazel is to use bazel mod dump_repo_mapping followed by bazel mod show_repo @repo1 @repo2. However, currently show_repo does not support outputting machine parsable output (tracked by bazelbuild/bazel#21617).

This issue is just to track this feature. For now I can workaround the problem by feeding all the repos returned by bazel mod dump_repo_mapping to --fineGrainedHashExternalRepos to make this work.

@tgeng
Copy link
Contributor Author

tgeng commented Nov 15, 2024

I guess an alternative way to populate this would be reading MODULE.bazel.lock.

@tinder-maxwellelliott
Copy link
Collaborator

Thanks for writing this up!

Is the MODULE.bazel.lock parsable?

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