Skip to content
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

Add an abstraction to std::io::process for dealing with error gracefully #10669

Closed
emberian opened this issue Nov 26, 2013 · 5 comments
Closed
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@emberian
Copy link
Member

A very common pattern when dealing with subprocesses is, when they fail, to print out or log some diagnostics. Lots of code that uses std::run rolls their own version of this. This shouldn't live in the stdlib, I think. Ideally a really nice CLI library would live in the extra conglomerate. For now, developing it as a separate crate and then merging it into libextra temporarily would be good.

Examples that this would ideally replace:

https://github.com/huonw/multibuilder/blob/master/git.rs#L36 (and bunch elsewhere in this file)
https://github.com/huonw/multibuilder/blob/master/git.rs#L108
alexcrichton@cff13ae#diff-88c3a4f09e02361c7490165aacee98dfR41

(I'm sure many more can be found in other codebases)

@aochagavia
Copy link
Contributor

std::run has been removed and some of its functionalities have been moved to std::io::process (see #12380)

Does this issue still apply?

@alexcrichton
Copy link
Member

This does indeed, updating the title.

@lambda-fairy
Copy link
Contributor

The links in @cmr's post seem to be broken.

git.rs is at https://github.com/huonw/multibuilder/blob/master/src/git.rs now, which should cover the first two. Not sure about the third one though.

@steveklabnik
Copy link
Member

With IO reform, what is the state of this?

@emberian
Copy link
Member Author

With the new Command and Process, I think this is very nice, nearly as nice as it can be!

flip1995 pushed a commit to flip1995/rust that referenced this issue Apr 23, 2023
Update to a compiletest-rs version that requires `//@` for commands

Requires Manishearth/compiletest-rs#261 to get published

This PR is a smaller step towards rust-lang/rust-clippy#10426

changelog: Move to a version of compiletest-rs that allows us to require `//`@`` for test suite commands.
flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 30, 2023
Add a test that checks for old style test headers

Follow up to rust-lang#10669, we're pretty used to them so they're easy to slip through

changelog: none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

5 participants