Skip to content

Commit

Permalink
Rollup merge of rust-lang#48558 - Mark-Simulacrum:error-format, r=Man…
Browse files Browse the repository at this point in the history
…ishearth

Fix error-format to properly send JSON to stdout

Since we take Cargo's JSON messages as well we need to specifically send
rustc's messages out so we don't hide them.

r? @Manishearth
  • Loading branch information
kennytm committed Feb 28, 2018
2 parents 59ab146 + 9c80019 commit 4b4cd47
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,10 @@ pub fn run_cargo(build: &Build, cargo: &mut Command, stamp: &Path, is_check: boo
continue
};
if json["reason"].as_str() != Some("compiler-artifact") {
if build.config.rustc_error_format.as_ref().map_or(false, |e| e == "json") {
// most likely not a cargo message, so let's send it out as well
println!("{}", line);
}
continue
}
for filename in json["filenames"].as_array().unwrap() {
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`");
opts.optopt("", "src", "path to the root of the rust checkout", "DIR");
opts.optopt("j", "jobs", "number of jobs to run in parallel", "JOBS");
opts.optflag("h", "help", "print this help message");
opts.optflag("", "error-format", "rustc error format");
opts.optopt("", "error-format", "rustc error format", "FORMAT");

// fn usage()
let usage = |exit_code: i32, opts: &Options, subcommand_help: &str, extra_help: &str| -> ! {
Expand Down

0 comments on commit 4b4cd47

Please sign in to comment.