From 4204dec94a45ee7ce3990af33b301053191232c5 Mon Sep 17 00:00:00 2001 From: 0xDVC Date: Mon, 13 Apr 2026 14:15:34 +0000 Subject: [PATCH] build: respect config.emit_xcframework for building libghostty-vt.xcframework on Darwin This fixes a hardcoded build issue on macOS where Zig unconditionally forces xcodebuild -create-xcframework to run during compilation, even when the caller explicitly specifies that they only want the raw standard C objects/headers (-Demit-lib-vt). The Bug: Around line 155 in build.zig, the libghostty-vt xcframework was being packaged unconditionally for Darwin builds. This caused developers (and wrappers like go-libghostty) attempting to natively build the vt library locally using only the minimal macOS Command Line Tools to experience an immediate crash, as xcodebuild -create-xcframework strictly demands a full Xcode application installation. The Fix: Guarded the GhosttyLibVt xcframework creation step with config.emit_xcframework. Because src/build/Config.zig intuitively forces emit_xcframework to default to false whenever emit_lib_vt is invoked, this structurally allows lightweight macOS builds to safely skip the xcodebuild invocation while still correctly compiling the standard .a object library files. --- build.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.zig b/build.zig index b89958e55..6fc526af2 100644 --- a/build.zig +++ b/build.zig @@ -155,7 +155,7 @@ pub fn build(b: *std.Build) !void { // libghostty-vt xcframework (Apple only, universal binary). // Only when building on macOS (not cross-compiling) since // xcodebuild is required. - if (builtin.os.tag.isDarwin() and config.target.result.os.tag.isDarwin()) { + if (config.emit_xcframework and builtin.os.tag.isDarwin() and config.target.result.os.tag.isDarwin()) { const apple_libs = try buildpkg.GhosttyLibVt.initStaticAppleUniversal( b, &config,