Skip to content

Commit ac8920f

Browse files
committed
Do not allow building anything on stage 0
1 parent 9e08d87 commit ac8920f

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
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-
build-stage = 1
54
check-stage = 1
65
test-stage = 1
76

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,7 @@ impl Config {
10231023
|| install_stage.is_some()
10241024
|| check_stage.is_some()
10251025
|| bench_stage.is_some();
1026-
// See https://github.com/rust-lang/compiler-team/issues/326
1026+
10271027
config.stage = match config.cmd {
10281028
Subcommand::Check { .. } => flags_stage.or(check_stage).unwrap_or(0),
10291029
Subcommand::Clippy { .. } | Subcommand::Fix => flags_stage.or(check_stage).unwrap_or(1),
@@ -1051,6 +1051,12 @@ impl Config {
10511051
| Subcommand::Vendor { .. } => flags_stage.unwrap_or(0),
10521052
};
10531053

1054+
// 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);
1058+
}
1059+
10541060
// CI should always run stage 2 builds, unless it specifically states otherwise
10551061
#[cfg(not(test))]
10561062
if flags_stage.is_none() && config.is_running_on_ci {

0 commit comments

Comments
 (0)