Skip to content

docs: sync documentation with current behavior - #348

Merged
Sunrisepeak merged 2 commits into
mcpp-community:mainfrom
wellwei:codex/docs-sync-current-docs
Aug 3, 2026
Merged

docs: sync documentation with current behavior#348
Sunrisepeak merged 2 commits into
mcpp-community:mainfrom
wellwei:codex/docs-sync-current-docs

Conversation

@wellwei

@wellwei wellwei commented Aug 3, 2026

Copy link
Copy Markdown
Member

摘要

  • 按当前源码与 GitHub Actions 行为同步 README、英中文用户文档,以及 mcpp-usagemcpp-contributingmcpp-release skills。
  • 修正脚手架、mcpp test 与 shell E2E 的边界,补充 Windows 默认工具链、安装器平台范围、Linux ARM64 发布资产、offline/logging、pack 模式、release pin 和 SPEC-001 说明。
  • 补充当前共享库支持边界:kind = "shared" 目前只支持 Linux/ELF;macOS/Windows(含交叉构建)应使用静态库或改用 Linux target。
  • 如实记录 [build].cxx_runtime 已能被解析但当前 allowlist 漏列,普通构建会 warning、--strict 会失败;本 PR 不修改源码。

Closes #347

验证

  • git diff --check origin/main...HEAD 通过。
  • 变更范围核对为 25 个 README、docs/.agents/skills/ 文件,无源码、workflow 或测试文件。
  • 文档示例、术语和本地链接按当前实现复核。
  • 未运行 mcpp buildmcpp test 或 E2E:本次仅更新文档,无运行时行为变更。

备注

  • 发布文档已说明当前 .github/tools/check_version_pins.sh 在第 95 行存在 Bash 语法错误,未将其执行结果当作验证。
  • 请以 PR 实际 required checks 为准;path-filtered 的 ARM64 fresh-install workflow 不预先声称会运行。

wellwei and others added 2 commits August 3, 2026 18:57
…g, correct the pin-checker claim

Review of mcpp-community#348 against the current tree (2026.8.3.4, three releases newer than
when the sync was written). Four things needed adjusting.

1. The ZH toolchain doc was missing THREE sections the EN one has, including
   the whole `x86_64-linux-musl`-from-Windows feature (2026.8.3.2). A Chinese
   reader had no way to learn that Windows can produce Linux ELF at all. Added,
   mirroring EN: "Windows 上产出 Linux ELF", "MSVC(系统工具链,Windows)", and
   the Clang 20+ operator-template hazard. EN/ZH are now at 16 sections each,
   and every other doc pair already matched.

   The EN section's claims were re-derived from `toolchain::host_can_serve`
   before translating: Windows serves linux targets only when musl AND same
   arch, which is exactly "no x86_64-linux-gnu, no cross-arch". Both languages
   now also state the fact that function makes explicit and the docs omitted —
   **a macOS host has no Linux-targeting payload at all** — and point at
   `mcpp toolchain list` as the authority so nobody has to memorize the matrix.

2. Artifact naming, undocumented since 2026.8.3.3 changed it. `kind = "lib"`
   for `x86_64-windows-gnu` produces `libfoo.a`, not `foo.lib`: the static-lib
   convention splits on the triple's *env* segment, not its OS. That release
   fixed a name that was wrong (a GNU archive wearing an MSVC name, which MSVC
   cannot consume), so anyone globbing `*.lib` out of a mingw build needs to
   know. Added as a table to both languages.

3. `docs/spec/package-identity.md` carried "当前实现为 2026.8.3.2" — already
   stale two releases later. A spec should not restate a value that expires on
   every release; the minimum-implementation version (0.0.106) is the load
   bearing one and it is still there. Dropped the parenthetical rather than
   bumping it, so it cannot go stale again.

4. **`check_version_pins.sh` does not have a Bash syntax error.** It parses
   (`bash -n`), runs, and exits 0 — verified on this tree. The failure is
   `sh check_version_pins.sh`: the script uses process substitution
   (`done < <(...)`), which dash cannot parse, so it reports
   "line 95: Syntax error: redirection unexpected". That is the invoking shell,
   not the script — its shebang is `#!/usr/bin/env bash` and CI invokes it as
   bash.

   This mattered enough to chase down because the claim appeared in six places
   across three files, each instructing the releaser to skip the guard and
   check pins by hand. That guard is the only machine check for pin drift, and
   pin drift has broken releases here before. All six now show the correct
   invocation and explain the sh-vs-bash trap instead.

Also noted the cache-entry layout change from 2026.8.3.4 in the `[build] cache`
section (both languages): entry layout is versioned, an upgrade that changes it
retires older entries and the next build repopulates — nothing to clean by hand.

The PR's other two findings were re-verified against the source and are correct:
`kind = "shared"` really is refused off Linux/ELF (plan.cppm:513), and
`[build].cxx_runtime` really is parsed but missing from `kKnownBuildKeys` — the
allowlist's own comment says it "MUST stay in sync with the doc->get_* reads",
and it is not. Left as-is; this PR touches no source.
@speak-agent

Copy link
Copy Markdown
Member

Review + 已直接推到本分支(640e8bc)

按当前 main(2026.8.3.4,比本 PR 写作时新三个版本)复核了一遍。整体方向和绝大部分改动是对的,四处需要调整/补充,已直接提交到本分支。

1. 中文工具链文档缺了三节 —— 包括整个 windows→linux 特性

docs/zh/03-toolchains.md 只有 13 个 ##,而 EN 有 16。缺的是:

  • ## Linux ELF from Windows(x86_64-linux-musl,无需 WSL)2026.8.3.2 的 canadian cross
  • ## MSVC(系统工具链,Windows)
  • ## 已知工具链风险:模块接口中的运算符模板(Clang 20+)

也就是说中文读者完全无从得知 Windows 可以直接产出 Linux ELF。已按 EN 补齐,现在两边都是 16 节;其余 8 对 EN/ZH 文档本来就是对齐的。

翻译前把 EN 那节的断言重新对着 toolchain::host_can_serve 推导了一遍,结论一致:Windows 只在 musl 且同 arch 时能服务 linux target —— 正好就是「不支持 x86_64-linux-gnu、不支持跨 arch」。

顺带补上了那个函数写明、而两边文档都漏掉的事实:macOS 宿主完全没有面向 Linux 的 payload,任何 Linux target 都不可用。并把判据指向 mcpp toolchain list,免得读者去背这张矩阵。

2. 产物命名(2026.8.3.3 改过,文档没跟)

kind = "lib"x86_64-windows-gnu 下产出 libfoo.a不是 foo.lib —— 静态库命名的分岔点是 triple 的 env 段,不是 OS。那次改的是一个本来就错的名字(GNU archive 顶着 MSVC 的名字,MSVC 拿不去用),所以任何按 *.lib 捞 mingw 产物的脚本都得知道。已在中英文各加了一张表。

3. SPEC-001 里的 当前实现为 2026.8.3.2

写下时就已经落后两个版本了。规范不该复述一个每次发版都会过期的值;真正承重的是最低实现版本 0.0.106,它还在。已删掉这个括号,而不是把它 bump 到 2026.8.3.4 —— 否则下次发版又会过期。

4. ⚠️ check_version_pins.sh 没有 Bash 语法错误

这条得单独说,因为它在 3 个文件里出现了 6 次,每一处都在让发布者跳过这条 guard、改为手工核对。

实测(当前树):

$ bash -n .github/tools/check_version_pins.sh   # 语法检查
$ bash .github/tools/check_version_pins.sh
expected xlings pin: 2026.7.28.4  (src/xlings.cppm)
mcpp version: building=2026.8.3.4 (fingerprint=2026.8.3.4)  bootstrap pin=2026.8.3.2
OK: xlings pins all at 2026.7.28.4; building mcpp 2026.8.3.4, bootstrapping from 2026.8.3.2
$ echo $?
0

报错的是sh:

$ sh -n .github/tools/check_version_pins.sh
.github/tools/check_version_pins.sh: 95: Syntax error: redirection unexpected

第 95 行是 done < <(...) —— 进程替换,POSIX sh/dash 解析不了。脚本 shebang 是 #!/usr/bin/env bash,CI 也是用 bash 调的。是调用它的 shell 的问题,不是脚本的缺陷。

这条重要在于:它是唯一能机器化捕捉 pin 漂移的东西,而 pin 漂移在这个仓库真的弄坏过发布。6 处已全部改成正确调用方式,并解释了 sh/bash 这个坑。

5. 补充:缓存条目布局(2026.8.3.4)

[build] cache 一节中英文各加了一段:条目布局是带版本的,改动布局的版本会一次性作废旧条目、下次构建自动重填,不需要手工清理;mcpp cache verify 现在还会报告逃出条目的地址。


你另外两条结论已复核,都对 ✅

  • kind = "shared" 确实只支持 Linux/ELF(plan.cppm:513 明确拒绝并给替代方案)。
  • [build].cxx_runtime 确实能被解析但漏在 allowlist 外 —— 而且 kKnownBuildKeys 上方的注释自己写着 "MUST stay in sync with the doc->get_*(\"build.<key>\") reads above",现在正是不同步。这是真 bug,如实记录是对的;按本 PR「不改源码」的范围,留待单独修。

验证:git diff --check 通过;9 对 EN/ZH 文档 ## 数量全部一致;所有新增断言均已对着当前源码(host_can_serveartifact_namingplan.cppmkKnownBuildKeys)核对。本次仍未触碰任何源码 / workflow / 测试。

@Sunrisepeak
Sunrisepeak merged commit a01fdd4 into mcpp-community:main Aug 3, 2026
18 checks passed
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.

docs: sync documentation and skills with current behavior

3 participants