Skip to content

Commit 283622c

Browse files
fix: align macOS install asset support (#51)
1 parent b5ce5b1 commit 283622c

5 files changed

Lines changed: 48 additions & 15 deletions

File tree

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
## 为什么选择 mcpp
2424

25-
mcpp 专门为 **C++23 模块化开发** 打造。如果你想在项目中使用 `import std`、模块接口单元(`.cppm`)、模块分区等现代 C++ 特性,mcpp 在 Linux 上能为你提供便捷且友好的开发体验:
25+
mcpp 专门为 **C++23 模块化开发** 打造。如果你想在项目中使用 `import std`、模块接口单元(`.cppm`)、模块分区等现代 C++ 特性,mcpp 在 Linux 和 macOS ARM64 上能为你提供便捷且友好的开发体验:
2626

2727
- **默认模块化**`mcpp new` 创建的项目模板直接使用 C++23 模块,`import std` 开箱即用
2828
- **文件级增量构建** — 基于 P1689 dyndep 的三层优化(前端脏检查 + 逐文件扫描 + BMI restat),只重编真正变化的模块
@@ -181,10 +181,10 @@ import mcpplibs.cmdline;
181181
<details>
182182
<summary><b>打包与发布</b></summary>
183183

184-
- `mcpp pack`三种模式 — static(musl全静态)/ bundle-project / bundle-all
185-
- musl 全静态二进制:单文件可分发,无 glibc 依赖
184+
- `mcpp pack`三种 Linux 发布模式 — static(musl全静态)/ bundle-project / bundle-all
185+
- musl 全静态二进制:单文件可分发,无 glibc 依赖(Linux x86_64)
186186
- `mcpp publish`:生成 xpkg.lua + 发布到包索引
187-
- 自动 patchelf 修正 RPATH
187+
- 自动 patchelf 修正 RPATH(Linux)
188188

189189
</details>
190190

@@ -207,12 +207,14 @@ import mcpplibs.cmdline;
207207
|------------------|:-----------:|:----------:|:------------:|:----:|
208208
| Linux x86_64 ||*默认* |||
209209
| Linux aarch64 | 🔄 | 🔄 | 🔄 ||
210-
| macOS ||| 🔄 ||
210+
| macOS arm64 |||*默认* ||
211+
| macOS x86_64 ||| 🔄 ||
211212
| Windows ||| 🔄 | 🔄 |
212213

213214
✅ 已支持 | 🔄 计划中
214215

215-
> *默认*:release 二进制走 musl 全静态,Linux x86_64 可直接运行,无 glibc 依赖。
216+
> *默认*:Linux 默认工具链为 musl-gcc,release 二进制走 musl 全静态;
217+
> macOS ARM64 默认工具链为 LLVM/Clang。
216218
217219
## 文档
218220

docs/00-getting-started.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
55
## 安装
66

7-
仅需 Linux x86_64 环境,无需预先安装 GCC、xlings 或其他依赖。
8-
mcpp 在首次运行时会将 musl-gcc 工具链安装至独立沙盒(`~/.mcpp/`)。
7+
仅需 Linux x86_64 或 macOS ARM64 环境,无需预先安装 GCC、xlings 或其他依赖。
8+
mcpp 在首次运行时会将默认工具链安装至独立沙盒(`~/.mcpp/`)。
9+
Linux 默认使用 musl-gcc,macOS 默认使用 LLVM/Clang。
910

1011
推荐通过 [xlings](https://xlings.d2learn.org) 进行安装,可与系统
1112
环境保持隔离:
@@ -74,8 +75,8 @@ mcpp run
7475
# Built with import std + std::println on modular C++23.
7576
```
7677

77-
首次构建需下载默认工具链(musl-gcc 15.1,约 800 MB),期间显示进度
78-
与速度。下载完成后,所有 mcpp 项目共用同一份沙盒。
78+
首次构建需下载默认工具链(Linux 为 musl-gcc 15.1,macOS 为 LLVM/Clang 20.1),
79+
期间显示进度与速度。下载完成后,所有 mcpp 项目共用同一份沙盒。
7980

8081
## 增量编译与测试
8182

docs/03-toolchains.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,17 @@ C++23 模块对编译器版本较为敏感,不同版本的 GCC / Clang 在模块
1212

1313
## 自动安装
1414

15-
首次运行 `mcpp build` 时,若尚未配置工具链,mcpp 会自动安装一份
16-
musl-gcc 15.1(适用于全静态构建)并将其设为全局默认:
15+
首次运行 `mcpp build` 时,若尚未配置工具链,mcpp 会自动安装当前平台
16+
的默认工具链并将其设为全局默认:
1717

1818
```
1919
First run no toolchain configured — installing gcc@15.1.0-musl (musl, static) as default
2020
Downloading xim:musl-gcc@15.1.0 [====> ] 312 MB / 808 MB 3.7 MB/s
2121
Default set to gcc@15.1.0-musl
2222
```
2323

24+
Linux 默认使用 `gcc@15.1.0-musl`; macOS 默认使用 `llvm@20.1.7`
25+
2426
后续构建不再触发该流程。
2527

2628
> [!TIP]
@@ -34,6 +36,7 @@ Default set to gcc@15.1.0-musl
3436
mcpp toolchain install gcc 16.1.0 # GNU libc,适用于动态链接默认场景
3537
mcpp toolchain install gcc 15.1.0-musl # musl libc,适用于全静态构建
3638
mcpp toolchain install musl-gcc 15.1.0 # 等价于上一条
39+
mcpp toolchain install llvm 20.1.7 # LLVM/Clang,macOS 默认工具链
3740
```
3841

3942
版本号支持部分匹配:

install.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,10 @@ uname_s=$(uname -s)
2727
uname_m=$(uname -m)
2828
case "${uname_s}-${uname_m}" in
2929
Linux-x86_64) PLAT="linux-x86_64" ;;
30-
Darwin-arm64) PLAT="darwin-arm64" ;;
31-
Darwin-x86_64) PLAT="darwin-x86_64" ;;
30+
Darwin-arm64) PLAT="macosx-arm64" ;;
3231
*)
3332
echo "error: unsupported platform ${uname_s}-${uname_m}." >&2
34-
echo " Currently supported: linux-x86_64, darwin-arm64, darwin-x86_64." >&2
33+
echo " Currently supported: linux-x86_64, macosx-arm64." >&2
3534
echo " Build from source instead:" >&2
3635
echo " https://github.com/${REPO}#从源码构建开发者" >&2
3736
exit 1
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env bash
2+
# 45_install_platform_mapping.sh — install.sh platform IDs must match release assets.
3+
4+
set -euo pipefail
5+
6+
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
7+
INSTALL_SH="$ROOT/install.sh"
8+
RELEASE_YML="$ROOT/.github/workflows/release.yml"
9+
10+
grep -q 'Darwin-arm64).*PLAT="macosx-arm64"' "$INSTALL_SH" || {
11+
echo "FAIL: Darwin-arm64 must map to the released macosx-arm64 asset"
12+
exit 1
13+
}
14+
15+
! grep -q 'Darwin-x86_64).*PLAT=' "$INSTALL_SH" || {
16+
echo "FAIL: install.sh advertises Darwin-x86_64, but release CI publishes no macOS x86_64 asset"
17+
exit 1
18+
}
19+
20+
grep -q 'Currently supported: linux-x86_64, macosx-arm64' "$INSTALL_SH" || {
21+
echo "FAIL: supported platform message must match published install assets"
22+
exit 1
23+
}
24+
25+
grep -q 'mcpp-macosx-arm64.tar.gz' "$RELEASE_YML" || {
26+
echo "FAIL: release workflow must publish the macosx-arm64 alias used by install.sh"
27+
exit 1
28+
}

0 commit comments

Comments
 (0)