-
Notifications
You must be signed in to change notification settings - Fork 149
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
Quoted program names are not handled properly for CMD #613
Comments
I've opened tokio-rs/tokio#5810 to hopefully get |
As a workaround, I think use |
In general/when using watchexec as a binary, that would work, I believe. But for the tectonic use case (watchexec), that workaround would require preprocessing the arguments using something like |
Yeah, fair enough. If there's a workaround that can be done in the library code until the tokio support lands I'd be happy to merge it. |
CMD uses special handling for arguments to passed to /C. Unfortunately, causes errors with quoted program names in these arguments. This commit implements a workaround: When CMD is requested, we build a std::process::Command and pass the /C argument using the special std::os::windows::process::CommandExt::raw_arg method. The StdCommand is then converted to a TokioCommand and returned. Once tokio/tokio-rs#5810 is fixed, this workaround can be removed. Fixes watchexec#613
CMD uses special handling for arguments to passed to /C. Unfortunately, this causes errors with quoted program names in these arguments. This commit implements a workaround: When CMD is requested, we build a std::process::Command and pass the the argument to /C using the special std::os::windows::process::CommandExt::raw_arg method. The StdCommand is then converted to a TokioCommand and returned. Once tokio-rs/tokio#5810 is fixed, this workaround can be removed. Fixes watchexec#613
CMD uses special handling for arguments to passed to /C. Unfortunately, this causes errors with quoted program names in these arguments. This commit implements a workaround: When CMD is requested, we build a std::process::Command and pass the argument to /C using the special std::os::windows::process::CommandExt::raw_arg method. The StdCommand is then converted to a TokioCommand and returned. Once tokio-rs/tokio#5810 is fixed, this workaround can be removed. Fixes watchexec#613
watchexec 1.22.3 does not handle cmd quoting properly on Windows.
This came up when investigating tectonic-typesetting/tectonic#1003. See there for the actual command that caused the issue. However, the issue also reproduces with the watchexec binary:
I've attached the log file of that run.
After some digging, I found the
Command::raw_arg
method. The documentation suggests that this a known issue when passing arguments viacmd.exe /C
. On Windows, this match arm should probably be handled specially. Unfortunately,tokio
does not seem to have theraw_arg
method on itsCommand
, so this would probably require a conversion fromstd
'sCommand
.If you like, I can open a PR for this.
The text was updated successfully, but these errors were encountered: