-
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
Windows Command: Don't run batch files using verbatim paths #95246
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
This is also a first step toward #94743. Rust no longer relies on the undocumented behaviour of I also want to eventually do further refactoring of argument building. Given the growing number of options, a builder struct may be more appropriate. But I don't want to do that all in one PR. EDIT: Oh and this PR lays the ground work for users being able to set |
a5f6ce3
to
924790b
Compare
924790b
to
34184f3
Compare
This comment has been minimized.
This comment has been minimized.
34184f3
to
34fcf11
Compare
LGTM, r=me with the message nit fixed. |
And also fix typo.
34fcf11
to
7200afa
Compare
@bors r+ |
📌 Commit 7200afa has been approved by |
⌛ Testing commit 7200afa with merge b1651f12488d9ae50ccab10fce5c90e92a938d40... |
💔 Test failed - checks-actions |
This comment has been minimized.
This comment has been minimized.
Hm, the failure is caused by https://github.com/rust-lang/rust/blob/master/src/test/ui-fulldeps/issue-15149.rs. |
Oh, looks like my format-on-save has been to work on that file. The actual changes are lines 8, 22 and 23. |
@bors r+ |
📌 Commit 4a0ec50 has been approved by |
☀️ Test successful - checks-actions |
Finished benchmarking commit (756ffb8): comparison url. Summary:
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression Footnotes |
hi @ChrisDenton . I'm writing some rust code that needs afaict at least the daviddeley.com link and the mention of shell32 are therefor out-of-date and/or wrong. I'll probably still reimplement it for my project...(it just makes sense for me to not implicitly depend on windows |
hi @shuffle2, thanks for the comment! I'm aware that the ucrt source is available but I've avoided looking at it because I'm unclear if that would cause licensing issues. I'm not a lawyer and haven't hired one so I've taken the cautious approach as I don't want to cause problems for the Rust project in the future. For now I'm going on public information and my own experimentation. If anyone wanted to write a more accurate description then that would be very welcome! |
[continuing this conversion here... :)] after looking at stuff a bit more, I realized that rust executables are already linking against and executing this code in ucrt. If you dynamic link against crt it's obvious by looking for imports from "api-ms-win-crt-*" libraries (these all get routed to ucrtbase.dll under the hood). In either case (dynamic or static link against crt), the function So, this created more questions than answers unfortunately:
|
The standard library does not decide on the program's entry point. That's the job of the Rust compiler. If you think it should instead use
MSVC Rust needs the vcruntime for mem* functions and C++ exceptions. This in turn depends on having a crt. Rust also uses the C runtime for process startup/shutdown code and running pre-main initializers. So yes, it's "knowingly" linking against ucrt but it's incidental and could even change in the future (e.g. if we decide to reimplement the needed bits in pure Rust for some reason). MinGW Rust does not link against the UCRT and so that toolchain will have different parsing rules. There can also be third-party toolchains that do their own thing (or skip arguments entirely). And even MSVC allows changing or disabling the parsing using special object files. It may be surprising if |
Sure, I was mostly surprised that ucrt is involved at all - assumed it would be completely replaced, if replaced at all.
yes well, I stalked the git blame and picked someone who had modified the code recently :D I'm not really sure where is a good forum for this topic - I checked discord and zulip and they seem unrelated and/or inactive. If just filing a github issue is the way, then I'll do that (eventually). Thanks! |
Zulip would also be a great place to ask. Many people involved with Rust (both compiler and libs) are active there. In general closed PRs are somewhat "hidden" because few people will notice new comments. |
Fixes #95178
Note that the first commit does some minor refactoring (moving command line argument building to args.rs). The actual changes are in the second.