Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ebf8c49

Browse files
authoredFeb 26, 2023
Rollup merge of #108463 - clubby789:update-check-output, r=albertlarsan68
bootstrap: Update the output of the `check` descriptions This should bring the output from `x check` in line with the changes in #108171
2 parents 959ac4f + b30d0da commit ebf8c49

File tree

1 file changed

+60
-28
lines changed

1 file changed

+60
-28
lines changed
 

‎src/bootstrap/check.rs

+60-28
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,15 @@ impl Step for Std {
105105
cargo.arg("--lib");
106106
}
107107

108-
builder.info(&format!(
109-
"Checking stage{} library artifacts ({} -> {})",
110-
builder.top_stage, &compiler.host, target
111-
));
108+
let msg = if compiler.host == target {
109+
format!("Checking stage{} library artifacts ({target})", builder.top_stage)
110+
} else {
111+
format!(
112+
"Checking stage{} library artifacts ({} -> {})",
113+
builder.top_stage, &compiler.host, target
114+
)
115+
};
116+
builder.info(&msg);
112117
run_cargo(
113118
builder,
114119
cargo,
@@ -162,10 +167,18 @@ impl Step for Std {
162167
cargo.arg("-p").arg(krate.name);
163168
}
164169

165-
builder.info(&format!(
166-
"Checking stage{} library test/bench/example targets ({} -> {})",
167-
builder.top_stage, &compiler.host, target
168-
));
170+
let msg = if compiler.host == target {
171+
format!(
172+
"Checking stage{} library test/bench/example targets ({target})",
173+
builder.top_stage
174+
)
175+
} else {
176+
format!(
177+
"Checking stage{} library test/bench/example targets ({} -> {})",
178+
builder.top_stage, &compiler.host, target
179+
)
180+
};
181+
builder.info(&msg);
169182
run_cargo(
170183
builder,
171184
cargo,
@@ -239,10 +252,15 @@ impl Step for Rustc {
239252
cargo.arg("-p").arg(krate.name);
240253
}
241254

242-
builder.info(&format!(
243-
"Checking stage{} compiler artifacts ({} -> {})",
244-
builder.top_stage, &compiler.host, target
245-
));
255+
let msg = if compiler.host == target {
256+
format!("Checking stage{} compiler artifacts ({target})", builder.top_stage)
257+
} else {
258+
format!(
259+
"Checking stage{} compiler artifacts ({} -> {})",
260+
builder.top_stage, &compiler.host, target
261+
)
262+
};
263+
builder.info(&msg);
246264
run_cargo(
247265
builder,
248266
cargo,
@@ -299,10 +317,15 @@ impl Step for CodegenBackend {
299317
.arg(builder.src.join(format!("compiler/rustc_codegen_{}/Cargo.toml", backend)));
300318
rustc_cargo_env(builder, &mut cargo, target);
301319

302-
builder.info(&format!(
303-
"Checking stage{} {} artifacts ({} -> {})",
304-
builder.top_stage, backend, &compiler.host.triple, target.triple
305-
));
320+
let msg = if compiler.host == target {
321+
format!("Checking stage{} {} artifacts ({target})", builder.top_stage, backend)
322+
} else {
323+
format!(
324+
"Checking stage{} {} library ({} -> {})",
325+
builder.top_stage, backend, &compiler.host.triple, target.triple
326+
)
327+
};
328+
builder.info(&msg);
306329

307330
run_cargo(
308331
builder,
@@ -362,10 +385,15 @@ impl Step for RustAnalyzer {
362385
cargo.arg("--benches");
363386
}
364387

365-
builder.info(&format!(
366-
"Checking stage{} {} artifacts ({} -> {})",
367-
compiler.stage, "rust-analyzer", &compiler.host.triple, target.triple
368-
));
388+
let msg = if compiler.host == target {
389+
format!("Checking stage{} {} artifacts ({target})", compiler.stage, "rust-analyzer")
390+
} else {
391+
format!(
392+
"Checking stage{} {} artifacts ({} -> {})",
393+
compiler.stage, "rust-analyzer", &compiler.host.triple, target.triple
394+
)
395+
};
396+
builder.info(&msg);
369397
run_cargo(
370398
builder,
371399
cargo,
@@ -432,14 +460,18 @@ macro_rules! tool_check_step {
432460
// NOTE: this doesn't enable lints for any other tools unless they explicitly add `#![warn(rustc::internal)]`
433461
// See https://github.com/rust-lang/rust/pull/80573#issuecomment-754010776
434462
cargo.rustflag("-Zunstable-options");
435-
436-
builder.info(&format!(
437-
"Checking stage{} {} artifacts ({} -> {})",
438-
builder.top_stage,
439-
stringify!($name).to_lowercase(),
440-
&compiler.host.triple,
441-
target.triple
442-
));
463+
let msg = if compiler.host == target {
464+
format!("Checking stage{} {} artifacts ({target})", builder.top_stage, stringify!($name).to_lowercase())
465+
} else {
466+
format!(
467+
"Checking stage{} {} artifacts ({} -> {})",
468+
builder.top_stage,
469+
stringify!($name).to_lowercase(),
470+
&compiler.host.triple,
471+
target.triple
472+
)
473+
};
474+
builder.info(&msg);
443475
run_cargo(
444476
builder,
445477
cargo,

0 commit comments

Comments
 (0)
Please sign in to comment.