mirror of
https://github.com/herdrdev/herdr.git
synced 2026-09-21 16:01:04 +00:00
fix(build): guide users when zig is missing (#2281)
build.rs now reports how to install Zig 0.15.2 (brew install zig@0.15 on macOS, ziglang.org elsewhere) and mentions the ZIG environment variable instead of panicking with a bare NotFound error. Co-authored-by: JJ Liebig <jonathan.liebig@gmail.com>
This commit is contained in:
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user