-
Notifications
You must be signed in to change notification settings - Fork 20
Add std::process::Output::exit_ok
#554
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
Comments
We discussed this in today's @rust-lang/libs-api meeting. The motivation of "give people an ergonomic way to do the right thing so that they don't use an ergonomic way to do the wrong thing" is compelling, and we're approving this ACP. In the comments of the method, please make it clear that it doesn't do anything to display stderr, so if you aren't inheriting stderr (and thus potentially letting the user see the stderr), you may want to do something more sophisticated than |
approved in ACP rust-lang/libs-team#554
approved in ACP rust-lang/libs-team#554
approved in ACP rust-lang/libs-team#554
…=tgross35 std: add Output::exit_ok approved in ACP rust-lang/libs-team#554 Tracking issue: rust-lang#84908
…=tgross35 std: add Output::exit_ok approved in ACP rust-lang/libs-team#554 Tracking issue: rust-lang#84908
…=tgross35 std: add Output::exit_ok approved in ACP rust-lang/libs-team#554 Tracking issue: rust-lang#84908
Rollup merge of rust-lang#139554 - lolbinarycat:std-output-exit_ok, r=tgross35 std: add Output::exit_ok approved in ACP rust-lang/libs-team#554 Tracking issue: rust-lang#84908
std: add Output::exit_ok approved in ACP rust-lang/libs-team#554 Tracking issue: rust-lang/rust#84908
std: add Output::exit_ok approved in ACP rust-lang/libs-team#554 Tracking issue: rust-lang/rust#84908
approved in ACP rust-lang/libs-team#554
…=tgross35 std: add Output::exit_ok approved in ACP rust-lang/libs-team#554 Tracking issue: rust-lang#84908
std: add Output::exit_ok approved in ACP rust-lang/libs-team#554 Tracking issue: rust-lang/rust#84908
Proposal
Problem statement
checking process exit statuses is not erganomic enough, even with the
exit_status_error
feature.Motivating examples or use cases
ExitStatus::exit_ok
cannot be called in a one-liner, so it is common to see slightly incorrect usages such asCommand::new("rustc").args(&["--print", "sysroot"]).output().stdout
, which will silently ignore any exit code.Solution sketch
This would be part of the existing
exit_status_error
feature gate. This would not replaceExitStatus::exit_ok
, as that type would still be useful for those who still want to process the commands output even if it is not successful.Alternatives
Links and related work
reqwest::Response::error_for_status
What happens now?
This issue contains an API change proposal (or ACP) and is part of the libs-api team feature lifecycle. Once this issue is filed, the libs-api team will review open proposals as capability becomes available. Current response times do not have a clear estimate, but may be up to several months.
Possible responses
The libs team may respond in various different ways. First, the team will consider the problem (this doesn't require any concrete solution or alternatives to have been proposed):
Second, if there's a concrete solution:
The text was updated successfully, but these errors were encountered: