Skip to content

Commit

Permalink
Rollup merge of #73219 - RalfJung:cargo-json, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
x.py: with --json-output, forward cargo's JSON

Fixes #73209

r? @Mark-Simulacrum
  • Loading branch information
Dylan-DPC authored Jun 11, 2020
2 parents 822bb9a + f507748 commit ba0a8d2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,13 @@ pub fn stream_cargo(
for line in stdout.lines() {
let line = t!(line);
match serde_json::from_str::<CargoMessage<'_>>(&line) {
Ok(msg) => cb(msg),
Ok(msg) => {
if builder.config.json_output {
// Forward JSON to stdout.
println!("{}", line);
}
cb(msg)
}
// If this was informational, just print it out and continue
Err(_) => println!("{}", line),
}
Expand Down

0 comments on commit ba0a8d2

Please sign in to comment.