Skip to content

Commit 5805538

Browse files
committed
Rollup merge of rust-lang#48558 - Mark-Simulacrum:error-format, r=Manishearth
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
2 parents 8b3b254 + 9c80019 commit 5805538

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Diff for: src/bootstrap/compile.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1007,6 +1007,10 @@ pub fn run_cargo(build: &Build, cargo: &mut Command, stamp: &Path, is_check: boo
10071007
continue
10081008
};
10091009
if json["reason"].as_str() != Some("compiler-artifact") {
1010+
if build.config.rustc_error_format.as_ref().map_or(false, |e| e == "json") {
1011+
// most likely not a cargo message, so let's send it out as well
1012+
println!("{}", line);
1013+
}
10101014
continue
10111015
}
10121016
for filename in json["filenames"].as_array().unwrap() {

Diff for: src/bootstrap/flags.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`");
119119
opts.optopt("", "src", "path to the root of the rust checkout", "DIR");
120120
opts.optopt("j", "jobs", "number of jobs to run in parallel", "JOBS");
121121
opts.optflag("h", "help", "print this help message");
122-
opts.optflag("", "error-format", "rustc error format");
122+
opts.optopt("", "error-format", "rustc error format", "FORMAT");
123123

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

0 commit comments

Comments
 (0)