-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
std::process::Command accepting arbitrary file extensions when env() specified #50870
Comments
I believe it's this chunk that does it: rust/src/libstd/sys/windows/process.rs Lines 144 to 160 in ba64edb
Specifically that |
Nevermind about
|
Duplicate of #37519. That chunk of code is very broken. |
It does sound perhaps that this can't be fixed because it's a long standing issue and would break backwards compatibility. Please close this if so. |
@AndrewGaspar it seems a shame to have something in the core standard library that is known broken for all perpetuity Are there any crates that implement a cross-platform std::process with the desired behaviour on Windows? I've been using which for some of this functionality, but I still have to pair it with a call to |
The problem with being unable to run other things isn't the extension but rather that The code in libstd definitely needs to be fixed though. I'll have to run some tests to determine how |
I just found a documentation about how file extensions work in Windows, and it might help since CMD finds the application to open a file with |
The issue in the OP has been fixed as a side-effect of #87704. So I think this issue can be closed. Supporting |
Closing as resolved. |
Description
On Windows,
std::process::Command
accepts arbitrary file extensions in place of the correct file extension (typically.exe
) for a command when at least one environment variable is specified (e.g.command.env("FOO", "BAR")
). The issue does not reproduce when no environment variables are specified.Rust Version
> rustc --version rustc 1.26.0 (a77568041 2018-05-07)
Minimum repro
Expected Result
Actual Result
Negative Reprodution
The following code snippet does NOT reproduce the issue.
The text was updated successfully, but these errors were encountered: