summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-09-23 22:19:24 +0000
committerbors <bors@rust-lang.org>2024-09-23 22:19:24 +0000
commit35daf8b8aa95dee4296bad117c4cb7ecaea7bf4f (patch)
tree749d2a1ee531f34f3818bd640df9f0c0d08dda7f
parent7042c269c166191cd5d8daf0409890903df7af57 (diff)
parentf6d3cd73458ca5e9fca2e4fbf08c31b44fc15358 (diff)
downloadrust-35daf8b8aa95dee4296bad117c4cb7ecaea7bf4f.tar.gz
rust-35daf8b8aa95dee4296bad117c4cb7ecaea7bf4f.zip
Auto merge of #130620 - onur-ozkan:update-make-prepare, r=Kobzol
remove workaround for make prepare and use dry-run build instead

Removes an annoying hard-coded logic.

try-job: x86_64-msvc
-rw-r--r--src/bootstrap/mk/Makefile.in2
-rw-r--r--src/bootstrap/src/core/sanity.rs25
-rw-r--r--src/bootstrap/src/lib.rs9
3 files changed, 14 insertions, 22 deletions
diff --git a/src/bootstrap/mk/Makefile.in b/src/bootstrap/mk/Makefile.in
index 3fa2b3c2292..92c8f5dc452 100644
--- a/src/bootstrap/mk/Makefile.in
+++ b/src/bootstrap/mk/Makefile.in
@@ -95,7 +95,7 @@ install:
 tidy:
 	$(Q)$(BOOTSTRAP) test --stage 2 src/tools/tidy $(BOOTSTRAP_ARGS)
 prepare:
-	$(Q)$(BOOTSTRAP) build --stage 2 nonexistent/path/to/trigger/cargo/metadata
+	$(Q)$(BOOTSTRAP) build --stage 2 --dry-run
 
 ## MSVC native builders
 
diff --git a/src/bootstrap/src/core/sanity.rs b/src/bootstrap/src/core/sanity.rs
index 5425739c56f..888ba8e2a3f 100644
--- a/src/bootstrap/src/core/sanity.rs
+++ b/src/bootstrap/src/core/sanity.rs
@@ -294,19 +294,19 @@ than building it.
         }
     }
 
-    for host in &build.hosts {
-        if !build.config.dry_run() {
+    if !build.config.dry_run() {
+        for host in &build.hosts {
             cmd_finder.must_have(build.cxx(*host).unwrap());
-        }
 
-        if build.config.llvm_enabled(*host) {
-            // Externally configured LLVM requires FileCheck to exist
-            let filecheck = build.llvm_filecheck(build.build);
-            if !filecheck.starts_with(&build.out)
-                && !filecheck.exists()
-                && build.config.codegen_tests
-            {
-                panic!("FileCheck executable {filecheck:?} does not exist");
+            if build.config.llvm_enabled(*host) {
+                // Externally configured LLVM requires FileCheck to exist
+                let filecheck = build.llvm_filecheck(build.build);
+                if !filecheck.starts_with(&build.out)
+                    && !filecheck.exists()
+                    && build.config.codegen_tests
+                {
+                    panic!("FileCheck executable {filecheck:?} does not exist");
+                }
             }
         }
     }
@@ -355,7 +355,8 @@ than building it.
             // There are three builds of cmake on windows: MSVC, MinGW, and
             // Cygwin. The Cygwin build does not have generators for Visual
             // Studio, so detect that here and error.
-            let out = command("cmake").arg("--help").run_capture_stdout(build).stdout();
+            let out =
+                command("cmake").arg("--help").run_always().run_capture_stdout(build).stdout();
             if !out.contains("Visual Studio") {
                 panic!(
                     "
diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs
index 88122237858..7bf5b4e23d2 100644
--- a/src/bootstrap/src/lib.rs
+++ b/src/bootstrap/src/lib.rs
@@ -596,15 +596,6 @@ impl Build {
             _ => (),
         }
 
-        {
-            let builder = builder::Builder::new(self);
-            if let Some(path) = builder.paths.first() {
-                if path == Path::new("nonexistent/path/to/trigger/cargo/metadata") {
-                    return;
-                }
-            }
-        }
-
         if !self.config.dry_run() {
             {
                 // We first do a dry-run. This is a sanity-check to ensure that