8000 tools: run_cargo_fmt.sh: Don't run format on QEMU Rust code by alistair23 · Pull Request #3525 · tock/tock · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

tools: run_cargo_fmt.sh: Don't run format on QEMU Rust code #3525

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

Merged
merged 1 commit into from
Jun 29, 2023

Conversation

alistair23
Copy link
Contributor

Pull Request Overview

This fixes errors like this when running the Rust formatter

Formatting tools/qemu/subprojects/keycodemapdb/tests/rust-test`cargo metadata` exited with an error: error: current package believes it's in a workspace when it's not:
current:   /var/mnt/scratch/alistair/software/tock/tock/tools/qemu/subprojects/keycodemapdb/tests/rust-test/Cargo.toml
workspace: /var/mnt/scratch/alistair/software/tock/tock/tools/Cargo.toml

this may be fixable by adding `qemu/subprojects/keycodemapdb/tests/rust-test` to the `workspace.members` array of the manifest located at: /var/mnt/scratch/alistair/software/tock/tock/tools/Cargo.toml

Testing Strategy

make fmt with QEMU cloned locally

TODO or Help Wanted

Documentation Updated

  • Updated the relevant files in /docs, or no updates are required.

Formatting

  • Ran make prepush.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
@ppannuto ppannuto added this pull request to the merge queue Jun 29, 2023
@ppannuto ppannuto added the P-Upkeep This a relatively minor change, or one that is limited in scope, and requires less scrutiny. label Jun 29, 2023
@nbdd0121
Copy link
Contributor
nbdd0121 commented Jun 29, 2023

Just about to submit a similar PR and discovered this. My change was:

--- a/tools/run_cargo_fmt.sh
+++ b/tools/run_cargo_fmt.sh
@@ -60,7 +60,7 @@ csplit Cargo.toml '/exclude = \[/' > /dev/null
 rm xx01
 
 # Find folders with Cargo.toml files in them and run `cargo fmt`.
-for f in $(find . | grep Cargo.toml); do
+for f in $(find . -path ./tools/qemu -prune -o -name Cargo.toml -print); do
        if [ $f == './Cargo.toml' ]; then
                printf "\rFormatting Workspace"
                dir='.'

@ppannuto
Copy link
Member

AFAICT, both work. I'm always super-wary of find, as the stock mac (bsd) version often behaves differently; in this case that doesn't seem to be at issue though from a quick test. Still, I think what Alistair first wrote is fine for a quickie shell script

Merged via the queue into tock:master with commit bf8544e Jun 29, 2023
@alistair23 alistair23 deleted the alistair/fmt-fix branch June 29, 2023 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P-Upkeep This a relatively minor change, or one that is limited in scope, and requires less scrutiny.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0