Skip to content

gterm: build the ghostty engine under Xcode 27 - #46

Merged
madeye merged 1 commit into
mainfrom
fix/xcode-27-engine-build
Sep 15, 2026
Merged

madeye merged 1 commit into
mainfrom
fix/xcode-27-engine-build

Conversation

@madeye

@madeye madeye commented Sep 15, 2026

Copy link
Copy Markdown
Owner

Summary

After upgrading to macOS 27.0 / Xcode 27.0 (27A266a), scripts/build-ghostty-xcframework.sh failed:

libcxx/include/__random/clamp_to_integral.h:47:58: use of undeclared identifier 'INFINITY'
error: sub-compilation of libcxx failed

The macOS 27 SDK's math.h now defers INFINITY/NAN to the compiler's float.h through clang's __need_infinity_nan protocol (LLVM PR #164348; LLVM 22 and Apple clang 21). Zig 0.15 ships LLVM 20 headers without it, so building zig's bundled libc++ against the new SDK breaks.

  • Add patch_zig_float_h to the engine build script: idempotently implements the protocol in zig's bundled float.h (backup kept as float.h.orig), in the same style as the existing libxev patch. No-op on older SDKs or once zig carries the fix.
  • Document the quirk in CLAUDE.md.

Verification (Xcode 27.0, iOS 27.0 SDK and runtime)

  • Engine: ./scripts/build-ghostty-xcframework.sh produces all three slices.
  • App: simulator build succeeded against the rebuilt engine.
  • gtermTests: 107 tests, 0 failures.
  • scripts/test-ipad-ui.py (iPad Pro 11-inch M5, iOS 27.0): 3 passed.
  • scripts/test-ipad-ui.py --device-type "iPhone 17 Pro Max" (iOS 27.0): 2 passed.

Not covered: the iPhone Duo simulator. It ships only with Xcode 27.1, which Apple has not released yet (the releases feed lists Xcode 27 27A266a as newest, and simctl has no Duo device type).

https://claude.ai/code/session_011AGnzfZpK9Jvx13DcS97DZ

The macOS 27 SDK's math.h defers INFINITY/NAN to the compiler's float.h
via clang's __need_infinity_nan protocol (LLVM PR #164348, LLVM 22 and
Apple clang 21). Zig 0.15 bundles LLVM 20 headers, so its libc++
sub-compilation failed with "use of undeclared identifier 'INFINITY'"
in __random/clamp_to_integral.h and the xcframework build stopped.

Add patch_zig_float_h to build-ghostty-xcframework.sh: it idempotently
implements the protocol in zig's bundled float.h (backup kept as
float.h.orig) before compiling, mirroring the existing libxev patch.
No-op on older SDKs and when zig already handles it.

Claude-Session: https://claude.ai/code/session_011AGnzfZpK9Jvx13DcS97DZ
@madeye
madeye merged commit c17c46a into main Sep 15, 2026
1 check passed
@madeye
madeye deleted the fix/xcode-27-engine-build branch September 15, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant