about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-05-08 08:45:20 +0000
committerbors <bors@rust-lang.org>2022-05-08 08:45:20 +0000
commit4c09a3345ab10b9a10a284cea1a1f3673bc9a414 (patch)
treea6366b9752e14d4475573861e92056622f70bb1d
parent30046ce1fe8d00e576cc7b91404c7cf79aaa5a3b (diff)
parentbdca7376fd9f800f57b2ee17d95af3b327baa332 (diff)
downloadrust-4c09a3345ab10b9a10a284cea1a1f3673bc9a414.tar.gz
rust-4c09a3345ab10b9a10a284cea1a1f3673bc9a414.zip
Auto merge of #96659 - thatzopoulos:issue-90679-fix, r=Mark-Simulacrum
Improve error for missing cmake

This PR updates the error message for a missing `cmake` to be more in line with the error message for a missing installation of `ninja`.
The original issue, (#90679), suggests that both `ninja` and `cmake` are only needed for building LLVM, so I have included the suggestion from `ninja` to set `download-ci-llvm = true` if the user would rather download LLVM. If `cmake` actually is used in other areas, I can remove that part of the message.

Fixes: #90679
-rw-r--r--src/bootstrap/sanity.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs
index c96e6f9a367..64c5dd7aea7 100644
--- a/src/bootstrap/sanity.rs
+++ b/src/bootstrap/sanity.rs
@@ -94,7 +94,18 @@ pub fn check(build: &mut Build) {
             .any(|build_llvm_ourselves| build_llvm_ourselves);
     let need_cmake = building_llvm || build.config.any_sanitizers_enabled();
     if need_cmake {
-        cmd_finder.must_have("cmake");
+        if cmd_finder.maybe_have("cmake").is_none() {
+            eprintln!(
+                "
+Couldn't find required command: cmake
+
+You should install cmake, or set `download-ci-llvm = true` in the
+`[llvm]` section section of `config.toml` to download LLVM rather
+than building it.
+"
+            );
+            std::process::exit(1);
+        }
     }
 
     build.config.python = build