Skip to content

Commit e270c2c

Browse files
committed
fix(build): improve error messages when cmake is not found
Replace bare .unwrap() calls on cmake Command invocations with expects with expressive messages.
1 parent 0eadd82 commit e270c2c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

libbitcoinkernel-sys/build.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ fn main() {
4242
.arg("-DENABLE_IPC=OFF")
4343
.arg(format!("-DCMAKE_INSTALL_PREFIX={}", install_dir.display()))
4444
.status()
45-
.unwrap();
45+
.expect("Failed to run cmake configure. Is cmake installed?");
4646

4747
let num_jobs = env::var("NUM_JOBS")
4848
.ok()
@@ -56,15 +56,15 @@ fn main() {
5656
.arg(build_config)
5757
.arg(format!("--parallel={num_jobs}"))
5858
.status()
59-
.unwrap();
59+
.expect("Failed to run cmake build.");
6060

6161
Command::new("cmake")
6262
.arg("--install")
6363
.arg(&build_dir)
6464
.arg("--config")
6565
.arg(build_config)
6666
.status()
67-
.unwrap();
67+
.expect("Failed to run cmake install.");
6868

6969
// Check if the build system used a multi-config generator
7070
let lib_dir = if install_dir.join("lib").join(build_config).exists() {

0 commit comments

Comments
 (0)