-
-
Notifications
You must be signed in to change notification settings - Fork 262
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
Using pest_derive
without std
under a workspace fails in Windows.
#996
Comments
I wonder why that would be: is it this https://superuser.com/questions/1069055/what-is-the-function-of-question-marks-in-file-system-paths-in-windows-registry ?
It could also be a bug in Cargo / Rust tooling in how it populates those env vars on Windows? |
Maybe a proper fix is to use something like normpath: wasmCloud/wasmCloud@8b876f1 ? |
or call canonicalize on |
I tried with canonicalize but it has the same problem, as soon as you enter relative path with the prefix "canonicalize" it simply does not find the file. And if the prefix is already there, it won't be removed. I also don't understand that if I create a simple project with a
|
@Shaddy did you manage to fix it? I tried to reproduce it and found that the issue is with the pest_bootstrap executable path:
but that's invoked by the Line 94 in 21287a9
|
Yes! I did the workaround I mention in the first comment, to just normalize the path (Shaddy@9ea1515) but in my case I kept the project local. I could try to reproduce this back if you want |
@Shaddy use normpath::PathExt;
//....
let pest = Path::new(concat!(
env!("CARGO_MANIFEST_DIR"),
"/../meta/src/grammar.pest"
)).normalize().expect("normalize path").into_path_buf(); and it didn't seem to help |
Describe the bug
I have a project that requires
no_std
, using following dependencies inCargo.toml
That fails to locate the bootstrap file under Windows, while in MacOS or Linux is working properly.
To Reproduce
NOTE: I can provide a project to reproduce the bug if necessary.
Expected behavior
pest_bootstrap.exe
not panicking trying to locate/meta/src/grammar.pest
Additional context
After debugging generated
pest_bootstrap.exe
I came to the conclusion that the problematic part is the path retrieved byenv!("CARGO_MANIFEST_DIR")
here:It seems to prepend
\\?\
to the Path, making it fail when trying to resolve the relative "../meta" path.I managed to fix this issue here:
Shaddy@9ea1515
But probably is not the best way to do it, it is just a workaround.
The text was updated successfully, but these errors were encountered: