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 https://github.com/rust-lang/rust/issues/84938.
This commit is contained in:
Guillaume Gomez 2021-06-07 01:06:49 +02:00 committed by GitHub
commit 83664bd16b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -444,8 +444,13 @@ impl Build {
build.verbose("finding compilers");
cc_detect::find(&mut build);
build.verbose("running sanity check");
sanity::check(&mut build);
// When running `setup`, the profile is about to change, so any requirements we have now may
// be different on the next invocation. Don't check for them until the next time x.py is
// run. This is ok because `setup` never runs any build commands, so it won't fail if commands are missing.
if !matches!(build.config.cmd, Subcommand::Setup { .. }) {
build.verbose("running sanity check");
sanity::check(&mut build);
}
// If local-rust is the same major.minor as the current version, then force a
// local-rebuild