-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
show-env doesn't work in PowerShell #395
Comments
We do not guarantee output in any particular shell-compatible format except for --export-prefix (which is for the UNIX shell), so I think the solution here is to add a flag for PowerShell equivalent to --export-prefix. |
Hi @taiki-e I want to take a look at this issue this weekend, probably by adding a new option like |
Main related files are cli.rs, which parses the flags, and ShowEnvWriter in main.rs, which does the actual output. A search of the existing code with |
I tried to add an option that prepends Take one variable as example
For PowerShell to read it, the path also needs to be double-quote escaped.
|
I guess you can use Line 164 in b7e5eb5
|
What's the issue
cargo llvm-cov show-env
would print non-printable characters (0x1f
ASCII Unit Separator), and PowerShell can't handle them.For example
I am building a DLL on Windows that needs to follow Get coverage of external tests.
And I am using below PowerShell script to set the env variable
If I ran this script and check
$env:CARGO_ENCODED_RUSTFLAGS
, I would getIf I directly run
cargo llvm-cov show-env
, I would getThe ▼ is supposed to be
0x1f
ASCII Unit Separator, as indicated by cargo doc here(search for CARGO_ENCODED_RUSTFLAGS). But according to this stackoverflow answer, PowerShell can't handle binary dataThe text was updated successfully, but these errors were encountered: