Skip to content

Commit 271ed69

Browse files
2026.11.10.2: FreeBSD's musl identity; cfg barewords from the rows; #918; MSVC's C library is ucrt; the test fast path names the host (#920)
* The compiler witness asks again for a record Windows refuses; the matrix scan reports supervision lines * test: a test of an unchanged project that this host cannot execute names the host's target * prepare_inputs: the bareword vocabulary precedes the comment of unknown_tokens * A platform refused for a row names the rows its providers serve * Matrix: the FreeBSD musl rows and the 0.26.0 version group * README: the FreeBSD musl rows are preview * CHANGELOG and design record: barewords, #918, the chosen platform * A platform chosen for a request serves it, by whichever selector chose it * A namespace's package may be named version, path, git or workspace (#918) * cfg barewords are the rows' systems, and a row states its family * Design notes: K9 and the I1 correction in the implementation record * 2026.11.10.2: FreeBSD's musl identity over openkal-platform 0.26.0 * The MSVC payload's C library is ucrt, as the MinGW payload's is Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
1 parent 705c2a5 commit 271ed69

43 files changed

Lines changed: 557 additions & 157 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.agents/docs/2026-11-10-cross-platform-ecosystem-design.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ status: active
66
# 生态方案:跨平台通用基础设施(mcpp + openkal + xim),以一个 C89 工程为验证
77

88
**日期:** 2026-11-10
9-
**状态:** 第四版,mcpp 部分已在 2026.11.10.1 实施。Q1–Q6 已定稿(第 11.1 节);O1–O4 已按推荐实施,实施中的调整见第 11.2 节;第 12 节为两项
9+
**状态:** 第四版,mcpp 部分已在 2026.11.10.1 实施,K9、E15、I1 的补正与 #918 的修正在 2026.11.10.2。Q1–Q6 已定稿(第 11.1 节);O1–O4 已按推荐实施,实施中的调整见第 11.2 节;第 12 节为两项
1010
风险的说明,第 13 节为多视角深度自审;第 15 节为实施记录,第 16 节为测试体系向 mtest 的迁移
1111
**范围:** mcpp(引擎与内置数据);openkal 家族(openkal 规范、openkal-linux/macos/windows、openkal-musl、
1212
openkal-llvm-runtime、openkal-image、openkal-platform、openkal-conformance,新增 openkal-freebsd、openkal-posix);
@@ -592,6 +592,10 @@ B 路线在 Windows 上就是正确的默认。
592592
| I1 | compat.glfw 的 Windows 行要求 `mcpp:c-abi=ucrt` | gnu 行构建、windows-musl 行在解析期拒绝(实测) |
593593
| CI 中暴露并修复 | 提供者的基座在依赖图载入前被记住(改为图载入后才保留);没有 cfg 的 Windows llvm 载荷编译时不陈述配对的 sysroot;同一 home 的两个进程并发安装同一个包(安装次序锁 `registry/.install.lock`) | target-matrix、openkal 交叉构建、各宿主 e2e |
594594
| 实施中发现并修复 | 工具链为另一目标构建的 C++ 归档(其父目录的三元组与目标的架构或系统不同)不链接,并给出降级诊断;ok 映像的启动器依赖 mcpplibs.os 0.4.4(openkal 0.24 与 0.25 两族均可);交叉 gcc 自身的 Windows 头文件属于工具链(`mingw` 提供者下资源脚本的 `"winres.h"`);资源脚本中各处都找不到、也无构建动作写出的带引号 include 不进入构建图,由脚本的预处理与资源编译器处理 | 单元测试 `Distribution/ForeignArchivesAreNotLinked`;mingw 交叉打包;e2e 1058、1072(验证工程的 Windows 行暴露) |
595+
| K9(mcpp 2026.11.10.2) | `<arch>-freebsd-musl` 两行由 openkal 提供者经 openkal-platform 0.26.0 的 hosted 部分服务(openkal-freebsd standalone 之上的 openkal-musl 0.29.2);未为 `<arch>-freebsd` 选平台时取该身份,选了平台则保留系统 ABI;openkal-run 0.6.1 在 FreeBSD 上以 openkal-freebsd 为缺省实现,okrun 由两条路线构建;平台的运行器主机加入 FreeBSD | e2e 1073、1059;openkal-platform CI 的 freebsd 作业(FreeBSD 虚拟机中运行程序,并以 FreeBSD 的 okrun 运行 ok 映像) |
596+
| I1 的补正(mcpp 2026.11.10.2) | MSVC 载荷的 `c-abi` 回答 `ucrt`(此前为工具集名 `msvc`),`compat.glfw` 的 `requires = ["mcpp:c-abi=ucrt"]` 在 MSVC 行上成立;SPEC-002 v1.7 写明段与 C 库名的对应 | 单元测试 `TargetSideResolve`;mcpp-index#748 的 Windows 作业 |
597+
| E15(mcpp 2026.11.10.2) | cfg 裸词由数据决定:`unix` 为族词,其余不含短横线的词即 `os = "<词>"`;行表的 `family` 陈述族,FreeBSD 各行属 `unix` 族;词表与诊断由行的系统生成,平台定义的系统同样可作裸词 | 单元测试 `CfgBarewords`;docs/22 |
598+
| #918 的修正(mcpp 2026.11.10.2) | 依赖表仅当 `path`/`version`/`git` 为字符串或 `workspace` 为布尔时视为单个依赖说明,命名空间中名为 `version` 等的包按包读取 | 单元测试 `Manifest/APackageNamedLikeASpecField` |
595599

596600
openkal 家族(K5、K6,openkal 0.25.0)、openkal-freebsd 0.1.0(hosted 与 standalone 两种形态,x86_64 与 arm64)、
597601
openkal-musl 0.29.1 与 openkal-llvm-runtime 0.20.1(FreeBSD 的 standalone C 与 C++ 运行时)以及 mcpplibs/os 的实施记录

‎CHANGELOG.md‎

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,63 @@
44
> Each `## [<version>]` section is that release's notes. Entries are written in English
55
> from 2026.9.28.3 on; earlier entries remain as written.
66

7+
## [2026.11.10.2] - 2026-11-10
8+
9+
### Added
10+
11+
- FreeBSD's musl identity is served: `x86_64-freebsd-musl` and
12+
`aarch64-freebsd-musl` are preview rows of the openkal provider, through
13+
openkal-platform 0.26.0's hosted part — openkal-musl 0.29.2 over
14+
openkal-freebsd 0.1.0 in its standalone arrangement, with
15+
openkal-llvm-runtime 0.20.1 above it, as one static program with no C library
16+
of the system beneath. A request of `<arch>-freebsd` with no platform selected
17+
for it takes this identity, as `aarch64-macos` takes the musl identity on a
18+
host that is not a Mac; a project that selects a platform for `<arch>-freebsd`
19+
keeps the system's own ABI, by whichever selector chose it (`[target.<row>]`,
20+
`[target.freebsd]` or `cfg(os = "freebsd")`): a platform package chosen for a
21+
request that no built-in provider names serves it, and another package's
22+
provider does not compete with it.
23+
- A cfg bareword names any system a row names: `unix` is the family word, and
24+
any other word without a dash is `os = "<word>"`, so `[target.freebsd]`,
25+
`cfg(freebsd)` and the system of a row a platform defines select as `linux`
26+
does. A row states its family (`family`, `unix` or `windows`), and FreeBSD's
27+
rows are of the `unix` family, so `cfg(unix)` holds on them. A word that
28+
names no row's system is reported as before.
29+
30+
### Changed
31+
32+
- The openkal targets' platform is openkal-platform 0.26.0 (from 0.25.0): its
33+
version group is openkal-image 0.6.1, whose runner binds only the interfaces
34+
its implementation provides and is built for FreeBSD as well, openkal-musl
35+
0.29.2, openkal-llvm-runtime 0.20.1 and openkal-freebsd 0.1.0.
36+
37+
### Fixed
38+
39+
- The MSVC payload's C library is `ucrt`, as the MinGW-w64 payload's is: the
40+
triple's env segment names the toolset on Windows, `msvc` and `gnu` alike.
41+
It was answered as `msvc`, so `requires = ["mcpp:c-abi=ucrt"]` (a Win32
42+
backend's statement of its C runtime) refused the MSVC route while the GNU
43+
routes satisfied it. SPEC-002 v1.7 states the names.
44+
- A dependency namespace holding a package named `version`, `path`, `git` or
45+
`workspace` is read as the namespace (#918): `gpp.version = { path = "…" }`
46+
declares the package `gpp.version`. A table was taken as one dependency
47+
specification when it held any of those keys, whatever their values, and was
48+
refused for naming no source; a specification's `path`, `version` and `git`
49+
are strings and its `workspace` a boolean, and only such a value decides it.
50+
- A platform refused for a row it does not serve names the rows its providers
51+
serve; the list named only its `targets` and was empty for a platform that
52+
states `[[platform.provider]]`.
53+
- A test of an unchanged project that this host cannot execute is reported for
54+
the host's target: `mcpp test` without planning (2026.11.10.1) named an empty
55+
target in the refusal and in the `[target.…].runner` it proposes.
56+
- A compiler record that Windows refuses to a reader for longer than the
57+
publication bound is asked for again at the witness's next audit, as an
58+
unknown controller already was; the refusal ends the build only when it
59+
outlasts the startup grace. It ended a Windows build with "a compiler
60+
controller ended before completion" after a large package installation. The
61+
target-matrix scan reports the supervision's own `mcpp:` lines with a failed
62+
cell.
63+
764
## [2026.11.10.1] - 2026-11-10
865

966
### Added

‎README.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,8 @@ list` reports for this machine):
456456
| `aarch64-linux-gnu` | `llvm@23.1.3` | preview |
457457
| `aarch64-windows-gnu` | llvm 23 with `xim:mingw-w64-sysroot` (llvm-mingw's target side) — built on any host; the same base serves `x86_64-windows-gnu` where no gcc payload exists | preview |
458458
| `x86_64-freebsd` · `aarch64-freebsd` | the platform that serves them, over `xim:<arch>-freebsd-sysroot` ([22](docs/22-target-side.md)) | preview |
459-
| `riscv64-linux-musl` · `x86_64-macos` · `x86_64-freebsd-musl` · `aarch64-freebsd-musl` · `i686-linux-musl` · `i686-linux-gnu` · `i686-openkal` | — | planned |
459+
| `x86_64-freebsd-musl` · `aarch64-freebsd-musl` | llvm 23 — a static FreeBSD program with a musl C library over openkal-freebsd, built on any host *(what `<arch>-freebsd` is with no platform chosen)* | preview |
460+
| `riscv64-linux-musl` · `x86_64-macos` · `i686-linux-musl` · `i686-linux-gnu` · `i686-openkal` | — | planned |
460461
| `x86_64-openkal` · `aarch64-openkal` | llvm 23 — an ok image: one artifact per architecture, run by `okrun` on Linux, macOS and Windows; the C library and C++ run-time inside it are packages ([24](docs/24-openkal-cross.md)) | verified |
461462
| `wasm32-emscripten` | `emsdk@6.0.9` — Emscripten ships its own sysroot and its own libc++ module surface; `mcpp run` executes the module with the `node` the payload declares (`xim:node`), not one found on PATH | verified |
462463
| `x86_64-linux-android` | `android-ndk@30.0.16248370` — bionic from the NDK, one payload for both ABIs; ran on an API 24 x86_64 emulator image | verified |

‎README.zh-CN.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,8 @@ mcpp 的身份模型有两条正交的轴:**工具链**是 `family@version`(
405405
| `aarch64-linux-gnu` | `llvm@23.1.3` | preview |
406406
| `aarch64-windows-gnu` | llvm 23 加 `xim:mingw-w64-sysroot`(llvm-mingw 的目标侧);任意宿主可构建;没有 gcc 载荷之处同一基座也服务 `x86_64-windows-gnu` | preview |
407407
| `x86_64-freebsd` · `aarch64-freebsd` | 服务它们的平台,基于 `xim:<arch>-freebsd-sysroot`([22](docs/zh/22-target-side.md)) | preview |
408-
| `riscv64-linux-musl` · `x86_64-macos` · `x86_64-freebsd-musl` · `aarch64-freebsd-musl` · `i686-linux-musl` · `i686-linux-gnu` · `i686-openkal` | — | planned |
408+
| `x86_64-freebsd-musl` · `aarch64-freebsd-musl` | llvm 23;openkal-freebsd 之上带 musl C 库的静态 FreeBSD 程序,任意宿主可构建 *(未选平台时 `<arch>-freebsd` 即此身份)* | preview |
409+
| `riscv64-linux-musl` · `x86_64-macos` · `i686-linux-musl` · `i686-linux-gnu` · `i686-openkal` | — | planned |
409410
| `x86_64-openkal` · `aarch64-openkal` | llvm 23;ok 映像:每种架构一个产物,由 `okrun` 在 Linux、macOS 与 Windows 上运行;映像内的 C 库与 C++ 运行时是包([24](docs/zh/24-openkal-cross.md)) | verified |
410411
| `wasm32-emscripten` | `emsdk@6.0.9`;Emscripten 自带 sysroot 与 libc++ 模块接口;`mcpp run` 使用 payload 声明的 `node`(`xim:node`)运行模块,不使用 PATH 上的 `node` | verified |
411412
| `x86_64-linux-android` | `android-ndk@30.0.16248370`;bionic 来自 NDK,一个 payload 服务两个 ABI;已在 API 24 的 x86_64 模拟器镜像上运行 | verified |

‎docs/21-the-target-triple.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ other's rows.
533533
| `aarch64-macos-musl` | preview | `llvm@23.1.3` | graph | graph | graph | graph |
534534
| `x86_64-macos-musl` | preview | `llvm@23.1.3` | graph | graph | graph | graph |
535535
| `x86_64-freebsd`, `aarch64-freebsd` | preview | — | platform | platform | platform | platform |
536-
| `x86_64-freebsd-musl`, `aarch64-freebsd-musl` | planned | — | planned | planned | planned | planned |
536+
| `x86_64-freebsd-musl`, `aarch64-freebsd-musl` | preview | `llvm@23.1.3` | graph | graph | graph | graph |
537537
| `riscv64-none-elf` | verified | `llvm@23.1.3` | payload | payload | payload | payload |
538538
| `riscv32-none-elf` | verified | `llvm@23.1.3` | payload | payload | payload | payload |
539539
| `aarch64-none-elf` | preview | `llvm@23.1.3` | payload | payload | payload | payload |
@@ -573,7 +573,8 @@ vocabulary, nothing wired yet.
573573
| `*-linux-gnu` | Linux, same arch only | additionally needs the host-native `xim:glibc` / `xim:linux-headers` |
574574
| `x86_64-windows-gnu` | Linux and Windows by the gcc payload; every host by the MinGW-w64 base package | one identity, host-split at the distribution layer; the `mingw-llvm` provider serves it with clang and `xim:mingw-w64-sysroot` (llvm-mingw's target side: MinGW-w64 on UCRT, libc++, compiler-rt) where no gcc payload exists |
575575
| `aarch64-windows-gnu` | every host | the MinGW-w64 base package alone; no gcc payload targets it |
576-
| `*-freebsd` | every host, through a platform | the rows are built-in; a platform names each identity's FreeBSD base package (`xim:x86_64-freebsd-sysroot`, `xim:aarch64-freebsd-sysroot`) and is selected with `[target.<row>] platform`; without one the request is refused naming that line |
576+
| `*-freebsd` | every host, through a platform | the rows are built-in; a platform names each identity's FreeBSD base package (`xim:x86_64-freebsd-sysroot`, `xim:aarch64-freebsd-sysroot`) and is selected with `[target.<row>] platform`, or by any selector the row meets (`[target.freebsd]`, `cfg(os = "freebsd")`); another platform package's provider does not compete with the chosen platform |
577+
| `*-freebsd-musl` | every host, through the graph | openkal-platform's hosted part (0.26.0): openkal-musl over openkal-freebsd standalone, one static program; a request of `<arch>-freebsd` with no platform selected for it takes this identity (2026.11.10.2+), as `aarch64-macos` takes the musl identity on a host that is not a Mac |
577578
| `x86_64-windows-msvc` | Windows | MSVC is located on the machine |
578579
| `x86_64-windows-musl` | Windows by payload; anywhere by graph | no gcc emits PE+musl, and LLVM cannot spell the triple |
579580
| `aarch64-macos` | macOS | the SDK is the machine's |

‎docs/22-target-side.md‎

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,9 @@ cxxflags = ["-D_GNU_SOURCE"]
10111011
**A layer names the library, not the triple's env segment.** They coincide
10121012
for `musl` and diverge for `gnu`: on Linux that segment asks for glibc, and on
10131013
Windows it names the MinGW flavour of the toolchain, whose C runtime is the same
1014-
UCRT the MSVC flavour links. The spelling is `c-abi = "glibc"`, never
1014+
UCRT the MSVC flavour links. Both Windows payloads answer `ucrt` (the MSVC one
1015+
from 2026.11.10.2), so a package that needs the Win32 C runtime states
1016+
`requires = ["mcpp:c-abi=ucrt"]` once. The spelling is `c-abi = "glibc"`, never
10151017
`c-abi = "gnu"`; the request, as opposed to the answer, is `env = "gnu"` — a
10161018
different question (`docs/specs/target-side.md` §3.4).
10171019

@@ -1091,15 +1093,21 @@ openblas = "0.3.33"
10911093
ldflags = ["-Llib", "-llibopenblas"]
10921094

10931095
# cfg(...) for compound predicates (grammar: all/any/not over os/arch/family/env,
1094-
# plus the bare aliases windows/unix/linux/macos).
1096+
# plus barewords: `unix` and the name of a system).
10951097
[target.'cfg(all(linux, not(arch = "aarch64")))'.build]
10961098
cxxflags = ["-march=x86-64-v2"]
10971099
```
10981100

1099-
`[target.windows]` is exactly equivalent to `[target.'cfg(windows)']` — the bare
1100-
aliases `windows` / `linux` / `macos` / `unix` are never valid target triples, so
1101-
there is no ambiguity. Use the bare form for a single OS/family; use `cfg(...)`
1102-
for arch/env conditions and combinators.
1101+
`[target.windows]` is exactly equivalent to `[target.'cfg(windows)']`. A bareword
1102+
is data rather than a list: `unix` is `family = "unix"`, and any other word without a
1103+
dash is `os = "<word>"` (`linux`, `macos`, `windows`, `freebsd`, or the system of a
1104+
row a platform defines). A row states its family (`family` in the row table), so
1105+
FreeBSD is of the `unix` family. A target triple always contains a dash, so a
1106+
bareword is never a triple. A word that names no row's system is reported, as an
1107+
unknown key is. Use the bare form for a single OS/family; use `cfg(...)` for arch/env
1108+
conditions and combinators. mcpp before 2026.11.10.2 reads only `linux`, `macos`,
1109+
`windows` and `unix` as barewords; a package read by such a release writes
1110+
`cfg(os = "<system>")` for any other system.
11031111

11041112
- **Keys**: `dependencies` / `dev-dependencies` / `build-dependencies` /
11051113
`feature-deps.<feature>` (mcpp 2026.8.6.2+ — see [30 — build.mcpp](30-build-mcpp.md); the feature is

‎docs/35-platforms.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ manifest,
203203

204204
```toml
205205
[target.'cfg(os = "openkal")']
206-
platform = "openkal-platform@0.25.0" # a release, or a series: "openkal-platform@^0.25"
206+
platform = "openkal-platform@0.26.0" # a release, or a series: "openkal-platform@^0.26"
207207
```
208208

209209
and a build that fails while the default is in use and the synced index holds a
@@ -311,7 +311,7 @@ hosted = true # the C environment has `main`
311311

312312
With the platform selected (`[target.x86_64-haiku] platform = {...}` or
313313
`--platform`), `--target x86_64-haiku` builds into `target/x86_64-haiku/`,
314-
`cfg(os = "haiku")` holds, and a program whose system is not this machine's
314+
`cfg(os = "haiku")` holds (and `cfg(haiku)`, `cfg(unix)` by the row's `family`, 2026.11.10.2+), and a program whose system is not this machine's
315315
is built, not run, until a runner states how it runs (docs/41). The row's
316316
machine description is the platform's: a target whose machine differs from a
317317
built-in row is another row. `[platform]` and `[platform.hosted]` remain the two

‎docs/50-machine-output.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ installation, which is located on the machine rather than installed by mcpp. A
552552
target row is `{target, note, toolchain, pin, status, default}`, and `status` is
553553
one of `installed` / `available` / `via dependency graph` / `planned`.
554554
A target row also carries `platform` (2026.10.27.1+): the platform package the
555-
target table selects for it (`mcpplibs.openkal-platform@0.25.0` from 2026.11.10.1, `@0.24.4` from 2026.11.8.1, `@0.24.3` in 2026.11.7.2; the series `^0.24` in 2026.11.7.1), or `null`.
555+
target table selects for it (`mcpplibs.openkal-platform@0.26.0` from 2026.11.10.2, `@0.25.0` in 2026.11.10.1, `@0.24.4` from 2026.11.8.1, `@0.24.3` in 2026.11.7.2; the series `^0.24` in 2026.11.7.1), or `null`.
556556

557557
**`toolchain` and `pin` are not the same field twice.** `toolchain` is what
558558
the row is associated with — the installed payload on an installed row, the

‎docs/specs/platforms.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ run_under = ["qemu-aarch64"]
405405
## 14. 内置平台与目标表
406406

407407
宿主目标(Linux、macOS、Windows、Android、iOS、Emscripten)的约定留在引擎中,无平台包。目标表有平台列:
408-
`x86_64-openkal`、`aarch64-openkal` 的值为一个确切的平台版本,即当前引擎验证过的版本(mcpp 2026.11.10.1 为 `mcpplibs.openkal-platform@0.25.0`),
408+
`x86_64-openkal`、`aarch64-openkal` 的值为一个确切的平台版本,即当前引擎验证过的版本(mcpp 2026.11.10.2 为 `mcpplibs.openkal-platform@0.26.0`),
409409
也是这两个目标的内置支持;选择来源报告为 `built-in`。项目可以以 `[target.<selector>] platform` 选择另一个版本或系列。
410410
锁中记录的版本不满足内置版本时不被采用,报告写出采用的版本与锁中记录的版本。使用内置版本的构建失败、且已同步的索引中
411411
有更新版本时,构建以一条 `tip` 写出两个版本与选择它的写法(mcpp >= 2026.11.7.2;2026.11.7.1 的值为系列 `^0.24`)。**已实现**

0 commit comments

Comments
 (0)