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

@rules_rust//:rustfmt tool fails on crates with generated sources #2254

Closed
UebelAndre opened this issue Nov 11, 2023 · 1 comment · Fixed by #2255
Closed

@rules_rust//:rustfmt tool fails on crates with generated sources #2254

UebelAndre opened this issue Nov 11, 2023 · 1 comment · Fixed by #2255

Comments

@UebelAndre
Copy link
Collaborator

UebelAndre commented Nov 11, 2023

Any target which has a generated module (source file) will cause rustfmt to fail. The following error is produced on #2255

~/Code/rules_rust (rustfmt ✗) bazel run //:rustfmt
INFO: Analyzed target //:rustfmt (1 packages loaded, 12 targets configured).
INFO: Found 1 target...
Target //tools/rustfmt:rustfmt up-to-date:
  bazel-bin/tools/rustfmt/rustfmt
INFO: Elapsed time: 0.463s, Critical Path: 0.37s
INFO: 5 processes: 1 internal, 4 darwin-sandbox.
INFO: Build completed successfully, 5 total actions
INFO: Running command line: bazel-bin/tools/rustfmt/rustfmt
 checking cached actions
 checking cached actions
 checking cached actions
 checking cached actions
 checking cached actions
Loading: 0 packages loaded
Loading: 181 packages loaded
Loading: 0 packages loaded
Loading: 4 packages loaded
Loading: 0 packages loaded
INFO: Empty results
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 26 packages loaded
Error writing files: failed to resolve mod `generated`: /Users/user/Code/rules_rust/test/rustfmt/srcs/generated/generated.rs does not exist
@UebelAndre
Copy link
Collaborator Author

rust-lang/rustfmt#5962 appears to be a relevant rustfmt issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant