Skip to content

Commit 3aefd77

Browse files
committed
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.
1 parent c4c2ab5 commit 3aefd77

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Diff for: src/bootstrap/lib.rs

+7-2
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)