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

More informative diagnotic from x.py test attempt atop beta checkout #83172

Conversation

pnkfelix
Copy link
Member

Make bootstrap be more informative when one does x.py test on a beta checkout without other mods.

To be clear, by default running x.py test on a checkout of the beta branch
currently fails, and with this change will continue to fail, because x.py tests runs x.py test src/tools/tidy which tries to run rustfmt and that
will fail because the rustfmt binary is pinned to the current nighlty and we
do not attempt to distribute one for the beta builds.

This change gives a better error message than the current message, which is just
"./x.py fmt is not supported on this channel" without providing any hint about
what one might do about that problem.

@rust-highfive
Copy link
Collaborator

r? @Mark-Simulacrum

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 15, 2021
@pnkfelix
Copy link
Member Author

pnkfelix commented Mar 15, 2021

Before:

./x.py fmt is not supported on this channel
failed to run: /media/pnkfelix/Rust/rust.git/objdir-clean/build/bootstrap/debug/bootstrap test --stage 1 src/tools/tidy                                                                                                   

After:

error: no `rustfmt` binary found in /media/pnkfelix/Rust/rust.git/objdir-clean/build/x86_64-unknown-linux-gnu/stage0/bin                                         
info: `rust.channel` is currently set to "dev"
help: if you are testing a beta branch, set `rust.channel` to "beta" in the `config.toml` file 
help: to skip test's attempt to check tidiness, pass `--exclude src/tools/tidy` to `x.py test`
failed to run: /media/pnkfelix/Rust/rust.git/objdir-clean/build/bootstrap/debug/bootstrap test --stage 1 src/tools/tidy

@rust-log-analyzer

This comment has been minimized.

@pnkfelix
Copy link
Member Author

pnkfelix commented Mar 16, 2021

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
configure: rust.channel         := nightly
configure: rust.debug-assertions := True
configure: llvm.assertions      := True
configure: dist.missing-tools   := True
configure: build.configure-args := ['--enable-sccache', '--disable-manage-submodu ...
configure: writing `config.toml` in current directory
configure: 
configure: run `python /checkout/x.py --help`
configure: 
---
skip untracked path cpu-usage.csv during rustfmt invocations
skip untracked path src/doc/book/ during rustfmt invocations
skip untracked path src/doc/rust-by-example/ during rustfmt invocations
skip untracked path src/llvm-project/ during rustfmt invocations
Diff in /checkout/src/bootstrap/test.rs at line 792:
         if builder.config.channel == "dev" || builder.config.channel == "nightly" {
             builder.info("fmt check");
             if builder.config.initial_rustfmt.is_none() {
-                let inferred_rustfmt_dir =
-                    builder.config.initial_rustc.parent().unwrap();
-                eprintln!("\
+                let inferred_rustfmt_dir = builder.config.initial_rustc.parent().unwrap();
+                eprintln!(
+                    "\
 error: no `rustfmt` binary found in {PATH}
 info: `rust.channel` is currently set to \"{CHAN}\"
 help: if you are testing a beta branch, set `rust.channel` to \"beta\" in the `config.toml` file
Diff in /checkout/src/bootstrap/test.rs at line 801:
 help: to skip test's attempt to check tidiness, pass `--exclude src/tools/tidy` to `x.py test`",
-                          PATH=inferred_rustfmt_dir.display(),
-                          CHAN=builder.config.channel,
+                    PATH = inferred_rustfmt_dir.display(),
+                    CHAN = builder.config.channel,
                 );
                 std::process::exit(1);
             }
Running `"/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/rustfmt" "--config-path" "/checkout" "--edition" "2018" "--unstable-features" "--skip-children" "--check" "/checkout/src/bootstrap/test.rs"` failed.
If you're running `tidy`, try again with `--bless`. Or, if you just want to format code, run `./x.py fmt` instead.
Build completed unsuccessfully in 0:00:16

oh irony, failing to run the tidy check on this thing that makes it easier to make progress by skipping the tidy check.

Oh wait, that's not irony at all. Or rather, its Alanis Morrisette's notion of irony...

…a checkout without other mods.

To be clear, by default running `x.py test` on a checkout of the beta branch
currently fails, and with this change will continue to fail, because `x.py
tests` runs `x.py test src/tools/tidy` which tries to run `rustfmt` and that
will fail because the `rustfmt` binary is pinned to the current nighlty and we
do not attempt to distribute one for the beta builds.

This change gives a better error message than the current message, which is just
"./x.py fmt is not supported on this channel" without providing any hint about
what one might do about that problem.

(update: placated tidy.)
@pnkfelix pnkfelix force-pushed the bootstrap-tell-me-what-to-do-about-tidy-on-beta branch from 9400df1 to d6de60f Compare March 16, 2021 03:19
@Mark-Simulacrum
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Mar 16, 2021

📌 Commit d6de60f 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 Mar 16, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 16, 2021
Rollup of 10 pull requests

Successful merges:

 - rust-lang#81822 (Added `try_exists()` method to `std::path::Path`)
 - rust-lang#83072 (Update `Vec` docs)
 - rust-lang#83077 (rustdoc: reduce GC work during search)
 - rust-lang#83091 (Constify `copy` related functions)
 - rust-lang#83156 (Fall-back to sans-serif if Arial is not available)
 - rust-lang#83157 (No background for code in portability snippets)
 - rust-lang#83160 (Deprecate RustcEncodable and RustcDecodable.)
 - rust-lang#83162 (Specify *.woff2 files as binary)
 - rust-lang#83172 (More informative diagnotic from `x.py test` attempt atop beta checkout)
 - rust-lang#83196 (Use delay_span_bug instead of panic in layout_scalar_valid_range)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit b62997f into rust-lang:master Mar 16, 2021
@rustbot rustbot added this to the 1.52.0 milestone Mar 16, 2021
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants