diff options
| -rw-r--r-- | build.rs | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -61,7 +61,7 @@ fn main() { .to_string(); let zig = env::var("ZIG").unwrap_or_else(|_| "zig".into()); - let mut command = Command::new(zig); + let mut command = Command::new(&zig); command .arg("build") .arg("-Demit-lib-vt") @@ -77,7 +77,18 @@ fn main() { let status = command .current_dir(&vendored_dir) .status() - .expect("failed to execute zig build for vendored libghostty-vt"); + .unwrap_or_else(|err| { + if err.kind() == std::io::ErrorKind::NotFound { + panic!( + "zig executable not found (looked for {zig:?}; set the ZIG \ + environment variable to point at the zig binary). Building \ + the vendored libghostty-vt requires Zig 0.15.2: on macOS run \ + `brew install zig@0.15`, elsewhere install it from \ + https://ziglang.org/download/, then retry the build" + ); + } + panic!("failed to execute zig build for vendored libghostty-vt: {err}"); + }); assert!( status.success(), "zig build for vendored libghostty-vt failed: {status}" |
