support different Kinds in Builder::msg_tool

Signed-off-by: onur-ozkan <work@onurozkan.dev>
This commit is contained in:
onur-ozkan 2024-03-22 18:23:01 +03:00
parent 8a865a0fa9
commit 77ba3f2891
2 changed files with 16 additions and 3 deletions

View File

@ -5,6 +5,7 @@ use crate::builder::ShouldRun;
use crate::core::builder;
use crate::core::builder::crate_description;
use crate::core::builder::Alias;
use crate::core::builder::Kind;
use crate::core::builder::RunConfig;
use crate::core::builder::Step;
use crate::Mode;
@ -233,7 +234,7 @@ impl Step for Rustc {
macro_rules! lint_any {
($(
$name:ident, $path:expr, $tool_name:expr
$name:ident, $path:expr, $readable_name:expr
$(,is_external_tool = $external:expr)*
$(,is_unstable_tool = $unstable:expr)*
$(,allow_features = $allow_features:expr)?
@ -276,6 +277,15 @@ macro_rules! lint_any {
&[],
);
let _guard = builder.msg_tool(
Kind::Clippy,
Mode::ToolRustc,
$readable_name,
compiler.stage,
&compiler.host,
&target,
);
run_cargo(
builder,
cargo,

View File

@ -36,8 +36,9 @@ struct ToolBuild {
impl Builder<'_> {
#[track_caller]
fn msg_tool(
pub(crate) fn msg_tool(
&self,
kind: Kind,
mode: Mode,
tool: &str,
build_stage: u32,
@ -47,7 +48,7 @@ impl Builder<'_> {
match mode {
// depends on compiler stage, different to host compiler
Mode::ToolRustc => self.msg_sysroot_tool(
Kind::Build,
kind,
build_stage,
format_args!("tool {tool}"),
*host,
@ -100,6 +101,7 @@ impl Step for ToolBuild {
cargo.allow_features(self.allow_features);
}
let _guard = builder.msg_tool(
Kind::Build,
self.mode,
self.tool,
self.compiler.stage,
@ -481,6 +483,7 @@ impl Step for Rustdoc {
);
let _guard = builder.msg_tool(
Kind::Build,
Mode::ToolRustc,
"rustdoc",
build_compiler.stage,