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.
pull/12267/head
0xDVC 2026-04-13 14:15:34 +00:00 committed by Mitchell Hashimoto
parent 2ed382a155
commit 4204dec94a
1 changed files with 1 additions and 1 deletions

View File

@ -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,