feat: macOS ARM64 support — LLVM default toolchain + CI#45
Merged
Conversation
- probe.cppm: platform-aware runtime dir discovery (macOS paths + xcrun sysroot fallback) - flags.cppm: skip -static on macOS (libSystem must be dynamic) - config.cppm: skip patchelf bootstrap on macOS (Mach-O, not ELF) - install.sh: add darwin-arm64/x86_64 platform detection + macOS sha256 compat - ci-macos.yml: lightweight macOS ARM64 smoke test workflow - Design doc: .agents/docs/2026-05-16-macos-support-design.md
xlings releases use "macosx-arm64" naming, not "macos-arm64" or "darwin-arm64".
macOS /tmp symlinks to /private/tmp which breaks find. Use explicit mktemp -d and construct the expected directory name directly.
xlings macOS binary has dyld compatibility issues with GitHub runners. Restructure CI to: 1. Use Homebrew LLVM to validate the compilation model (import std, modules) 2. Validate probe/sysroot behavior on macOS 3. Test install.sh platform detection 4. Separately check xlings binary compat (continue-on-error)
- cli.cppm: platform-aware first-run default (llvm@20.1.7 on macOS, gcc@15.1.0-musl on Linux) - cli.cppm: platform-aware error messages for MCPP_NO_AUTO_INSTALL - ci-macos.yml: full xlings → LLVM install → import std/std.compat/ multi-module E2E validation on macos-15
The macOS CI is now stable and should gate all future changes.
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.
Summary
import std、import std.compat、多模块项目Changes
核心适配
src/cli.cppm: macOS first-run 默认安装llvm@20.1.7(Linux 不变,仍为gcc@15.1.0-musl)src/toolchain/probe.cppm: 平台感知的运行时路径发现 +xcrun --show-sdk-pathsysroot fallbacksrc/build/flags.cppm: macOS 跳过-static(libSystem 必须动态链接)src/config.cppm: macOS 跳过 patchelf 引导(Mach-O 不需要 ELF patching)install.sh: 增加darwin-arm64/darwin-x86_64平台检测 + macOS sha256 兼容CI
.github/workflows/ci-macos.yml: macOS ARM64 完整 E2E 验证import std→import std.compat→ 多模块项目 → probe 逻辑验证CI 验证结果
在
macos-15(ARM64, macOS 15.7.4) 上全部通过:arm64-apple-darwin24.6.0)import std编译+运行import std.compat编译+运行Test plan
#if defined(__APPLE__)保护下)