Skip to content

Commit 6226d10

Browse files
Rollup merge of #96660 - jyn514:better-missing-path-error, r=Mark-Simulacrum
[bootstrap] Give a better error when trying to run a path with no registered 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!` ```
2 parents 4799baa + 3a800bf commit 6226d10

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/bootstrap/builder.rs

+13-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,19 @@ impl StepDescription {
284284
}
285285

286286
if !attempted_run {
287-
panic!("error: no rules matched {}", path.display());
287+
eprintln!(
288+
"error: no `{}` rules matched '{}'",
289+
builder.kind.as_str(),
290+
path.display()
291+
);
292+
eprintln!(
293+
"help: run `x.py {} --help --verbose` to show a list of available paths",
294+
builder.kind.as_str()
295+
);
296+
eprintln!(
297+
"note: if you are adding a new Step to bootstrap itself, make sure you register it with `describe!`"
298+
);
299+
std::process::exit(1);
288300
}
289301
}
290302
}

0 commit comments

Comments
 (0)