-
Notifications
You must be signed in to change notification settings - Fork 446
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
Don't register rust_host_tools twice #3188
Merged
UebelAndre
merged 1 commit into
bazelbuild:main
from
hauserx:dont_register_rust_host_tools_twice
Jan 20, 2025
+0
−12
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this instead be called if no module defines
host_tools
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rules_rust's MODULE.bazel defines host tools already, so it will be always defined. Or I am missing something and it may not be defined in some other way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It just seems brittle to me for folks to be depending on the name of a particular dependency in rules_rust's
MODULE.bazel
file. That's why I tried to have the module extension itself always provide the repository and encode the consistent name.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for reference, without this change currently one gets following error if one does not specify host_tools tag:
I guess for bazel-lsp workaround would be simply to specify some host_tool with unique name (like
bazel_lsp_rust_host_tools
). Other solution would be in rules_rust's MODULE to change name to smthg likerules_rust_internal_host_tools
, which will require users to use some name, or roll back this change, but move this condition outside of loop as you mentioned.Wonder whether the best solution could be to expose those toolchain files directly in @rules_rust, like
@rules_rust//bin:cargo
, something similar as you can do with go by runningbazel run @io_bazel_rules_go//go
. This way it would use binaries for configured toolchain.