@@ -641,7 +641,7 @@ fn rustdoc(cx: &mut Context<'_, '_>, unit: &Unit) -> CargoResult<Work> {
641
641
rustdoc. arg ( "--cfg" ) . arg ( & format ! ( "feature=\" {}\" " , feat) ) ;
642
642
}
643
643
644
- add_error_format_and_color ( cx, & mut rustdoc, unit, false ) ;
644
+ add_error_format_and_color ( cx, & mut rustdoc, unit) ;
645
645
add_allow_features ( cx, & mut rustdoc) ;
646
646
647
647
if let Some ( args) = cx. bcx . extra_args_for ( unit) {
@@ -790,19 +790,9 @@ fn add_allow_features(cx: &Context<'_, '_>, cmd: &mut ProcessBuilder) {
790
790
/// intercepting messages like rmeta artifacts, etc. rustc includes a
791
791
/// "rendered" field in the JSON message with the message properly formatted,
792
792
/// which Cargo will extract and display to the user.
793
- fn add_error_format_and_color (
794
- cx : & Context < ' _ , ' _ > ,
795
- cmd : & mut ProcessBuilder ,
796
- unit : & Unit ,
797
- pipelined : bool ,
798
- ) {
793
+ fn add_error_format_and_color ( cx : & Context < ' _ , ' _ > , cmd : & mut ProcessBuilder , unit : & Unit ) {
799
794
cmd. arg ( "--error-format=json" ) ;
800
- let mut json = String :: from ( "--json=diagnostic-rendered-ansi" ) ;
801
- if pipelined {
802
- // Pipelining needs to know when rmeta files are finished. Tell rustc
803
- // to emit a message that cargo will intercept.
804
- json. push_str ( ",artifacts" ) ;
805
- }
795
+ let mut json = String :: from ( "--json=diagnostic-rendered-ansi,artifacts" ) ;
806
796
if cx
807
797
. bcx
808
798
. target_data
@@ -873,7 +863,7 @@ fn build_base_args(
873
863
edition. cmd_edition_arg ( cmd) ;
874
864
875
865
add_path_args ( bcx. ws , unit, cmd) ;
876
- add_error_format_and_color ( cx, cmd, unit, cx . rmeta_required ( unit ) ) ;
866
+ add_error_format_and_color ( cx, cmd, unit) ;
877
867
add_allow_features ( cx, cmd) ;
878
868
879
869
let mut contains_dy_lib = false ;
@@ -1234,9 +1224,6 @@ fn envify(s: &str) -> String {
1234
1224
struct OutputOptions {
1235
1225
/// What format we're emitting from Cargo itself.
1236
1226
format : MessageFormat ,
1237
- /// Look for JSON message that indicates .rmeta file is available for
1238
- /// pipelined compilation.
1239
- look_for_metadata_directive : bool ,
1240
1227
/// Whether or not to display messages in color.
1241
1228
color : bool ,
1242
1229
/// Where to write the JSON messages to support playback later if the unit
@@ -1258,15 +1245,13 @@ struct OutputOptions {
1258
1245
1259
1246
impl OutputOptions {
1260
1247
fn new ( cx : & Context < ' _ , ' _ > , unit : & Unit ) -> OutputOptions {
1261
- let look_for_metadata_directive = cx. rmeta_required ( unit) ;
1262
1248
let color = cx. bcx . config . shell ( ) . err_supports_color ( ) ;
1263
1249
let path = cx. files ( ) . message_cache_path ( unit) ;
1264
1250
// Remove old cache, ignore ENOENT, which is the common case.
1265
1251
drop ( fs:: remove_file ( & path) ) ;
1266
1252
let cache_cell = Some ( ( path, LazyCell :: new ( ) ) ) ;
1267
1253
OutputOptions {
1268
1254
format : cx. bcx . build_config . message_format ,
1269
- look_for_metadata_directive,
1270
1255
color,
1271
1256
cache_cell,
1272
1257
show_diagnostics : true ,
@@ -1428,27 +1413,24 @@ fn on_stderr_line_inner(
1428
1413
MessageFormat :: Json { ansi : true , .. } => { }
1429
1414
}
1430
1415
1431
- // In some modes of execution we will execute rustc with `-Z
1432
- // emit-artifact-notifications` to look for metadata files being produced. When this
1433
- // happens we may be able to start subsequent compilations more quickly than
1434
- // waiting for an entire compile to finish, possibly using more parallelism
1435
- // available to complete a compilation session more quickly.
1416
+ // We always tell rustc to emit messages about artifacts being produced.
1417
+ // These messages feed into pipelined compilation, as well as timing
1418
+ // information.
1436
1419
//
1437
- // In these cases look for a matching directive and inform Cargo internally
1438
- // that a metadata file has been produced.
1439
- if options. look_for_metadata_directive {
1440
- #[ derive( serde:: Deserialize ) ]
1441
- struct ArtifactNotification {
1442
- artifact : String ,
1443
- }
1444
- if let Ok ( artifact) = serde_json:: from_str :: < ArtifactNotification > ( compiler_message. get ( ) ) {
1445
- log:: trace!( "found directive from rustc: `{}`" , artifact. artifact) ;
1446
- if artifact. artifact . ends_with ( ".rmeta" ) {
1447
- log:: debug!( "looks like metadata finished early!" ) ;
1448
- state. rmeta_produced ( ) ;
1449
- }
1450
- return Ok ( false ) ;
1420
+ // Look for a matching directive and inform Cargo internally that a
1421
+ // metadata file has been produced.
1422
+ #[ derive( serde:: Deserialize ) ]
1423
+ struct ArtifactNotification {
1424
+ artifact : String ,
1425
+ }
1426
+
1427
+ if let Ok ( artifact) = serde_json:: from_str :: < ArtifactNotification > ( compiler_message. get ( ) ) {
1428
+ log:: trace!( "found directive from rustc: `{}`" , artifact. artifact) ;
1429
+ if artifact. artifact . ends_with ( ".rmeta" ) {
1430
+ log:: debug!( "looks like metadata finished early!" ) ;
1431
+ state. rmeta_produced ( ) ;
1451
1432
}
1433
+ return Ok ( false ) ;
1452
1434
}
1453
1435
1454
1436
#[ derive( serde:: Deserialize ) ]
@@ -1519,7 +1501,6 @@ fn replay_output_cache(
1519
1501
let target = target. clone ( ) ;
1520
1502
let mut options = OutputOptions {
1521
1503
format,
1522
- look_for_metadata_directive : true ,
1523
1504
color,
1524
1505
cache_cell : None ,
1525
1506
show_diagnostics,
0 commit comments