Skip to content

Commit bfd79f5

Browse files
committed
support different Kinds in Builder::msg_tool
Signed-off-by: onur-ozkan <work@onurozkan.dev>
1 parent c58f2d2 commit bfd79f5

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

src/bootstrap/src/core/build_steps/clippy.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use crate::builder::ShouldRun;
55
use crate::core::builder;
66
use crate::core::builder::crate_description;
77
use crate::core::builder::Alias;
8+
use crate::core::builder::Kind;
89
use crate::core::builder::RunConfig;
910
use crate::core::builder::Step;
1011
use crate::Mode;
@@ -233,7 +234,7 @@ impl Step for Rustc {
233234

234235
macro_rules! lint_any {
235236
($(
236-
$name:ident, $path:expr, $tool_name:expr
237+
$name:ident, $path:expr, $readable_name:expr
237238
$(,is_external_tool = $external:expr)*
238239
$(,is_unstable_tool = $unstable:expr)*
239240
$(,allow_features = $allow_features:expr)?
@@ -276,6 +277,15 @@ macro_rules! lint_any {
276277
&[],
277278
);
278279

280+
let _guard = builder.msg_tool(
281+
Kind::Clippy,
282+
Mode::ToolRustc,
283+
$readable_name,
284+
compiler.stage,
285+
&compiler.host,
286+
&target,
287+
);
288+
279289
run_cargo(
280290
builder,
281291
cargo,

src/bootstrap/src/core/build_steps/tool.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ struct ToolBuild {
3636

3737
impl Builder<'_> {
3838
#[track_caller]
39-
fn msg_tool(
39+
pub(crate) fn msg_tool(
4040
&self,
41+
kind: Kind,
4142
mode: Mode,
4243
tool: &str,
4344
build_stage: u32,
@@ -47,7 +48,7 @@ impl Builder<'_> {
4748
match mode {
4849
// depends on compiler stage, different to host compiler
4950
Mode::ToolRustc => self.msg_sysroot_tool(
50-
Kind::Build,
51+
kind,
5152
build_stage,
5253
format_args!("tool {tool}"),
5354
*host,
@@ -100,6 +101,7 @@ impl Step for ToolBuild {
100101
cargo.allow_features(self.allow_features);
101102
}
102103
let _guard = builder.msg_tool(
104+
Kind::Build,
103105
self.mode,
104106
self.tool,
105107
self.compiler.stage,
@@ -485,6 +487,7 @@ impl Step for Rustdoc {
485487
}
486488

487489
let _guard = builder.msg_tool(
490+
Kind::Build,
488491
Mode::ToolRustc,
489492
"rustdoc",
490493
build_compiler.stage,

0 commit comments

Comments
 (0)