Skip to content

Support compiling in Windows \\?\ verbatim location #217

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

Closed
wants to merge 1 commit into from

Conversation

dtolnay
Copy link
Contributor

@dtolnay dtolnay commented Feb 17, 2025

This PR implements a workaround for rust-lang/cargo#13919.

See rust-lang/cargo#13919 (comment) and rust-lang/cargo#13919 (comment) of 2 different users reporting experiencing build errors in typenum.

error: couldn't read \\?\C:\myproj\rust\gui\gpuimg\target\debug\build\typenum-8c302cc9c705de15\out/op.rs: 文件名、目录名或卷标语法不正确。 (os error 123)
  --> C:\rust\cargo\registry\src\rsproxy.cn-0dccff568467c15b\typenum-1.17.0\src\lib.rs:72:5
   |
72 |     include!(concat!(env!("OUT_DIR"), "/op.rs"));
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
build\typenum-255e67d6ee89f566\out/op.rs: The filename, directory name, or volume label syntax is incorrect. (os error 123)
  --> src\lib.rs:72:5
   |
72 |     include!(concat!(env!("OUT_DIR"), "/op.rs"));
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: this error originates in the macro `include` (in Nightly builds, run with -Z macro-backtrace for more info)

Rustc 1.84 contains a mitigation for this (rust-lang/rust#125205) but is very recent (5 weeks old) compared to typenum's oldest supported compiler which is 1.37.

@paholg
Copy link
Owner

paholg commented Feb 17, 2025

Supporting these paths on various Windows setups has been quite the saga. It seems every time we fix it someone, it breaks for someone else.

It also looks like I need to address CI failing.

I think I'm at the point where it makes most sense to just generate these files locally and check them in; I'm not sure why I didn't start doing that long ago.

Thanks for the PR; let's keep it open for now, and merge if I don't end up getting to my alternate approach, though I plan to do that tonight.

@paholg paholg mentioned this pull request Feb 18, 2025
@paholg
Copy link
Owner

paholg commented Feb 18, 2025

Fixed in #219.

@paholg paholg closed this Feb 18, 2025
@dtolnay dtolnay deleted the verbatim branch February 18, 2025 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants