File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -417,7 +417,7 @@ fn cargo_build(matches: &ArgMatches, metadata: &Metadata) -> Result<Option<Artif
417
417
let ( build_type, verbose) = cargo_build_args ( matches, & mut cargo) ;
418
418
let quiet = matches. get_flag ( "quiet" ) ;
419
419
420
- cargo. arg ( "--message-format=json" ) ;
420
+ cargo. arg ( "--message-format=json-diagnostic-rendered-ansi " ) ;
421
421
cargo. stdout ( Stdio :: piped ( ) ) ;
422
422
423
423
if verbose > 0 {
@@ -431,9 +431,6 @@ fn cargo_build(matches: &ArgMatches, metadata: &Metadata) -> Result<Option<Artif
431
431
let messages = Message :: parse_stream ( stdout) . collect :: < Vec < _ > > ( ) ;
432
432
433
433
let status = child. wait ( ) ?;
434
- if !status. success ( ) {
435
- bail ! ( "Failed to parse crate metadata" ) ;
436
- }
437
434
438
435
let mut target_artifact: Option < Artifact > = None ;
439
436
for message in messages {
@@ -460,6 +457,10 @@ fn cargo_build(matches: &ArgMatches, metadata: &Metadata) -> Result<Option<Artif
460
457
}
461
458
}
462
459
460
+ if !status. success ( ) {
461
+ bail ! ( "Failed to parse crate metadata" ) ;
462
+ }
463
+
463
464
if target_artifact. is_none ( ) {
464
465
bail ! ( "Could not determine the wanted artifact" ) ;
465
466
}
You can’t perform that action at this time.
0 commit comments