fix: rename rustfmt test modules to avoid case-insensitive path collisions#154639
fix: rename rustfmt test modules to avoid case-insensitive path collisions#154639cataggar wants to merge 1 commit intorust-lang:mainfrom
Conversation
…sions
Cloning the repo on Windows leads to this warning:
warning: the following paths have collided (e.g. case-sensitive paths
on a case-insensitive filesystem) and only one from the same
colliding group is in the working tree:
'src/tools/rustfmt/tests/source/reorder_modules/ABCD/mod.rs'
'src/tools/rustfmt/tests/source/reorder_modules/abcd/mod.rs'
'src/tools/rustfmt/tests/source/reorder_modules/ZYXW/mod.rs'
'src/tools/rustfmt/tests/source/reorder_modules/zyxw/mod.rs'
'src/tools/rustfmt/tests/target/reorder_modules/ABCD/mod.rs'
'src/tools/rustfmt/tests/target/reorder_modules/abcd/mod.rs'
'src/tools/rustfmt/tests/target/reorder_modules/ZYXW/mod.rs'
'src/tools/rustfmt/tests/target/reorder_modules/zyxw/mod.rs'
Rename the lowercase variants (abcd -> abcde, zyxw -> zyxwv) to avoid
case-insensitive collisions while preserving test intent.
|
Some changes occurred in src/tools/rustfmt cc @rust-lang/rustfmt |
|
r? @ytmimi rustbot has assigned @ytmimi. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
@cataggar these are great, thanks! I'd be happy to move forward with the change as is, but what I'm wondering is how we can prevent this from happening in the future? Maybe we could write a unit test to ensure that all files in |
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
@cataggar Oh actually I'm now realizing that this was opened in |
Summary
Cloning the rust repo on case-insensitive filesystems (e.g. Windows, macOS) produces a git warning about colliding paths:
Why they were named this way
These were added by @calebcartwright in
2d049af8f0e(rust-lang/rustfmt#6368) and brought into this repo via the rustfmt subtree update (#153145). TheABCD/abcdandZYXW/zyxwdirectories test case-sensitive module sorting — Edition ≤ 2021 usesstr::cmp(ASCII order) while Edition ≥ 2024 usesversion_sort. The collision on case-insensitive filesystems was not considered since development was on Linux.Fix
Rename the lowercase directory variants to avoid the collision:
abcd→abcdezyxw→zyxwvAll
mod abcd;/mod zyxw;declarations in the 10 affected test files are updated accordingly. This preserves the test intent (verifying case-sensitive module sorting across style editions) while eliminating the warning on case-insensitive filesystems.