From f507748ce49f8e9ce5dc76bb7811a374c814923f Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Wed, 10 Jun 2020 18:59:48 +0200 Subject: [PATCH] x.py: with --json-output, forward cargo's JSON --- src/bootstrap/compile.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index b3999118e3de4..c09b73b042013 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs @@ -983,7 +983,13 @@ pub fn stream_cargo( for line in stdout.lines() { let line = t!(line); match serde_json::from_str::>(&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), }