提交 3a800bf5 编写于 作者: J Joshua Nelson

[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!`
```
上级 c110cfa1
......@@ -284,7 +284,19 @@ fn run(v: &[StepDescription], builder: &Builder<'_>, paths: &[PathBuf]) {
}
if !attempted_run {
panic!("error: no rules matched {}", path.display());
eprintln!(
"error: no `{}` rules matched '{}'",
builder.kind.as_str(),
path.display()
);
eprintln!(
"help: run `x.py {} --help --verbose` to show a list of available paths",
builder.kind.as_str()
);
eprintln!(
"note: if you are adding a new Step to bootstrap itself, make sure you register it with `describe!`"
);
std::process::exit(1);
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册