Skip to content

Commit 6e98869

Browse files
committed
chore: xlings pin -> 2026.7.28.4, and bring the release spec up to date
Pin bump: `src/xlings.cppm::kXlingsVersion` is the single source of truth; check_version_pins.sh then named all 15 dependent pins across 7 files (including the three hardcoded aarch64 tarball literals in release.yml that a comment-only lock-step list had missed). All 16 now agree. Docs/spec, brought level with what the release pipeline actually does: - `mcpp --version` samples in getting-started (both languages) still showed `0.0.1`, from before the date-version scheme. - The release skill claimed THREE build platforms; there are four, plus `publish-ecosystem`. Its artefact checklist omitted the aarch64 tarball and the versionless aliases entirely. - It documented nothing about the second half of a release — mirroring to xlings-res, the index bump PR, `xlings install mcpp@<ver>` verification, and the bootstrap-pin bump — which is where every recent incident happened. That is now written down, along with WHY the mirror is built the way it is: measured 0.012 MB/s inbound to file.gitcode.com from a US runner vs 3.87 MB/s outbound and 16 MB/s to GitHub, ~4.6x jitter (so no fixed per-asset cap can work), per-connection shaping (so concurrency scales), no multipart on the presigned PUT (so a single file cannot be split), and gtc's exit code lying in both directions via the OBS callback. - Added the payload-slimming step and, more importantly, why it ASSERTS: the previous `strip` silently did nothing for many releases because `mcpp pack` rebuilds the binary after it. - Split the version-bump file list into the two phases it actually has — mcpp.toml/fingerprint.cppm BEFORE the release, .xlings.json/MCPP_PIN AFTER — which is what check_version_pins.sh already encodes but nobody had said. Historical records under .agents/docs/ are left alone on purpose: they record what was true when written, and rewriting them would falsify the ledger. Same for the `mcpp 0.0.95+` feature markers in docs/ — those are "introduced in" markers, not stale values. Verified: check_version_pins.sh OK, all touched YAML parses, `mcpp build` and `mcpp test` (37 binaries) green.
1 parent fd27314 commit 6e98869

11 files changed

Lines changed: 104 additions & 23 deletions

File tree

.agents/skills/mcpp-release/SKILL.md

Lines changed: 85 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,18 @@ Tag push 会自动触发 `release.yml` workflow。
8989

9090
### 4. 监控 Release CI
9191

92-
Release workflow 包含三个平台的构建
92+
Release workflow 包含**四个平台**的构建,外加一个生态发布 job
9393

9494
| Job | 平台 | 产物 | 依赖 |
9595
|-----|------|------|------|
9696
| `build-release` | Linux x86_64 | `mcpp-X.Y.Z-linux-x86_64.tar.gz` | 无(先执行) |
97+
| `build-linux-aarch64` | Linux aarch64(交叉) | `mcpp-X.Y.Z-linux-aarch64.tar.gz` | 等 Linux x86_64 完成 |
9798
| `build-macos` | macOS ARM64 | `mcpp-X.Y.Z-macosx-arm64.tar.gz` | 等 Linux 完成 |
9899
| `build-windows` | Windows x86_64 | `mcpp-X.Y.Z-windows-x86_64.zip` | 等 Linux 完成 |
100+
| `publish-ecosystem` || 镜像到 xlings-res 双端 + 开索引 bump PR |**全部四个**构建完成 |
101+
102+
`build-linux-aarch64` 是两段式的(bootstrap 先构出本 release 的 x86_64 mcpp,再用它交叉构建
103+
aarch64),因为 bootstrap 装的是**上一个已发布版本**,可能不认新特性。
99104

