Skip to content
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

Crash when using \\?\ style path on Windows #8626

Open
philip-peterson opened this issue Aug 17, 2020 · 1 comment
Open

Crash when using \\?\ style path on Windows #8626

philip-peterson opened this issue Aug 17, 2020 · 1 comment
Labels
C-bug Category: bug E-hard Experience: Hard O-windows OS: Windows S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

Comments

@philip-peterson
Copy link

Problem
Running a command, e.g. cargo metadata or cargo check with the --manifest-path set to equal an absolute Windows long-style path causes an error:

The filename, directory name, or volume label syntax is incorrect. (os error 123)

Steps

  1. Create a project anywhere and note its path. Let's pretend it's C:\Path
  2. Run a cargo command with mainfest-path set to that path as a long absolute path: cargo metadata --manifest-path \\?\C:\Path\Cargo.toml
  3. Note the failure.

Notes

Output of cargo version: cargo 1.47.0-nightly (ab32ee8 2020-08-10)

May be related to #7986, #7420, #7643

@philip-peterson philip-peterson added the C-bug Category: bug label Aug 17, 2020
@Eh2406 Eh2406 added the E-hard Experience: Hard label Aug 17, 2020
@Eh2406
Copy link
Contributor

Eh2406 commented Aug 17, 2020

For some related discussion see #6198. As I understand is that the operations on \\?\ as supposed to be pretty limited. Some apis are strict to only to the "allowed" things, some try to do something useful even if it is not technically "allowed". This leads to massively inconsistent apis everywhere including in STD. Bugs can be filed for each inconsistency, but each will be a long discussion from the competing goals. So fixing all the oddities even just in Cargo is going to be a herculean task. If you are volunteering, more power to you!

This case may only have a handful of places where Cargo interacts with that path. So getting --manifest-path to work may be doable.

@ehuss ehuss added the O-windows OS: Windows label Aug 19, 2020
Gankra added a commit to Gankra/uniffi-rs that referenced this issue Sep 16, 2020
Cargo has a tendency to mishandle \\?\ paths on windows.
See: rust-lang/cargo#8626

I was having trouble running `cargo build` on windows to check the generated
code, and this seems to fix the issue?
@weihanglo weihanglo added the S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted. label Jul 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug E-hard Experience: Hard O-windows OS: Windows S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
Projects
None yet
Development

No branches or pull requests

4 participants