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

Print more verbose error for commands that capture output #129096

Merged
merged 1 commit into from
Aug 15, 2024

Conversation

Kobzol
Copy link
Contributor

@Kobzol Kobzol commented Aug 14, 2024

#128874 made bootstrap command errors less verbose without -v. However, in some cases it's too extreme. If a command fails, it now outputs just Command has failed. Rerun with -v to see more details., without providing any context.

I think that I found a reasonable heuristic to figure out when we should print a more verbose error. When the command doesn't capture output, its stdout/stderr is printed, therefore the user sees context about the error. However, when the command captures its output, the user won't see any error message in the output, which is not great. So only in that case, bootstrap now prints a slightly more verbose output (and also prints the captured output).

r? @onur-ozkan

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Aug 14, 2024
src/bootstrap/src/lib.rs Show resolved Hide resolved
src/bootstrap/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Member

@onur-ozkan onur-ozkan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to r=me with/without the nit.

@Kobzol
Copy link
Contributor Author

Kobzol commented Aug 15, 2024

I have to say that I wasn't a fan of the nit because of the unwrap 😆 I used take_if (newly stabilized in 1.80.0 🎉) instead.

@onur-ozkan
Copy link
Member

I have to say that I wasn't a fan of the nit because of the unwrap 😆 I used take_if (newly stabilized in 1.80.0) instead 🎉

That's even better!

@Kobzol
Copy link
Contributor Author

Kobzol commented Aug 15, 2024

@bors r=onur-ozkan rollup

@bors
Copy link
Contributor

bors commented Aug 15, 2024

📌 Commit 478d42b has been approved by onur-ozkan

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 15, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 15, 2024
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#128348 (Unconditionally allow shadow call-stack sanitizer for AArch64)
 - rust-lang#129065 (Use `impl PartialEq<TokenKind> for Token` more.)
 - rust-lang#129072 (Infer async closure args from `Fn` bound even if there is no corresponding `Future` bound on return)
 - rust-lang#129096 (Print more verbose error for commands that capture output)
 - rust-lang#129101 (Fix projections when parent capture is by-ref but child capture is by-value in the `ByMoveBody` pass)
 - rust-lang#129106 (Remove redundant type ops: `Eq`/`Subtype`)
 - rust-lang#129122 (Remove duplicated `Rustdoc::output` method from `run-make-support` lib)
 - rust-lang#129124 (rustdoc-json: Use FxHashMap from rustdoc_json_types)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 19e32bf into rust-lang:master Aug 15, 2024
6 checks passed
@rustbot rustbot added this to the 1.82.0 milestone Aug 15, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Aug 15, 2024
Rollup merge of rust-lang#129096 - Kobzol:bootstrap-cmd-verbosity, r=onur-ozkan

Print more verbose error for commands that capture output

rust-lang#128874 made bootstrap command errors less verbose without `-v`. However, in some cases it's too extreme. If a command fails, it now outputs just `Command has failed. Rerun with -v to see more details.`, without providing any context.

I think that I found a reasonable heuristic to figure out when we should print a more verbose error. When the command doesn't capture output, its stdout/stderr is printed, therefore the user sees context about the error. However, when the command captures its output, the user won't see any error message in the output, which is not great. So only in that case, bootstrap now prints a slightly more verbose output (and also prints the captured output).

r? `@onur-ozkan`
@Kobzol Kobzol deleted the bootstrap-cmd-verbosity branch August 16, 2024 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants