-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix up Command Debug output when arg0 is specified. #67219
Conversation
r? @sfackler (rust_highfive has picked a reviewer for you, use r? to override) |
e16d731
to
06b7c24
Compare
eeb59e0
to
0c5e702
Compare
PR rust-lang#66512 added the ability to set argv[0] on Command. As a side effect, it changed the Debug output to print both the program and argv[0], which in practice results in stuttery output ("echo echo foo"). This PR reverts the behaviour to the the old one, so that the command is only printed once - unless arg0 has been set. In that case it emits "[command] arg0 arg1 ...".
0c5e702
to
ce56e75
Compare
@bors r+ |
📌 Commit ce56e75 has been approved by |
🌲 The tree is currently closed for pull requests below priority 100, this pull request will be tested once the tree is reopened |
…plett Fix up Command Debug output when arg0 is specified. PR rust-lang#66512 added the ability to set argv[0] on Command. As a side effect, it changed the Debug output to print both the program and argv[0], which in practice results in stuttery output (`"echo" "echo" "foo"`). This PR reverts the behaviour to the the old one, so that the command is only printed once - unless arg0 has been set. In that case it emits `"[command]" "arg0" "arg1" ...`.
…plett Fix up Command Debug output when arg0 is specified. PR rust-lang#66512 added the ability to set argv[0] on Command. As a side effect, it changed the Debug output to print both the program and argv[0], which in practice results in stuttery output (`"echo" "echo" "foo"`). This PR reverts the behaviour to the the old one, so that the command is only printed once - unless arg0 has been set. In that case it emits `"[command]" "arg0" "arg1" ...`.
Rollup of 7 pull requests Successful merges: - #66755 (Remove a const-if-hack in RawVec) - #67127 (Use structured suggestion for disambiguating method calls) - #67219 (Fix up Command Debug output when arg0 is specified.) - #67285 (Indicate origin of where type parameter for uninferred types ) - #67328 (Remove now-redundant range check on u128 -> f32 casts) - #67367 (Move command line option definitions into a dedicated file) - #67442 (Remove `SOCK_CLOEXEC` dummy variable on platforms that don't use it.) Failed merges: r? @ghost
I am nominating this for beta backport as it seems it's regressing some crates (i.e., this PR landed too late to fix beta as well). I tagged with T-compiler and T-libs; but I feel fairly confident that we just want to backport this. If T-compiler decides not to approve we'll want to ping T-libs as they don't generally notice otherwise I think. |
@Mark-Simulacrum Do any of them seem to be using the Debug output for real functionality, or is it just unit tests failing? |
AFAICT, just unit tests - though some are calling public functions, so a little unclear. The duplication of the executable though is somewhat annoying (and will affect other places, e.g. rustc output on failure to run linkers, I imagine). |
@rust-lang/libs -- this is nominated for beta backport, and T-compiler (likely correctly :) decided that they feel that libs team should approve this. @pnkfelix will also write up a comment hopefully with some thoughts in an hour or so. |
Oh yeah, I promised a note here. My instinct is that I wouldn't backport this PR, since it is inserting this new square-bracket delimted At the same time, there is a very real regression that should be addressed in some manner. So what I would advise (and I'm speaking with basically zero authority here, since I'm not really involved with any libs design, apart from at best the Before I started looking at this bug, I would have said that I believe our intent is that we are free to change Update: Also, to be clear: as I understand it, this change really shouldn't be breaking anyone, at least no one who isn't already making use of the (brand-new) functionality to modify |
Debug representations are subject to change at any time. |
To be clear, I consider the behavior on beta at least suboptimal (double printing the program), and plausibly a bug. Given instability of Debug, though, we may decide to not actually backport anything and merely note it in the release notes. |
The I see this as being a bugfix to the original PR and I think it would be best to backport it so that they both land together. Otherwise we'll end up with a release with a Debug output regression. |
I personally think it's fine to backport this, so I'm going to accept it. |
@alexcrichton What's the actual process for backporting? Should I submit a PR? |
I will be doing a beta backport rollup today or tomorrow probably and this'll get picked up since it's been approved, so no need to do anything further. |
[Beta] Backports I did not include #67134 and #67289 since they seem to be on beta already. * Fix up Command Debug output when arg0 is specified. #67219 * Do not ICE on unnamed future #67289 * Don't suppress move errors for union fields #67314 * Reenable static linking of libstdc++ on windows-gnu #67410 * Use the correct type for static qualifs #67621 * Treat extern statics just like statics in the "const pointer to static" representation #67630 * Do not ICE on lifetime error involving closures #67687
PR #66512 added the ability to set argv[0] on
Command. As a side effect, it changed the Debug output to print both the program and
argv[0], which in practice results in stuttery output (
"echo" "echo" "foo"
).This PR reverts the behaviour to the the old one, so that the command is only printed
once - unless arg0 has been set. In that case it emits
"[command]" "arg0" "arg1" ...
.