Skip to content

Commit

Permalink
Auto merge of #96659 - thatzopoulos:issue-90679-fix, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bors committed May 8, 2022
2 parents 30046ce + bdca737 commit 4c09a33
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/bootstrap/sanity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4c09a33

Please sign in to comment.