From 17aab60d6ffedf46564cf3ac40e91b55282201e7 Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Fri, 20 Sep 2024 17:31:36 +0300 Subject: [PATCH 1/3] remove workaround for make prepare and use dry-run build instead Signed-off-by: onur-ozkan --- src/bootstrap/mk/Makefile.in | 2 +- src/bootstrap/src/lib.rs | 9 --------- 2 files changed, 1 insertion(+), 10 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/lib.rs b/src/bootstrap/src/lib.rs index 4ed2c72fd55..0dfa0442ec1 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 From 37ce36f130267a4d2dedc3ec143af4e5520a1fbc Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Fri, 20 Sep 2024 18:25:01 +0300 Subject: [PATCH 2/3] skip `FileCheck` check when running in dry-run mode Signed-off-by: onur-ozkan --- src/bootstrap/src/core/sanity.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/bootstrap/src/core/sanity.rs b/src/bootstrap/src/core/sanity.rs index e0790c5bf70..2e3b913ba95 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"); + } } } } From f6d3cd73458ca5e9fca2e4fbf08c31b44fc15358 Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Mon, 23 Sep 2024 19:47:12 +0300 Subject: [PATCH 3/3] invoke cmake check with `run_always` Signed-off-by: onur-ozkan --- src/bootstrap/src/core/sanity.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/src/core/sanity.rs b/src/bootstrap/src/core/sanity.rs index 2e3b913ba95..be8d12feba4 100644 --- a/src/bootstrap/src/core/sanity.rs +++ b/src/bootstrap/src/core/sanity.rs @@ -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!( "