Skip to content

./x fmt --all is not idempotent #126394

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

Open
jieyouxu opened this issue Jun 13, 2024 · 2 comments
Open

./x fmt --all is not idempotent #126394

jieyouxu opened this issue Jun 13, 2024 · 2 comments
Labels
A-rustfmt Area: Rustfmt C-bug Category: This is a bug.

Comments

@jieyouxu
Copy link
Member

In the use formatting PR #125443 it was noticed that ./x fmt --all was not idempotent, i.e. ./x fmt --all had to be run twice to reproduce the formatted diff.

(I tried looking for an existing issue for this but couldn't find one.)

@jieyouxu jieyouxu added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) C-bug Category: This is a bug. labels Jun 13, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jun 13, 2024
@jieyouxu jieyouxu removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jun 13, 2024
@Kobzol
Copy link
Contributor

Kobzol commented Jun 14, 2024

This is not an issue of ./x fmt --all, but of rustfmt. It is not idempotent on this file.

Local repro:

$ ./build/x86_64-unknown-linux-gnu/rustfmt/bin/rustfmt --config-path ${PWD} --edition 2021 --unstable-features --skip-children library/std/src/os/fortanix_sgx/mod.rs
md5sum library/std/src/os/fortanix_sgx/mod.rs
afac84de68b9a8f072adee0b28d1a0d4  library/std/src/os/fortanix_sgx/mod.rs
$ ./build/x86_64-unknown-linux-gnu/rustfmt/bin/rustfmt --config-path ${PWD} --edition 2021 --unstable-features --skip-children library/std/src/os/fortanix_sgx/mod.rs
893f3e29999121b7efb0251662ded8f2  library/std/src/os/fortanix_sgx/mod.rs

@Kobzol
Copy link
Contributor

Kobzol commented Jun 14, 2024

Filed an issue in rustfmt: rust-lang/rustfmt#6195.

@Kobzol Kobzol added A-rustfmt Area: Rustfmt and removed T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustfmt Area: Rustfmt C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

3 participants