Rollup merge of #58365 - Zoxc:task-status, r=michaelwoerister
Add an option to print the status of incremental tasks / dep nodes after running them r? @michaelwoerister
This commit is contained in:
commit
0431857770
2 changed files with 17 additions and 0 deletions
|
@ -292,17 +292,28 @@ impl DepGraph {
|
||||||
task_deps.map(|lock| lock.into_inner()),
|
task_deps.map(|lock| lock.into_inner()),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
let print_status = cfg!(debug_assertions) && hcx.sess().opts.debugging_opts.dep_tasks;
|
||||||
|
|
||||||
// Determine the color of the new DepNode.
|
// Determine the color of the new DepNode.
|
||||||
if let Some(prev_index) = data.previous.node_to_index_opt(&key) {
|
if let Some(prev_index) = data.previous.node_to_index_opt(&key) {
|
||||||
let prev_fingerprint = data.previous.fingerprint_by_index(prev_index);
|
let prev_fingerprint = data.previous.fingerprint_by_index(prev_index);
|
||||||
|
|
||||||
let color = if let Some(current_fingerprint) = current_fingerprint {
|
let color = if let Some(current_fingerprint) = current_fingerprint {
|
||||||
if current_fingerprint == prev_fingerprint {
|
if current_fingerprint == prev_fingerprint {
|
||||||
|
if print_status {
|
||||||
|
eprintln!("[task::green] {:?}", key);
|
||||||
|
}
|
||||||
DepNodeColor::Green(dep_node_index)
|
DepNodeColor::Green(dep_node_index)
|
||||||
} else {
|
} else {
|
||||||
|
if print_status {
|
||||||
|
eprintln!("[task::red] {:?}", key);
|
||||||
|
}
|
||||||
DepNodeColor::Red
|
DepNodeColor::Red
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if print_status {
|
||||||
|
eprintln!("[task::unknown] {:?}", key);
|
||||||
|
}
|
||||||
// Mark the node as Red if we can't hash the result
|
// Mark the node as Red if we can't hash the result
|
||||||
DepNodeColor::Red
|
DepNodeColor::Red
|
||||||
};
|
};
|
||||||
|
@ -312,6 +323,10 @@ impl DepGraph {
|
||||||
insertion for {:?}", key);
|
insertion for {:?}", key);
|
||||||
|
|
||||||
data.colors.insert(prev_index, color);
|
data.colors.insert(prev_index, color);
|
||||||
|
} else {
|
||||||
|
if print_status {
|
||||||
|
eprintln!("[task::new] {:?}", key);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
(result, dep_node_index)
|
(result, dep_node_index)
|
||||||
|
|
|
@ -1237,6 +1237,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
|
||||||
"show extended diagnostic help"),
|
"show extended diagnostic help"),
|
||||||
continue_parse_after_error: bool = (false, parse_bool, [TRACKED],
|
continue_parse_after_error: bool = (false, parse_bool, [TRACKED],
|
||||||
"attempt to recover from parse errors (experimental)"),
|
"attempt to recover from parse errors (experimental)"),
|
||||||
|
dep_tasks: bool = (false, parse_bool, [UNTRACKED],
|
||||||
|
"print tasks that execute and the color their dep node gets (requires debug build)"),
|
||||||
incremental: Option<String> = (None, parse_opt_string, [UNTRACKED],
|
incremental: Option<String> = (None, parse_opt_string, [UNTRACKED],
|
||||||
"enable incremental compilation (experimental)"),
|
"enable incremental compilation (experimental)"),
|
||||||
incremental_queries: bool = (true, parse_bool, [UNTRACKED],
|
incremental_queries: bool = (true, parse_bool, [UNTRACKED],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue