Skip to content

Commit

Permalink
x.py: with --json-output, forward cargo's JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Jun 10, 2020
1 parent bb86748 commit f507748
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 f507748

Please sign in to comment.