@@ -12,8 +12,7 @@ use std::env;
12
12
use std:: fmt;
13
13
use std:: fs:: { self , File } ;
14
14
use std:: hash;
15
- use std:: io:: Read ;
16
- use std:: io:: Write ;
15
+ use std:: io:: { BufRead , Read , Write } ;
17
16
use std:: mem:: ManuallyDrop ;
18
17
use std:: path:: { Path , PathBuf } ;
19
18
use std:: process:: { self , Command } ;
@@ -1144,7 +1143,22 @@ impl<'a> Processor for ProfileProcessor<'a> {
1144
1143
let tmp_eprintln_file = filepath ( data. cwd . as_ref ( ) , "eprintln" ) ;
1145
1144
let eprintln_file = filepath ( self . output_dir , & out_file ( "eprintln" ) ) ;
1146
1145
1147
- fs:: copy ( & tmp_eprintln_file, & eprintln_file) ?;
1146
+ let mut final_file =
1147
+ std:: io:: BufWriter :: new ( std:: fs:: File :: create ( & eprintln_file) ?) ;
1148
+ for line in
1149
+ std:: io:: BufReader :: new ( std:: fs:: File :: open ( & tmp_eprintln_file) ?) . lines ( )
1150
+ {
1151
+ let line = line?;
1152
+ // rustc under Cargo currently ~always emits artifact
1153
+ // messages -- which we don't want in final
1154
+ // eprintln output. These messages generally look like:
1155
+ // {"artifact":"/tmp/.tmpjIe45J/...","emit":"dep-info"}
1156
+ if line. starts_with ( r#"{"artifact":"# ) {
1157
+ continue ;
1158
+ }
1159
+
1160
+ writeln ! ( & mut final_file, "{}" , line) ?;
1161
+ }
1148
1162
}
1149
1163
1150
1164
// mono item results are redirected (via rustc-fake) to a file
0 commit comments