100105
```bash
101106
# 监控 release workflow
@@ -118,13 +123,18 @@ gh release view "v$NEW_VERSION"
118123

119124
确认以下产物全部存在:
120125
- `mcpp-X.Y.Z-linux-x86_64.tar.gz` + `.sha256`
126+
- `mcpp-X.Y.Z-linux-aarch64.tar.gz` + `.sha256`
121127
- `mcpp-X.Y.Z-macosx-arm64.tar.gz` + `.sha256`
122128
- `mcpp-X.Y.Z-windows-x86_64.zip` + `.sha256`
129+
- 上述四个的**无版本号别名**`mcpp-linux-x86_64.tar.gz` 等)+ `.sha256`
123130
- `mcpp-X.Y.Z.tar.gz`(源码包)
124131
- `mcpp.lua`(xpkg 描述)
125132
- `install.sh`
126133
- `SHA256SUMS`
127134

135+
**顺带核对体积**(2026.7.29.1 起,见下方"载荷瘦身"):linux 两个 tarball 应在
136+
**5MB 上下**。如果又回到 30MB 量级,说明 strip 断言被绕过了,先查再发。
137+
128138
## Release CI 详解
129139

130140
### Smoke Test 检查项
@@ -138,14 +148,73 @@ gh release view "v$NEW_VERSION"
138148
5. Linux: `mcpp self env` 中 MCPP_HOME 正确解析
139149
6. xlings 二进制已捆绑
140150

151+
### 载荷瘦身(2026.7.29.1 起)
152+
153+
每个 linux 平台在**打包后、打 tar 前**调用 `.github/tools/slim_linux_payload.sh`
154+
strip `bin/mcpp``registry/bin/xlings`**断言结果**`file` 不得再含
155+
`not stripped`)。
156+
157+
为什么必须断言:在此之前,vendored 的 xlings 从来没被 strip 过(97.3MB,带
158+
`debug_info`),而 x86_64 那句 `strip` 跑在 `mcpp pack` **之前** —— pack 会重建
159+
二进制把它覆盖掉,于是直到 2026.7.28.2 发布的 `bin/mcpp` 一直是未 strip 的。
160+
一个不校验效果的 `strip` 等于注释。修完 linux-x86_64 tarball 从 **34.81MB 降到
161+
4.62MB(7.5×)**
162+
163+
macOS / Windows **故意不做**:载荷本来就 6.1MB / 4.2MB,且 strip Mach-O 会让
164+
ad-hoc 签名失效。
165+
166+
### publish-ecosystem:镜像 + 索引(发布的后半程)
167+
168+
四个构建 job 全绿后自动执行,做两件事:
169+
170+
1. **镜像到 `xlings-res/mcpp` 双端**(GitHub + GitCode),由
171+
`.github/tools/mirror_res.sh` 完成 —— 单 leg 内资产**并发上传**
172+
`MIRROR_MAX_PARALLEL`,默认 8),预算是**整条 leg 的 deadline**
173+
`MIRROR_LEG_DEADLINE_GH` 600s / `_GTC` 2400s),不是 per-asset cap。
174+
2. **`openxlings/xim-pkgindex` 开 bump PR**(带每平台 sha256)。
175+
176+
**为什么不是 per-asset cap**:实测(探针 PR #301)GitHub US runner 上传到
177+
`file.gitcode.com`(单 IP 华为云北京)只有 **0.012 MB/s** —— 而同一台 runner
178+
从同一个 IP **下载**有 3.87 MB/s、传 GitHub 有 16 MB/s、大陆本机传它有
179+
1.84 MB/s。被限的是**国际入境方向**,且速率有 ~4.6× 抖动,所以任何固定
180+
per-asset 值都不可能既安全又有用。限速是 **per-connection** 的(1/4/8 并发
181+
= 76/80/93s 墙钟),所以并发能叠加;但预签名是 OBS **单次 PUT** 签名,无
182+
multipart/无断点续传,**单文件拆不开** —— 这正是必须先把载荷 strip 小的原因。
183+
184+
**`gtc` 的退出码两个方向都会撒谎**:PUT 头里的 `x-obs-callback` 让 OBS 存完对象
185+
再回调 GitCode API,回调失败就返回 `code:400 ... EOF`,而**对象其实已落盘**
186+
判定上传成功**只能靠回探下载 URL**,脚本就是这么做的。
187+
188+
### 发布后的收尾(必须做完,否则用户装不到)
189+
190+
```bash
191+
# 1) 索引 PR:CI 绿后合入,合入即自动发布索引 artifact
192+
gh pr merge <n> --repo openxlings/xim-pkgindex --squash --admin
193+
194+
# 2) 真实验证(注意:不带 @版本 不会升级已装的旧版)
195+
xlings update && xlings install mcpp@$NEW_VERSION -y
196+
197+
# 3) bootstrap pin 收尾,直推 main
198+
# .xlings.json 的 workspace.mcpp 与 ci-fresh-install.yml 的 MCPP_PIN
199+
bash .github/tools/check_version_pins.sh
200+
git commit -m "ci: workspace mcpp bootstrap pin -> $NEW_VERSION (released, mirrored, indexed)"
201+
```
202+
203+
**索引传播有滞后**:索引 artifact 发布后,`latest` tag 上的指针文件在 GitHub
204+
资产 CDN 上可能还要几分钟才更新。紧接着跑的 CI 可能仍拿到旧索引并报
205+
`package 'mcpp@X.Y.Z' not found` —— 这不是 release 坏了,等指针稳定后重跑即可。
206+
141207
### 常见失败原因
142208

143209
| 症状 | 原因 | 修复 |
144210
|------|------|------|
145211
| `mcpp X.Y.Z-1` 但 tag 是 `vX.Y.Z` | `fingerprint.cppm` 版本未更新 | 更新 `MCPP_VERSION`,重新打 tag |
146212
| Smoke test 输出旧版本 | CI 缓存了旧的 sandbox/target | 删除 GitHub Actions cache 后重跑 |
147-
| xlings bootstrap 失败 | xlings 版本不兼容 | 更新 `XLINGS_VERSION` |
213+
| e2e `01_help_and_version.sh`| 只改了 `mcpp.toml` 没改 `fingerprint.cppm`(它把两者交叉比对) | 同步四处版本;注意这个 e2e 只在部分分片里跑,可能表现为"只有某个平台红" |
214+
| xlings bootstrap 失败 | xlings 版本不兼容 |`src/xlings.cppm::kXlingsVersion`**唯一真源**)后跑 `check_version_pins.sh` 找出其余 15 个 pin 点 |
148215
| macOS/Windows 构建失败 | 需要等 Linux job 先完成 | 检查 Linux job 是否成功 |
216+
| `slim: FAIL: ... still not stripped` | strip 工具没生效/被 pack 覆盖 | 别绕过断言——它就是为了拦住 34.8MB 的 tarball 再次发出去 |
217+
| mirror leg 报 `missing/unverified` | 资产没传上去或还没传播 | 先 GET 核验(**必须 GET,`curl -I` 会骗你**),gitcode 用 `gitcode.com` 直链而非 `api.` 主机;确认缺件后本地补传再 `gh run rerun --failed`(脚本幂等,已验证的资产会跳过) |
149218

150219
### 缓存管理
151220

@@ -191,8 +260,20 @@ gh workflow run release.yml --ref "v$NEW_VERSION"
191260

192261
| 文件 | 版本相关内容 |
193262
|------|-------------|
194-
| `mcpp.toml` | `version = "X.Y.Z"` — 项目版本 |
263+
| `mcpp.toml` | `version = "X.Y.Z"` — 项目版本,release.yml 由它推导 tag |
195264
| `src/toolchain/fingerprint.cppm` | `MCPP_VERSION = "X.Y.Z"` — 编译期版本常量 |
196-
| `.github/workflows/release.yml` | Release workflow 定义 |
265+
| `.xlings.json` | `workspace.mcpp` — CI bootstrap 装哪个 mcpp(发布****才 bump) |
266+
| `.github/workflows/ci-fresh-install.yml` | `MCPP_PIN` — 全新安装验证目标(发布****才 bump) |
267+
| `src/xlings.cppm` | `kXlingsVersion` — xlings pin 的**唯一真源**(其余 15 处由脚本校验) |
268+
| `.github/tools/check_version_pins.sh` | 机器校验上述两组不变量,别靠肉眼 |
269+
| `.github/tools/slim_linux_payload.sh` | linux 载荷 strip + 断言 |
270+
| `.github/tools/mirror_res.sh` | 双端镜像(并发上传 + leg deadline + 完整性 gate) |
271+
| `.github/tools/gtc` | GitCode CLI(release create/upload、PR) |
272+
| `.github/workflows/release.yml` | Release workflow 定义(四平台 + publish-ecosystem) |
197273
| `install.sh` | 安装脚本(随 release 发布) |
198274
| `CHANGELOG.md` | Release notes 来源(按 `## [X.Y.Z]` 提取) |
275+
276+
> **注意版本 bump 的两个阶段**`mcpp.toml` + `fingerprint.cppm` 在发版****
277+
> (它们定义要发什么);`.xlings.json` + `MCPP_PIN` 在发版**成功后**改(它们指向
278+
> bootstrap 用哪个已发布版本)。`check_version_pins.sh` 认得这个差异,不会因为
279+
> bootstrap pin 落后一版就报错。

