feat: macOS release — bootstrap + self-host + release workflow#46
Merged
Conversation
- 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.
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
Adds the infrastructure for macOS ARM64 release builds:
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)release.yml— macOS ARM64 release job (bootstrap → self-host → package → upload)ci-macos.yml— Adds bootstrap + self-host validation stepsmcpp.toml— Declaresmacos = "llvm@20.1.7"How it works
The macOS bootstrap solves the chicken-and-egg problem (mcpp builds mcpp):
bootstrap-macos.shuses clang-scan-deps to discover module dependenciestarget/bootstrap/bin/mcppmcpp build→ final release binaryTest plan
workflow_dispatchon release.yml produces darwin-arm64 tarball