Skip to content

Commit 83664bd

Browse files
Rollup merge of #84940 - jyn514:ninja, r=Mark-Simulacrum
Don't run sanity checks for `x.py setup` These requirements change as soon as the command finishes running, and `setup` doesn't build anything, so the check doesn't make sense. Previously, `x.py setup` would give hard errors if `ninja` and `cmake` were not installed, even if the new profile didn't require them. Fixes #84938.
2 parents 85fec06 + 3aefd77 commit 83664bd

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/bootstrap/lib.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,13 @@ impl Build {
444444

445445
build.verbose("finding compilers");
446446
cc_detect::find(&mut build);
447-
build.verbose("running sanity check");
448-
sanity::check(&mut build);
447+
// When running `setup`, the profile is about to change, so any requirements we have now may
448+
// be different on the next invocation. Don't check for them until the next time x.py is
449+
// run. This is ok because `setup` never runs any build commands, so it won't fail if commands are missing.
450+
if !matches!(build.config.cmd, Subcommand::Setup { .. }) {
451+
build.verbose("running sanity check");
452+
sanity::check(&mut build);
453+
}
449454

450455
// If local-rust is the same major.minor as the current version, then force a
451456
// local-rebuild

0 commit comments

Comments
 (0)