-
Notifications
You must be signed in to change notification settings - Fork 888
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
rustfmt crashes with ignore
on Windows
#6178
Comments
Thanks for the report. Linking the tracking issue for |
It's possible and we can find out when the next roll gets through into Chromium (probably next week it looks like). I don't know that this is a new/recent issue FWIW, it's the first time I tried to verify formatting would work on Windows. |
Below is a snippet of a Chromium-independent repro at the tip-of-the tree of
In particular:
I note that I think the paths should be normalized to remove the benign differences between the root vs child path syntax:
|
One way to avoid this crash is to modify
|
TestingI am not sure why this problem is not caught by I guess Windows-specific unit-testing Canonicalization open questionsIMO the main blocker is figuring out how/where to handle canonicalization errors:
|
This commit ensures that `fn config_path` in `rustfmt/src/config/mod.rs` always returns canonicalized paths. This is achieved by canonicalizing both: 1) paths received via `CliOptions` (after checking if the path exists) as well as 2) paths returned via `get_toml_path` (canonicalizing within `fn get_toml_path`). Fixes rust-lang#6178
It seems that paths of files being formatted are already being canonicalized in |
This commit ensures that `fn config_path` in `rustfmt/src/config/mod.rs` always returns canonicalized paths. This is achieved by canonicalizing both: 1) paths received via `CliOptions` (after checking if the path exists) as well as 2) paths returned via `get_toml_path` (canonicalizing within `fn get_toml_path`). Fixes rust-lang#6178
Using nightly rust:
My directory layout:
The
foo
directory is empty. The bug occurs with or without it being present. Theffi.rs
file is empty, its contents are not relevant.My
.rustfmt.toml
:Panic when running rustfmt:
There is no such problem on Linux.
The assertion failing is here: https://github.com/BurntSushi/ripgrep/blob/fe97c0a152cabc1bc07ec36b4b1e27cd230c3014/crates/ignore/src/gitignore.rs#L227
Chromium bug for cross-linking: https://crbug.com/40248903
The text was updated successfully, but these errors were encountered: