Skip to content

Commit 3e77562

Browse files
committed
Use pretty_step_name in step_graph
1 parent 12828f7 commit 3e77562

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

src/bootstrap/src/core/builder/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1717,7 +1717,7 @@ You have to build a stage1 compiler for `{}` first, and then use it to build a s
17171717
// We cannot use a dynamic name here, so instead we record the actual step name
17181718
// in the step_name field.
17191719
"step",
1720-
step_name = step_name::<S>(),
1720+
step_name = pretty_step_name::<S>(),
17211721
args = step_debug_args(&step)
17221722
);
17231723
span.entered()
@@ -1819,7 +1819,7 @@ You have to build a stage1 compiler for `{}` first, and then use it to build a s
18191819
}
18201820

18211821
/// Return qualified step name, e.g. `compile::Rustc`.
1822-
fn step_name<S: Step>() -> String {
1822+
pub fn pretty_step_name<S: Step>() -> String {
18231823
// Normalize step type path to only keep the module and the type name
18241824
let path = type_name::<S>().rsplit("::").take(2).collect::<Vec<_>>();
18251825
path.into_iter().rev().collect::<Vec<_>>().join("::")
@@ -1834,7 +1834,7 @@ fn step_debug_args<S: Step>(step: &S) -> String {
18341834
}
18351835

18361836
fn pretty_print_step<S: Step>(step: &S) -> String {
1837-
format!("{} {{ {} }}", step_name::<S>(), step_debug_args(step))
1837+
format!("{} {{ {} }}", pretty_step_name::<S>(), step_debug_args(step))
18381838
}
18391839

18401840
impl<'a> AsRef<ExecutionContext> for Builder<'a> {

src/bootstrap/src/utils/step_graph.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::fmt::Debug;
33
use std::io::BufWriter;
44
use std::path::Path;
55

6-
use crate::core::builder::{AnyDebug, Step};
6+
use crate::core::builder::{AnyDebug, Step, pretty_step_name};
77
use crate::t;
88

99
/// Records the executed steps and their dependencies in a directed graph,
@@ -43,13 +43,7 @@ impl StepGraph {
4343
metadata.get_target()
4444
)
4545
} else {
46-
let type_name = std::any::type_name::<S>();
47-
type_name
48-
.strip_prefix("bootstrap::core::")
49-
.unwrap_or(type_name)
50-
.strip_prefix("build_steps::")
51-
.unwrap_or(type_name)
52-
.to_string()
46+
pretty_step_name::<S>()
5347
};
5448

5549
let node = Node { label, tooltip: node_key.clone() };

0 commit comments

Comments
 (0)