Skip to content

feat: macOS release — bootstrap + self-host + release workflow#46

Merged
Sunrisepeak merged 7 commits into
mainfrom
feat/macos-release
May 16, 2026
Merged

feat: macOS release — bootstrap + self-host + release workflow#46
Sunrisepeak merged 7 commits into
mainfrom
feat/macos-release

Conversation

@Sunrisepeak
Copy link
Copy Markdown
Member

Summary

Adds the infrastructure for macOS ARM64 release builds:

  1. scripts/bootstrap-macos.sh — One-shot bootstrap script that compiles mcpp from source on macOS using upstream LLVM (clang-scan-deps P1689 → topological module compilation)
  2. release.yml — macOS ARM64 release job (bootstrap → self-host → package → upload)
  3. ci-macos.yml — Adds bootstrap + self-host validation steps
  4. mcpp.toml — Declares macos = "llvm@20.1.7"

How it works

The macOS bootstrap solves the chicken-and-egg problem (mcpp builds mcpp):

  1. bootstrap-macos.sh uses clang-scan-deps to discover module dependencies
  2. Python script does topological sort and compiles modules in order
  3. Produces target/bootstrap/bin/mcpp
  4. That bootstrap mcpp then self-hosts: mcpp build → final release binary

Test plan

  • ci-macos passes (bootstrap + self-host)
  • Linux CI unaffected
  • After merge: workflow_dispatch on release.yml produces darwin-arm64 tarball

- mcpp.toml: add `macos = "llvm@20.1.7"` toolchain declaration
- scripts/bootstrap-macos.sh: one-shot bootstrap compiler for macOS
  (uses clang-scan-deps P1689 + topological module compilation)
- release.yml: add macOS ARM64 job (bootstrap → self-host → package)
- ci-macos.yml: add bootstrap + self-host validation steps
clang-scan-deps P1689 output format was unreliable. Replace with direct
source scanning for export module/import declarations + topological sort.
Simpler and more portable.
mcpp depends on mcpplibs.cmdline for argument parsing. The bootstrap
script now downloads and includes it in the module compilation.
- Scanner regex now matches ':' in module names for partition syntax
- Resolves `import :options;` → `<current_module>:options`
- Partitions tracked as separate compilation units with full names
…lation)

xmake has mature C++23 module support and handles dependency scanning,
topological ordering, and partition compilation automatically. This is
far more reliable than the manual regex-based approach.

Based on github.com/Sunrisepeak/mcpp-dev xmake.lua pattern.
mcpp build generates a build.ninja that calls `mcpp dyndep` — the
bootstrapped binary must be on PATH for ninja to find it.
Standalone workflow_dispatch to produce the first macOS ARM64 mcpp
binary via xmake. References the proven xlings release pattern:
xlings install → LLVM → xmake build → package.

Once this produces a working binary, it can be uploaded as a release
asset and used for subsequent self-host builds.
@Sunrisepeak Sunrisepeak merged commit a57e128 into main May 16, 2026
1 check failed
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