Support current macOS SDKs - #408
Merged
Merged
Conversation
Issue: Zig 0.16 builds failed after the macOS command-line tools update. The current SDK broke libproc header translation and framework linking, preventing both local builds and the Homebrew formula build. Solution: Keep the translated C surface narrow and compile the macOS libproc call through a wrapper, while resolving the active SDK for framework and system-library search and explicitly linking Objective-C for current framework stubs. Document the SDK fallback behavior and ignore local research/editor artifacts.
There was a problem hiding this comment.
🔵 Needs a closer look
The macOS-specific SDK, C ABI, and linker changes require validation on affected macOS toolchains.
Pull request overview
Updates macOS SDK integration so Zig 0.16 can build against current Apple headers and framework stubs.
Changes:
- Adds a narrow C wrapper for macOS cwd lookup.
- Resolves SDK framework/library paths and explicitly links Objective-C.
- Updates PTY declarations and SDK documentation.
Verification: No build or test results were provided.
File summaries
| File | Description |
|---|---|
build.zig |
Configures macOS targets, SDK paths, C wrapper, and linking. |
src/cwd.zig |
Uses the new cwd wrapper. |
src/c/libproc.h |
Declares the narrow wrapper API. |
src/c/libproc.c |
Implements cwd lookup against Apple headers. |
src/c/pty_macos.h |
Avoids translating the full utility header. |
docs/development.md |
Documents SDK discovery and compatibility behavior. |
docs/ARCHITECTURE.md |
Records the C-wrapper architecture decision. |
CLAUDE.md |
Updates repository guidance for the workaround. |
.gitignore |
Ignores Playwright and IDE artifacts. |
Review details
- Files reviewed: 8/9 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
After updating the macOS command-line tools, Zig 0.16 could no longer build Architect. The current SDK caused static-assertion failures while translating Apple's Mach/libproc headers and then failed to resolve
/usr/lib/libobjc.A.dylibthrough the framework stubs. The Homebrew build log also showed that the formula source in this checkout resolves tov0.70.2.Solution
Use a narrow translated libproc declaration and a compiled C wrapper for the SDK-specific implementation. Resolve the active macOS SDK once and pass its framework and system-library paths to the build, including an explicit Objective-C system library for current framework re-exports. Keep the legacy SDK workaround optional when
MacOSX15.4.sdkis unavailable, and document the behavior.Context