about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2021-06-07 01:06:49 +0200
committerGitHub <noreply@github.com>2021-06-07 01:06:49 +0200
commit83664bd16bbe776cca3790f8c10ccc752de50e8d (patch)
treed78dd46a9b73b2d4689e84db20ae23acfb68a8bf /src
parent85fec06617ec45bb4f941720feb785f5892d4a0b (diff)
parent3aefd77ed3a3592e0905f64921b803c89cc0fa71 (diff)
downloadrust-83664bd16bbe776cca3790f8c10ccc752de50e8d.tar.gz
rust-83664bd16bbe776cca3790f8c10ccc752de50e8d.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/lib.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
index 1ea29a829c2..21c7dd11d24 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -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