Skip to content

Commit f507748

Browse files
committed
x.py: with --json-output, forward cargo's JSON
1 parent bb86748 commit f507748

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/bootstrap/compile.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,13 @@ pub fn stream_cargo(
983983
for line in stdout.lines() {
984984
let line = t!(line);
985985
match serde_json::from_str::<CargoMessage<'_>>(&line) {
986-
Ok(msg) => cb(msg),
986+
Ok(msg) => {
987+
if builder.config.json_output {
988+
// Forward JSON to stdout.
989+
println!("{}", line);
990+
}
991+
cb(msg)
992+
}
987993
// If this was informational, just print it out and continue
988994
Err(_) => println!("{}", line),
989995
}

0 commit comments

Comments
 (0)