Skip to content

Commit

Permalink
Rollup merge of rust-lang#42821 - michaelwoerister:incr-debug-output-…
Browse files Browse the repository at this point in the history
…on-stderr, r=alexcrichton

Print -Zincremental-info to stderr instead of stdout.

Fixes rust-lang#42583.

The [cargo-incremental](https://github.com/nikomatsakis/cargo-incremental) tool probably does not need to be updated. It already merges stdout and stderr before parsing the compiler's output.

r? @alexcrichton
  • Loading branch information
Mark-Simulacrum authored Jun 23, 2017
2 parents ddc2333 + 12b11d8 commit f3aebb0
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
6 changes: 3 additions & 3 deletions src/librustc_incremental/persist/file_format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ fn report_format_mismatch(sess: &Session, file: &Path, message: &str) {
debug!("read_file: {}", message);

if sess.opts.debugging_opts.incremental_info {
println!("incremental: ignoring cache artifact `{}`: {}",
file.file_name().unwrap().to_string_lossy(),
message);
eprintln!("incremental: ignoring cache artifact `{}`: {}",
file.file_name().unwrap().to_string_lossy(),
message);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/librustc_incremental/persist/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,8 @@ fn copy_files(target_dir: &Path,
}

if print_stats_on_success {
println!("incremental: session directory: {} files hard-linked", files_linked);
println!("incremental: session directory: {} files copied", files_copied);
eprintln!("incremental: session directory: {} files hard-linked", files_linked);
eprintln!("incremental: session directory: {} files copied", files_copied);
}

Ok(files_linked > 0 || files_copied == 0)
Expand Down
16 changes: 8 additions & 8 deletions src/librustc_incremental/persist/load.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ pub fn decode_dep_graph<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,

if prev_commandline_args_hash != tcx.sess.opts.dep_tracking_hash() {
if tcx.sess.opts.debugging_opts.incremental_info {
println!("incremental: completely ignoring cache because of \
differing commandline arguments");
eprintln!("incremental: completely ignoring cache because of \
differing commandline arguments");
}
// We can't reuse the cache, purge it.
debug!("decode_dep_graph: differing commandline arg hashes");
Expand Down Expand Up @@ -309,8 +309,8 @@ fn reconcile_work_products<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
all_files_exist = false;

if tcx.sess.opts.debugging_opts.incremental_info {
println!("incremental: could not find file for up-to-date work product: {}",
path.display());
eprintln!("incremental: could not find file for \
up-to-date work product: {}", path.display());
}
}
}
Expand Down Expand Up @@ -418,10 +418,10 @@ fn process_edge<'a, 'tcx, 'edges>(
format!("{:?}", blame)
};

println!("incremental: module {:?} is dirty because {:?} \
changed or was removed",
wp_id,
blame_str);
eprintln!("incremental: module {:?} is dirty because {:?} \
changed or was removed",
wp_id,
blame_str);
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/librustc_incremental/persist/save.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ pub fn save_dep_graph<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
let query = tcx.dep_graph.query();

if tcx.sess.opts.debugging_opts.incremental_info {
println!("incremental: {} nodes in dep-graph", query.graph.len_nodes());
println!("incremental: {} edges in dep-graph", query.graph.len_edges());
eprintln!("incremental: {} nodes in dep-graph", query.graph.len_nodes());
eprintln!("incremental: {} edges in dep-graph", query.graph.len_edges());
}

let mut hcx = HashContext::new(tcx, incremental_hashes_map);
Expand Down Expand Up @@ -258,9 +258,9 @@ pub fn encode_dep_graph(tcx: TyCtxt,
graph.encode(encoder)?;

if tcx.sess.opts.debugging_opts.incremental_info {
println!("incremental: {} nodes in reduced dep-graph", graph.nodes.len());
println!("incremental: {} edges in serialized dep-graph", graph.edge_list_data.len());
println!("incremental: {} hashes in serialized dep-graph", graph.hashes.len());
eprintln!("incremental: {} nodes in reduced dep-graph", graph.nodes.len());
eprintln!("incremental: {} edges in serialized dep-graph", graph.edge_list_data.len());
eprintln!("incremental: {} hashes in serialized dep-graph", graph.hashes.len());
}

if tcx.sess.opts.debugging_opts.incremental_dump_hash {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_trans/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ fn dump_incremental_data(trans: &CrateTranslation) {
ModuleSource::Translated(..) => (),
}
}
println!("incremental: re-using {} out of {} modules", reuse, trans.modules.len());
eprintln!("incremental: re-using {} out of {} modules", reuse, trans.modules.len());
}

struct WorkItem {
Expand Down
6 changes: 3 additions & 3 deletions src/librustc_trans/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1150,9 +1150,9 @@ pub fn trans_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
Some(work_product)
} else {
if scx.sess().opts.debugging_opts.incremental_info {
println!("incremental: CGU `{}` invalidated because of \
changed partitioning hash.",
cgu.name());
eprintln!("incremental: CGU `{}` invalidated because of \
changed partitioning hash.",
cgu.name());
}
debug!("trans_reuse_previous_work_products: \
not reusing {:?} because hash changed to {:?}",
Expand Down

0 comments on commit f3aebb0

Please sign in to comment.