Skip to content

Support current macOS SDKs - #408

Merged
forketyfork merged 1 commit into
mainfrom
fix/macos-sdk-build
Sep 12, 2026
Merged

Support current macOS SDKs#408
forketyfork merged 1 commit into
mainfrom
fix/macos-sdk-build

Conversation

@forketyfork

Copy link
Copy Markdown
Owner

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.dylib through the framework stubs. The Homebrew build log also showed that the formula source in this checkout resolves to v0.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.sdk is unavailable, and document the behavior.

Context

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.
@forketyfork
forketyfork requested a balanced review from Copilot September 12, 2026 14:12
@forketyfork
forketyfork marked this pull request as ready for review September 12, 2026 14:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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.

@forketyfork
forketyfork merged commit af9955d into main Sep 12, 2026
5 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.

2 participants