.github/actions/bootstrap-mcpp/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ inputs:
2525
# `package.name`, so one of the two was simply unreachable — and which one
2626
# depended on the machine, which is why CI failed on `compat:lua` on
2727
# Windows and `mcpplibs.capi:lua` on Linux. Never pin below that.
28-
default: '2026.7.27.2'
28+
default: '2026.7.28.4'
2929
cache-target:
3030
description: also restore/save target/ (build artifacts + BMIs)
3131
required: false

.github/actions/setup-macos-llvm/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ inputs:
1515
# Floor imposed by the index, not a routine bump — see
1616
# .github/actions/bootstrap-mcpp/action.yml for why 0.4.69 is required
1717
# (two packages named `lua` in one repo need openxlings/xlings#381).
18-
default: '2026.7.27.2'
18+
default: '2026.7.28.4'
1919

2020
runs:
2121
using: composite

.github/workflows/bootstrap-macos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
# Dormant (workflow_dispatch only), but kept in step with the rest —
1818
# check_version_pins.sh holds it there. Floor: 0.4.69, below which the
1919
# index cannot resolve two packages that share a short name.
20-
XLINGS_VERSION: '2026.7.27.2'
20+
XLINGS_VERSION: '2026.7.28.4'
2121
steps:
2222
- uses: actions/checkout@v4
2323

.github/workflows/ci-fresh-install.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191
env:
9292
XLINGS_NON_INTERACTIVE: '1'
9393
run: |
94-
curl -fsSL https://raw.githubusercontent.com/openxlings/xlings/main/tools/other/quick_install.sh | bash -s v2026.7.27.2
94+
curl -fsSL https://raw.githubusercontent.com/openxlings/xlings/main/tools/other/quick_install.sh | bash -s v2026.7.28.4
9595
echo "$HOME/.xlings/subos/current/bin" >> "$GITHUB_PATH"
9696
9797
- name: Install mcpp and config mirror
@@ -227,7 +227,7 @@ jobs:
227227

228228
- name: Install xlings + mcpp
229229
run: |
230-
curl -fsSL https://raw.githubusercontent.com/openxlings/xlings/main/tools/other/quick_install.sh | bash -s v2026.7.27.2
230+
curl -fsSL https://raw.githubusercontent.com/openxlings/xlings/main/tools/other/quick_install.sh | bash -s v2026.7.28.4
231231
# Deliberately NOT writing to $GITHUB_PATH here. On container
232232
# images that declare no PATH in their config (opensuse/
233233
# tumbleweed), appending a single dir to GITHUB_PATH makes the
@@ -291,7 +291,7 @@ jobs:
291291
# (older ones carry minos=15 and refuse to start).
292292
# v0.4.51+: in-process sha256 — this image has no sha256sum
293293
# binary, so pinned fetches failed before it.
294-
curl -fsSL https://raw.githubusercontent.com/openxlings/xlings/main/tools/other/quick_install.sh | bash -s v2026.7.27.2
294+
curl -fsSL https://raw.githubusercontent.com/openxlings/xlings/main/tools/other/quick_install.sh | bash -s v2026.7.28.4
295295
echo "$HOME/.xlings/subos/current/bin" >> "$GITHUB_PATH"
296296
297297
- name: Install mcpp and config mirror

.github/workflows/ci-linux-e2e.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ jobs:
123123
124124
- name: Bootstrap xlings + released mcpp
125125
run: |
126-
curl -fsSL https://raw.githubusercontent.com/openxlings/xlings/main/tools/other/quick_install.sh | bash -s v2026.7.27.2
126+
curl -fsSL https://raw.githubusercontent.com/openxlings/xlings/main/tools/other/quick_install.sh | bash -s v2026.7.28.4
127127
export PATH="$HOME/.xlings/subos/current/bin:$PATH"
128128
xlings update
129129
xlings install mcpp -y -g

