mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
bootstrap: don't complain about linkcheck if it is excluded
We don't need to complain to the user about linkcheck having different hosts and targets when it is already excluded. This can be achieved by moving the check to when the step is run instead of in should_run.
This commit is contained in:
parent
7b6fc5a3dd
commit
8f97b948e3
@ -108,6 +108,19 @@ impl Step for Linkcheck {
|
||||
/// documentation to ensure we don't have a bunch of dead ones.
|
||||
fn run(self, builder: &Builder<'_>) {
|
||||
let host = self.host;
|
||||
let hosts = &builder.hosts;
|
||||
let targets = &builder.targets;
|
||||
|
||||
// if we have different hosts and targets, some things may be built for
|
||||
// the host (e.g. rustc) and others for the target (e.g. std). The
|
||||
// documentation built for each will contain broken links to
|
||||
// docs built for the other platform (e.g. rustc linking to cargo)
|
||||
if (hosts != targets) && !hosts.is_empty() && !targets.is_empty() {
|
||||
panic!(
|
||||
"Linkcheck currently does not support builds with different hosts and targets.
|
||||
You can skip linkcheck with --exclude src/tools/linkchecker"
|
||||
);
|
||||
}
|
||||
|
||||
builder.info(&format!("Linkcheck ({})", host));
|
||||
|
||||
@ -123,19 +136,6 @@ impl Step for Linkcheck {
|
||||
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
|
||||
let builder = run.builder;
|
||||
let run = run.path("src/tools/linkchecker");
|
||||
let hosts = &builder.hosts;
|
||||
let targets = &builder.targets;
|
||||
|
||||
// if we have different hosts and targets, some things may be built for
|
||||
// the host (e.g. rustc) and others for the target (e.g. std). The
|
||||
// documentation built for each will contain broken links to
|
||||
// docs built for the other platform (e.g. rustc linking to cargo)
|
||||
if (hosts != targets) && !hosts.is_empty() && !targets.is_empty() {
|
||||
panic!(
|
||||
"Linkcheck currently does not support builds with different hosts and targets.
|
||||
You can skip linkcheck with --exclude src/tools/linkchecker"
|
||||
);
|
||||
}
|
||||
run.default_condition(builder.config.docs)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user