Skip to content

Commit 0aa4ef9

Browse files
committed
Make default check stage be 1, and error out on checking with stage 0
1 parent c83e217 commit 0aa4ef9

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/bootstrap/defaults/bootstrap.library.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# These defaults are meant for contributors to the standard library and documentation.
22
[build]
33
bench-stage = 1
4-
check-stage = 1
54
test-stage = 1
65

76
[rust]

src/bootstrap/src/core/config/config.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,7 +1025,7 @@ impl Config {
10251025
|| bench_stage.is_some();
10261026

10271027
config.stage = match config.cmd {
1028-
Subcommand::Check { .. } => flags_stage.or(check_stage).unwrap_or(0),
1028+
Subcommand::Check { .. } => flags_stage.or(check_stage).unwrap_or(1),
10291029
Subcommand::Clippy { .. } | Subcommand::Fix => flags_stage.or(check_stage).unwrap_or(1),
10301030
// `download-rustc` only has a speed-up for stage2 builds. Default to stage2 unless explicitly overridden.
10311031
Subcommand::Doc { .. } => {
@@ -1052,9 +1052,16 @@ impl Config {
10521052
};
10531053

10541054
// Now check that the selected stage makes sense, and if not, print a warning and end
1055-
if let (0, Subcommand::Build) = (config.stage, &config.cmd) {
1056-
eprintln!("WARNING: cannot build anything on stage 0. Use at least stage 1.");
1057-
exit!(1);
1055+
match (config.stage, &config.cmd) {
1056+
(0, Subcommand::Build) => {
1057+
eprintln!("WARNING: cannot build anything on stage 0. Use at least stage 1.");
1058+
exit!(1);
1059+
}
1060+
(0, Subcommand::Check { .. }) => {
1061+
eprintln!("WARNING: cannot check anything on stage 0. Use at least stage 1.");
1062+
exit!(1);
1063+
}
1064+
_ => {}
10581065
}
10591066

10601067
// CI should always run stage 2 builds, unless it specifically states otherwise

0 commit comments

Comments
 (0)