Skip to content

Build zig deps on runners with no macOS 15 SDK - #863

Merged
scgopi merged 1 commit into
mainfrom
ci/zig-sdk-on-macos-26
Oct 17, 2026
Merged

scgopi merged 1 commit into
mainfrom
ci/zig-sdk-on-macos-26

Conversation

@scgopi

@scgopi scgopi commented Oct 17, 2026

Copy link
Copy Markdown
Owner

The required macos check fails on every PR that touches macOS code. GitHub's macos-26-arm64 image 20261013 ships only macOS 26.x SDKs. Tools/zig-sdk-shim/xcrun only answers with a macOS 15 SDK, so zig gets DarwinSdkNotFound and make install-zmx panics (run 39063192993 on #859). The last passing macos run was on 2026-10-14, on image 20260828.

Fix

  • make zig-sdk, which build-zmx and build-ghostty now depend on, runs Tools/zig-sdk-shim/make-zig-sdk. It does nothing when the shim already finds a macOS 15 SDK.
  • Otherwise it builds .build/sdk/MacOSX<ver>-zig.sdk:
    • the newest 26.x SDK, seen through symlinks;
    • except usr/lib/libSystem.B.tbd, where arm64-macos is added to every document that lists only arm64e-macos. Apple's ld makes this arm64 → arm64e fallback itself; zig 0.15.2's linker doesn't.
  • The shim uses that SDK as a last resort.
  • I corrected the shim's header: it claimed only the primary libSystem document lost arm64-macos, but 34 of the 40 documents in SDK 26.5 did.
  • 26.x is preferred over 27 because zig 0.15.2's bundled libc++ doesn't compile against the macOS 27 headers (INFINITY undeclared).

RED: zig build of zmx with GRAPHCODE_ZIG_SDK=CommandLineTools MacOSX26.5.sdk -> exit 2, undefined symbol _abort, _bzero, _clock_gettime (same root cause as the CI DarwinSdkNotFound on image 20261013)
GREEN: make zig-sdk in a worktree with no macOS 15 SDK, then zig build of zmx through the shim with no override -> exit 0; zmx version 0.7.0, and a zmx run/ls/history/kill session works
GREEN: zig build of GhosttyKit through the shim with the patched SDK -> exit 0, GhosttyKit.xcframework/macos-arm64/libghostty-internal-fat.a produced
REGRESSION: make-zig-sdk with a macOS 15 SDK resolvable (GRAPHCODE_ZIG_SDK=.build/sdk/MacOSX15.4.sdk) -> exit 0, no-op; this PR's own macos job exercises the runner path

GitHub's macos-26 image 20261013 ships only macOS 26.x SDKs, so the zig SDK
shim found nothing and `make install-zmx` crashed with DarwinSdkNotFound,
failing the required macos check on every macOS PR.

make zig-sdk (a dependency of build-zmx and build-ghostty) now builds
.build/sdk/MacOSX<ver>-zig.sdk when the shim can't resolve a macOS 15 SDK:
the newest 26.x SDK through symlinks, with arm64-macos added to each
libSystem.B.tbd document that only lists arm64e-macos. The shim uses it as a
last resort, so machines with a macOS 15 SDK are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: scgopi <scgopireddy@gmail.com>
@scgopi
scgopi force-pushed the ci/zig-sdk-on-macos-26 branch from 80d6c45 to 45828aa Compare October 17, 2026 21:50
@scgopi
scgopi merged commit 29ae94e into main Oct 17, 2026
22 checks passed
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