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

[bootstrap] Give a better error when trying to run a path with no registered step #96660

Merged
merged 1 commit into from
May 7, 2022

Conversation

jyn514
Copy link
Member

@jyn514 jyn514 commented May 3, 2022

Before:

thread 'main' panicked at 'error: no rules matched invalid', src/bootstrap/builder.rs:287:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

After:

error: no `check` rules matched 'invalid'
help: run `x.py check --help --verbose` to show a list of available paths
note: if you are adding a new Step to bootstrap itself, make sure you register it with `describe!`

@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 May 3, 2022
…istered step

Before:
```
thread 'main' panicked at 'error: no rules matched invalid', src/bootstrap/builder.rs:287:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```

After:
```
error: no `check` rules matched 'invalid'
help: run `x.py check --help --verbose` to show a list of available paths
note: if you are adding a new Step to bootstrap itself, make sure you register it with `describe!`
```
@jyn514 jyn514 force-pushed the better-missing-path-error branch from f77a48b to 3a800bf Compare May 3, 2022 04:46
builder.kind.as_str()
);
eprintln!(
"note: if you are adding a new Step to bootstrap itself, make sure you register it with `describe!`"
Copy link
Member

Choose a reason for hiding this comment

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

I think probably we should say something like "in src/bootstrap/builder.rs" here, though I guess it's not that hard to find:

$ rg 'describe!'
src/bootstrap/builder.rs
494:            Kind::Build => describe!(
525:            Kind::Check => describe!(
536:            Kind::Test => describe!(
591:            Kind::Bench => describe!(test::Crate, test::CrateLibrustc),
592:            Kind::Doc => describe!(
612:            Kind::Dist => describe!(
640:            Kind::Install => describe!(
654:            Kind::Run => describe!(run::ExpandYamlAnchors, run::BuildManifest, run::BumpStage0),

So maybe alright for now, and better short for such a specific message anyway.

@Mark-Simulacrum
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented May 7, 2022

📌 Commit 3a800bf 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 May 7, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request May 7, 2022
…piler-errors

Rollup of 8 pull requests

Successful merges:

 - rust-lang#96660 ([bootstrap] Give a better error when trying to run a path with no registered step)
 - rust-lang#96701 (update `jemallocator` example to use 2018 edition import syntax)
 - rust-lang#96746 (Fix an ICE on rust-lang#96738)
 - rust-lang#96758 (bootstrap: bsd platform flags for split debuginfo)
 - rust-lang#96778 (Remove closures on `expect_local` to apply `#[track_caller]`)
 - rust-lang#96781 (Fix an incorrect link in The Unstable Book)
 - rust-lang#96783 (Link to correct issue in issue-95034 known-bug)
 - rust-lang#96801 (Add regression test for rust-lang#96319)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 6226d10 into rust-lang:master May 7, 2022
@rustbot rustbot added this to the 1.62.0 milestone May 7, 2022
@jyn514 jyn514 deleted the better-missing-path-error branch May 7, 2022 15:17
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

5 participants