@@ -586,16 +586,15 @@ impl RustwideBuilder {
586586 self . execute_build ( build_id, name, version, default_target, true , build, & limits, & metadata, false , collect_metrics) ?;
587587 }
588588
589- if res. result . successful {
590- if let Some ( name) = res. cargo_metadata . root ( ) . library_name ( ) {
589+ if res. result . successful
590+ && let Some ( name) = res. cargo_metadata . root ( ) . library_name ( ) {
591591 let host_target = build. host_target_dir ( ) ;
592592 has_docs = host_target
593593 . join ( default_target)
594594 . join ( "doc" )
595595 . join ( name)
596596 . is_dir ( ) ;
597597 }
598- }
599598
600599 let mut target_build_logs = HashMap :: new ( ) ;
601600 let documentation_size = if has_docs {
@@ -1077,19 +1076,18 @@ impl RustwideBuilder {
10771076 } )
10781077 } ;
10791078
1080- if collect_metrics {
1081- if let Some ( compiler_metric_target_dir) = & self . config . compiler_metrics_collection_path
1082- {
1083- let metric_output = build. host_target_dir ( ) . join ( "metrics/" ) ;
1084- info ! (
1085- "found {} files in metric dir, copy over to {} (exists: {})" ,
1086- fs:: read_dir( & metric_output) ?. count( ) ,
1087- & compiler_metric_target_dir. to_string_lossy( ) ,
1088- & compiler_metric_target_dir. exists( ) ,
1089- ) ;
1090- copy_dir_all ( & metric_output, compiler_metric_target_dir) ?;
1091- fs:: remove_dir_all ( & metric_output) ?;
1092- }
1079+ if collect_metrics
1080+ && let Some ( compiler_metric_target_dir) = & self . config . compiler_metrics_collection_path
1081+ {
1082+ let metric_output = build. host_target_dir ( ) . join ( "metrics/" ) ;
1083+ info ! (
1084+ "found {} files in metric dir, copy over to {} (exists: {})" ,
1085+ fs:: read_dir( & metric_output) ?. count( ) ,
1086+ & compiler_metric_target_dir. to_string_lossy( ) ,
1087+ & compiler_metric_target_dir. exists( ) ,
1088+ ) ;
1089+ copy_dir_all ( & metric_output, compiler_metric_target_dir) ?;
1090+ fs:: remove_dir_all ( & metric_output) ?;
10931091 }
10941092
10951093 // For proc-macros, cargo will put the output in `target/doc`.
0 commit comments