Refactored the Rustfmt tool to work cross-platform#1375
Merged
UebelAndre merged 6 commits intobazelbuild:mainfrom Jun 10, 2022
Merged
Refactored the Rustfmt tool to work cross-platform#1375UebelAndre merged 6 commits intobazelbuild:mainfrom
UebelAndre merged 6 commits intobazelbuild:mainfrom
Conversation
Collaborator
Author
|
closes #872 |
dceeddc to
34b3cc2
Compare
Collaborator
Author
|
This change is blocked by: |
4a8f039 to
d0d6138
Compare
illicitonion
reviewed
Jun 9, 2022
Co-authored-by: Daniel Wagner-Hall <dawagner@gmail.com>
illicitonion
approved these changes
Jun 9, 2022
UebelAndre
commented
Jun 9, 2022
| ":src.rs", | ||
| ], | ||
| edition = "2018", | ||
| tags = ["norustfmt"], |
Collaborator
Author
There was a problem hiding this comment.
All the tagging here is to work around the following error when a target has a mix of local and generated source files.
Error writing files: failed to resolve mod `src`: /Users/user/Code/rules_rust/test/generated_inputs/src.rs does not exist
Error writing files: failed to resolve mod `src`: /Users/user/Code/rules_rust/test/generated_inputs/src.rs does not exist
Error writing files: failed to resolve mod `generated_in_different_cfg`: /Users/user/Code/rules_rust/test/generated_inputs/generated_in_different_cfg.rs does not exist
This error comes from rustfmt but given that the functionality for supporting generated sources in rules_rust is new, I'd rather try to account for this in a separate PR.
Collaborator
Author
|
@illicitonion would you be able to take one more look at this PR? |
Collaborator
Author
|
The query introduced here is susceptible to what I believe is a bug in how certain files are represented: |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This change updates the
@rules_rust//tools/rustfmttool to no longer rely on building and reading manifest files to determine what sources to query.bazel queryis expressive enough to request the list of source files that should be formatted.