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

Make x.py less verbose on failures #86856

Merged
merged 1 commit into from
Jul 5, 2021
Merged

Conversation

jyn514
Copy link
Member

@jyn514 jyn514 commented Jul 4, 2021

  • Don't print the exact command run by rustbuild unless --verbose is set.
    This is almost always unhelpful, since it's just cargo with a lot of
    arguments (and you can't replicate it anyway unless you have the environment variables, which aren't printed by default).
  • Don't print "Build completed unsuccessfully" unless --verbose is set.
    You can already tell the build failed by the errors above, and the
    time isn't particularly helpful.
  • Don't print the full path to bootstrap. This is useless to everyone,
    even including when working on x.py itself. You can still opt-in to
    this being shown with --verbose, since it will throw an exception.

Before:

error[E0432]: unresolved import `x`
   --> library/std/src/lib.rs:343:5
    |
343 | use x;
    |     ^ no external crate `x`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0432`.
error: could not compile `std`

To learn more, run the command again with --verbose.
command did not execute successfully: "/home/joshua/rustc4/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "check" "--target" "x86_64-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" "8" "--release" "--features" "panic-unwind backtrace" "--manifest-path" "/home/joshua/rustc4/library/test/Cargo.toml" "--message-format" "json-render-diagnostics"
expected success, got: exit status: 101
failed to run: /home/joshua/rustc4/build/bootstrap/debug/bootstrap check
Build completed unsuccessfully in 0:00:13

After:

error[E0432]: unresolved import `x`
   --> library/std/src/lib.rs:343:5
    |
343 | use x;
    |     ^ no external crate `x`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0432`.
error: could not compile `std`

To learn more, run the command again with --verbose.

cc #86854, #86022

r? @Mark-Simulacrum

@jyn514 jyn514 added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself labels Jul 4, 2021
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 4, 2021
@Mark-Simulacrum
Copy link
Member

I'd prefer to keep the time and "unsuccessfully" line - I find it slightly helpful at least and it seems pretty harmless.

Other changes seem great (haven't looked at code yet).

- Don't print the exact command run by rustbuild unless `--verbose` is set.
  This is almost always unhelpful, since it's just cargo with a lot of
  arguments.
- Don't print "Build completed unsuccessfully" unless --verbose is set.
  You can already tell the build failed by the errors above, and the
  time isn't particularly helpful.
- Don't print the full path to bootstrap. This is useless to everyone,
  even including when working on x.py itself. You can still opt-in to
  this being shown with `--verbose`, since it will throw an exception.

Before:

```
error[E0432]: unresolved import `x`
   --> library/std/src/lib.rs:343:5
    |
343 | use x;
    |     ^ no external crate `x`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0432`.
error: could not compile `std`

To learn more, run the command again with --verbose.
command did not execute successfully: "/home/joshua/rustc4/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "check" "--target" "x86_64-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" "8" "--release" "--features" "panic-unwind backtrace" "--manifest-path" "/home/joshua/rustc4/library/test/Cargo.toml" "--message-format" "json-render-diagnostics"
expected success, got: exit status: 101
failed to run: /home/joshua/rustc4/build/bootstrap/debug/bootstrap check
Build completed unsuccessfully in 0:00:13
```

After:

```
error[E0432]: unresolved import `x`
   --> library/std/src/lib.rs:343:5
    |
343 | use x;
    |     ^ no external crate `x`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0432`.
error: could not compile `std`

To learn more, run the command again with --verbose.
```
@jyn514
Copy link
Member Author

jyn514 commented Jul 4, 2021

Sure, done. (I don't find it particularly useful, but we can always remove it later and getting rid of the other three lines seems really helpful.)

@petrochenkov
Copy link
Contributor

Don't print "Build completed unsuccessfully" unless --verbose is set.
You can already tell the build failed by the errors above, and the
time isn't particularly helpful.

I added it exactly because you cannot, and because it's helpful.
x.py failures on CI can happen for numerous reasons (like network failures, timeouts, etc) and the relevant message can be somewhere in the middle of the log.
The "Build completed (un)successfully" line that is always printed allows to see the result immediately in predictable place.
Although some people with good intentions already removed it from x.py --help runs.

@Mark-Simulacrum
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jul 4, 2021

📌 Commit fad1b9c has been approved by Mark-Simulacrum

@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 Jul 4, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 4, 2021
Rollup of 8 pull requests

Successful merges:

 - rust-lang#86477 (E0716: clarify that equivalent code example is erroneous)
 - rust-lang#86623 (Add check to ensure error code explanations are not removed anymore even if not emitted)
 - rust-lang#86856 (Make x.py less verbose on failures)
 - rust-lang#86858 (Stabilize `string_drain_as_str`)
 - rust-lang#86859 (Add a regression test for issue-69323)
 - rust-lang#86862 (re-export SwitchIntEdgeEffects)
 - rust-lang#86864 (Add missing code example for Write::write_vectored)
 - rust-lang#86874 (Bump deps)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 249d872 into rust-lang:master Jul 5, 2021
@rustbot rustbot added this to the 1.55.0 milestone Jul 5, 2021
@jyn514 jyn514 deleted the x.py-less-verbose branch July 5, 2021 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself 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.

6 participants