Skip to content

Commit 2b42a2b

Browse files
Forbid stage arguments to check
Users generally expect that check builds are fast, and that's only true in stage 0 (stages beyond that need us to build a compiler, which is slow).
1 parent 750db09 commit 2b42a2b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/bootstrap/flags.rs

+14
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,20 @@ Arguments:
503503
}
504504
};
505505

506+
if let Subcommand::Check { .. } = &cmd {
507+
if matches.opt_str("stage").is_some() {
508+
println!("{}", "--stage not supported for x.py check, always treated as stage 0");
509+
process::exit(1);
510+
}
511+
if matches.opt_str("keep-stage").is_some() {
512+
println!(
513+
"{}",
514+
"--keep-stage not supported for x.py check, only one stage available"
515+
);
516+
process::exit(1);
517+
}
518+
}
519+
506520
Flags {
507521
verbose: matches.opt_count("verbose"),
508522
stage: matches.opt_str("stage").map(|j| j.parse().expect("`stage` should be a number")),

0 commit comments

Comments
 (0)