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
1@@ -32,6 +32,11 @@ pub fn build(b: *std.Build) void {
2 const dep = b.dependency("ghostty", .{
3 .target = target,
4 .optimize = optimize,
5+ .@"emit-lib-vt" = true,
6+ // Not redundant: in lib-vt mode emit-xcframework defaults to "xcodebuild
7+ // on PATH" (true even via the CLT stub), which pulls in the iOS SDK at
8+ // configure time and breaks builds without full Xcode.
9+ .@"emit-xcframework" = false,
10 });
11 exe_mod.addImport(
12 "ghostty-vt",
13@@ -66,6 +71,8 @@ pub fn build(b: *std.Build) void {
14 const test_dep = b.dependency("ghostty", .{
15 .target = target,
16 .optimize = optimize,
17+ .@"emit-lib-vt" = true,
18+ .@"emit-xcframework" = false,
19 });
20 test_module.addImport(
21 "ghostty-vt",
22@@ -117,6 +124,8 @@ pub fn build(b: *std.Build) void {
23 if (b.lazyDependency("ghostty", .{
24 .target = resolved,
25 .optimize = .ReleaseSafe,
26+ .@"emit-lib-vt" = true,
27+ .@"emit-xcframework" = false,
28 })) |release_dep| {
29 release_mod.addImport("ghostty-vt", release_dep.module("ghostty-vt"));
30 }