From 1dc375dd0e2d21c2c570394d9ed2b6eeb9585879 Mon Sep 17 00:00:00 2001 From: Leah Amelia Chen Date: Mon, 24 Feb 2025 18:05:26 +0100 Subject: [PATCH] gtk: instruct users to install blueprint-compiler There's been *far* too many people who aren't aware of the new dependency, and that is partly our fault: a "FileNotFound" error is quite obtuse, unless you religiously follow every PR and every commit made to the repository. Instead of shepherding everyone who runs into this manually, we should offer better signposting. --- src/apprt/gtk/blueprint_compiler.zig | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/apprt/gtk/blueprint_compiler.zig b/src/apprt/gtk/blueprint_compiler.zig index f1d42c43d..15dd574e5 100644 --- a/src/apprt/gtk/blueprint_compiler.zig +++ b/src/apprt/gtk/blueprint_compiler.zig @@ -47,11 +47,23 @@ pub fn main() !void { alloc, ); - const term = try compiler.spawnAndWait(); + const term = compiler.spawnAndWait() catch |err| switch (err) { + error.FileNotFound => { + std.log.err( + \\`blueprint-compiler` not found. + \\ + \\Ghostty requires `blueprint-compiler` as a build-time dependency starting from version 1.2. + \\Please install it, ensure that it is available on your PATH, and then retry building Ghostty. + , .{}); + std.posix.exit(1); + }, + else => return err, + }; + switch (term) { .Exited => |rc| { - if (rc != 0) std.posix.exit(1); + if (rc != 0) std.process.exit(1); }, - else => std.posix.exit(1), + else => std.process.exit(1), } }