[workspace] Patch rules_rust for Bazel 7 compatibility #21104
Merged
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.
The full extent of bazelbuild/rules_rust#2383 is not actually fixed, so we need to work around it here.
Towards #21103 and #21054.
The manual testing recipe here is
bazel test //... --config=lint
on Ubuntu when using Bazel 7.0. On master, it barfs an error about a BUILD file cycle[1]; with this PR, it passes.One good way to try that is to use
bazelisk.py test //... --config=lint
via bazelisk.py to use a temporary bazel version, by changing the.bazeliskrc
to point to 7.0.2 like we have in #21003.The intent behind landing this patch now (ahead of Drake's full Bazel 7 transition), is to make it easier to test out Bazel 7 in downstream CI, and to make any commit-revert war over #21103 as minimal as possible. The unprovisioned job in #21103 has evidence that Bazel 7 will be happy in CI.
[1]
This change is