Commit 4e2d02b

Simon Hartcher  ·  2026-06-28 09:18:42 -0400 EDT
parent 4c2924c
fix: build ghostty as libghostty-vt only to drop iOS SDK requirement (#181)

zmx only needs the ghostty-vt module, but b.dependency("ghostty", ...)
runs ghostty's full build(), which constructs an XCFramework and resolves
the iOS SDK at configure time via LibCInstallation.findNative. That fails
on machines with only the Command Line Tools installed (no iOS SDK), with
error.DarwinSdkNotFound.

Pass emit-lib-vt=true and emit-xcframework=false at all three ghostty
dependency call sites so ghostty builds the VT library only and skips the
macOS app / iOS XCFramework graph. emit-xcframework must be forced off
because in lib-vt mode it defaults to whether xcodebuild is on PATH, which
is true even with the (non-functional) Command Line Tools stub.
1 files changed,  +9, -0
+9, -0
......@@ -32,6 +32,11 @@ pub fn build(b: *std.Build) void {
3232 const dep = b.dependency("ghostty", .{
3333 .target = target,
3434 .optimize = optimize,
35+ .@"emit-lib-vt" = true,
36+ // Not redundant: in lib-vt mode emit-xcframework defaults to "xcodebuild
37+ // on PATH" (true even via the CLT stub), which pulls in the iOS SDK at
38+ // configure time and breaks builds without full Xcode.
39+ .@"emit-xcframework" = false,
3540 });
3641 exe_mod.addImport(
3742 "ghostty-vt",
......@@ -66,6 +71,8 @@ pub fn build(b: *std.Build) void {
6671 const test_dep = b.dependency("ghostty", .{
6772 .target = target,
6873 .optimize = optimize,
74+ .@"emit-lib-vt" = true,
75+ .@"emit-xcframework" = false,
6976 });
7077 test_module.addImport(
7178 "ghostty-vt",
......@@ -117,6 +124,8 @@ pub fn build(b: *std.Build) void {
117124 if (b.lazyDependency("ghostty", .{
118125 .target = resolved,
119126 .optimize = .ReleaseSafe,
127+ .@"emit-lib-vt" = true,
128+ .@"emit-xcframework" = false,
120129 })) |release_dep| {
121130 release_mod.addImport("ghostty-vt", release_dep.module("ghostty-vt"));
122131 }