.github/workflows/cross-build-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ jobs:
108108
# release assets were uploaded in a broken state (records present,
109109
# blobs missing → 404 on GET); re-uploaded clean. The stale-INDEX
110110
# half is handled by the marker-clear below.
111-
XLINGS_VERSION: '2026.7.27.2'
111+
XLINGS_VERSION: '2026.7.28.4'
112112
run: |
113113
tarball="xlings-${XLINGS_VERSION}-linux-x86_64.tar.gz"
114114
curl -fsSL -o "/tmp/${tarball}" \
@@ -245,7 +245,7 @@ jobs:
245245
- name: Bootstrap mcpp via xlings
246246
env:
247247
XLINGS_NON_INTERACTIVE: '1'
248-
XLINGS_VERSION: '2026.7.27.2'
248+
XLINGS_VERSION: '2026.7.28.4'
249249
run: |
250250
tarball="xlings-${XLINGS_VERSION}-linux-x86_64.tar.gz"
251251
curl -fsSL -o "/tmp/${tarball}" \

.github/workflows/release.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
# Pin xlings to a known-good version. The upstream install
9797
# script always grabs `latest` (no version override), so we
9898
# download + self-install manually to avoid broken releases.
99-
XLINGS_VERSION: '2026.7.27.2'
99+
XLINGS_VERSION: '2026.7.28.4'
100100
run: |
101101
if [ ! -x "$HOME/.xlings/subos/default/bin/xlings" ]; then
102102
tarball="xlings-${XLINGS_VERSION}-linux-x86_64.tar.gz"
@@ -288,7 +288,7 @@ jobs:
288288
- name: Bootstrap mcpp via xlings
289289
env:
290290
XLINGS_NON_INTERACTIVE: '1'
291-
XLINGS_VERSION: '2026.7.27.2'
291+
XLINGS_VERSION: '2026.7.28.4'
292292
run: |
293293
tarball="xlings-${XLINGS_VERSION}-linux-x86_64.tar.gz"
294294
curl -fsSL -o "/tmp/${tarball}" \
@@ -358,11 +358,11 @@ jobs:
358358
# below are pinned to the same version as XLINGS_VERSION; they are
359359
# NOT interpolated from it, so check_version_pins.sh scans for them
360360
# explicitly (they were absent from the old lock-step comment).
361-
XLA="xlings-2026.7.27.2-linux-aarch64.tar.gz"
361+
XLA="xlings-2026.7.28.4-linux-aarch64.tar.gz"
362362
if curl -fsSL -o "/tmp/$XLA" \
363-
"https://github.com/openxlings/xlings/releases/download/v2026.7.27.2/$XLA"; then
363+
"https://github.com/openxlings/xlings/releases/download/v2026.7.28.4/$XLA"; then
364364
tar -xzf "/tmp/$XLA" -C /tmp
365-
XLBIN=$(find /tmp/xlings-2026.7.27.2-linux-aarch64 -path '*/bin/xlings' -type f | head -1)
365+
XLBIN=$(find /tmp/xlings-2026.7.28.4-linux-aarch64 -path '*/bin/xlings' -type f | head -1)
366366
if [ -n "$XLBIN" ]; then
367367
mkdir -p "$STAGING/$WRAPPER/registry/bin"
368368
cp "$XLBIN" "$STAGING/$WRAPPER/registry/bin/xlings"
@@ -440,7 +440,7 @@ jobs:
440440
- name: Bootstrap mcpp via xlings
441441
env:
442442
XLINGS_NON_INTERACTIVE: '1'
443-
XLINGS_VERSION: '2026.7.27.2'
443+
XLINGS_VERSION: '2026.7.28.4'
444444
run: |
445445
if [ ! -x "$HOME/.xlings/subos/default/bin/xlings" ]; then
446446
WORK=$(mktemp -d)
@@ -622,7 +622,7 @@ jobs:
622622
shell: bash
623623
env:
624624
XLINGS_NON_INTERACTIVE: '1'
625-
XLINGS_VERSION: '2026.7.27.2'
625+
XLINGS_VERSION: '2026.7.28.4'
626626
run: |
627627
# Captured before the `cd` below, in POSIX form: this step never
628628
# returns to the workspace, and GITHUB_WORKSPACE is a backslash

docs/00-getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Once installation is complete, start a new shell session or run `source ~/.bashr
2626

2727
```bash
2828
mcpp --version
29-
# mcpp 0.0.1
29+
# mcpp 2026.7.29.1
3030
```
3131

3232
> [!TIP]

docs/zh/00-getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ curl -fsSL https://github.com/mcpp-community/mcpp/releases/latest/download/insta
2828

2929
```bash
3030
mcpp --version
31-
# mcpp 0.0.1
31+
# mcpp 2026.7.29.1
3232
```
3333

3434
> [!TIP]

0 commit comments

Comments
 (0)