-
Notifications
You must be signed in to change notification settings - Fork 900
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
cargo fmt failing in Windows with MAX_PATH problem. can you add manifest with longPathAware? #5975
Comments
@kazuhiko-kikuchi thanks for reaching out. Any chance you can provide us with some more detail. What version of |
We use deep directory structure.
|
To aid investigation, the English version of this error message seems to be "The file name or extension is too long." |
@kazuhiko-kikuchi are you able to link to the project where you're trying to run |
@ytmimi This was actually found with rust-lang/miri#3317 recently as well. It is most likely unrelated to MAX_PATH. Though it possible for that to be an issue. The issue is the following:
Note that the miri repo currently has 897 Rust files. It looks like cargo-fmt is also susceptible to this issue as well. Lines 507 to 519 in 21f353a
I have a fix up for the miri tool, which batches rustfmt calls by argument length. Basically the "minimal" test case is:
Other OS's have limits as well, but they are much higher. It looks like rustc bootstrap got around it by only formatting a few files at a time in parallel to walking the repo directories. Interestingly this is actually a decent time to bring this up because it naturally leads to parallel formatting if done at the cargo-fmt level. |
I know cargo have longPathAware manifest now. |
Yeah, though cargo-fmt is a seperate binary. Since you have not provided a minimal reproducer there are potentially two different issues here:
They have the same error from Windows it is impossible to disambiguate them from the information provided. But both should be mitigated as they are both potential issues. |
sorry, I work on closed source repo. Can not to provide it. |
I'm experiencing this issue with the https://github.com/bevyengine/bevy repository. Running
This only occurs if the repository is in a directory whose path (including the trailing
|
longPathAware manifest item is documented here.
https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests#longPathAware
and embedding manifest resource in build, can be with embed-resource crate. https://crates.io/crates/embed-resource
The text was updated successfully, but these errors were encountered: