discover Xcode and Swift toolchain instead of hardcoding Xcode.app #37

Open
opened 2026-05-22 10:44:13 +00:00 by rc · 0 comments
Owner

Finding:
Build portability is narrow.

Problem:

  • build.zig hardcodes /Applications/Xcode.app/Contents/Developer.
  • README says Apple Command Line Tools are enough.
  • The manual Swift runtime library list is likely fragile across Xcode/Swift versions.

Impact:

  • Builds can fail on systems using only Command Line Tools, nonstandard Xcode paths, beta Xcodes, or xcode-select-selected developer dirs.
  • Manual Swift runtime linkage may need churn as Apple changes the SDK/toolchain.

Suggested fix:

  • Discover developer tools through xcrun and/or xcode-select -p.
  • Resolve swiftc, SDK path, and framework paths from the selected developer directory.
  • Reduce manual Swift runtime linkage if Zig/Swift tooling can do more of it automatically.
  • Make the README match the actual toolchain requirement.

Relevant code:

  • build.zig: hardcoded Xcode path and Swift library list.
  • README.md: requirements mention Command Line Tools.
Finding: Build portability is narrow. Problem: - `build.zig` hardcodes `/Applications/Xcode.app/Contents/Developer`. - README says Apple Command Line Tools are enough. - The manual Swift runtime library list is likely fragile across Xcode/Swift versions. Impact: - Builds can fail on systems using only Command Line Tools, nonstandard Xcode paths, beta Xcodes, or xcode-select-selected developer dirs. - Manual Swift runtime linkage may need churn as Apple changes the SDK/toolchain. Suggested fix: - Discover developer tools through `xcrun` and/or `xcode-select -p`. - Resolve `swiftc`, SDK path, and framework paths from the selected developer directory. - Reduce manual Swift runtime linkage if Zig/Swift tooling can do more of it automatically. - Make the README match the actual toolchain requirement. Relevant code: - `build.zig`: hardcoded Xcode path and Swift library list. - `README.md`: requirements mention Command Line Tools.
Sign in to join this conversation.
No labels
highprio
lowprio
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rc/vmz#37
No description provided.