Skip to content

Commit b85750b

Browse files
committed
fix(bench): pin cmake 4.0.2 — the import-std UUID is version-specific — and call the reference mcpp by path
两条,都是 CI 上 `linux/clang/mcpp-2026.8.11.3` 那个格子暴露的(该格子的 mcpp 两条臂已经全绿,失败的是外部引擎): **1. cmake 回退到 4.0.2。** `CMAKE_EXPERIMENTAL_CXX_IMPORT_STD` 的 UUID **随 cmake 版本变化**,而 projects/ 里的描述带的是 4.0 那把钥匙。4.4.2 直接拒绝它 (`this CMake's version of the feature`),工程配不出来。4.0.2 同时也是 bench/results/ 里**每一个已发布数字**实际使用的版本 —— 钉它能让表格和矩阵描述 同一个工具。以后升 cmake,必须在同一个提交里把所有描述的 UUID 一起改。 (我当初把 pin 写成 4.4.2 是因为它是 `latest`。「最新」不是判据,「和描述里的 UUID 对得上」才是。) **2. 参照 mcpp 改用二进制路径,不再用裸 `mcpp` shim。** 被测的工作负载自己带 `.xlings.json`,而 harness 跑引擎时 cwd 就在工作负载里 —— 于是裸 `mcpp` 按**那个 workspace** 的 pin 解析: xlings: version '2026.8.11.2' not found for 'mcpp' available: 2026.8.11.3 `$MCPP` 就是 bootstrap 装的那个二进制,而它**就是** reference_mcpp(两者同源于 .xlings.json,由 233 断言)。这也正是 bench/tests/harness.sh 注释里早就写下的 那条规矩:引擎按**二进制**指定,不要靠 PATH 查找。
1 parent 0ae60f1 commit b85750b

5 files changed

Lines changed: 23 additions & 11 deletions

File tree

.github/workflows/bench.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,18 @@ jobs:
381381
#
382382
# Putting it back is one line, and the §8 reproduction is the gate:
383383
# all six fixture scenarios green at --runs 2 before it returns.
384-
e="mcpp=$MCPP_UNDER_TEST,mcpp"
384+
# BOTH ARMS BY PATH, never the bare `mcpp` shim. The measured
385+
# workloads carry their own `.xlings.json`, and the harness runs
386+
# every engine with its cwd inside the workload — so a bare `mcpp`
387+
# resolves against THAT workspace's pin and fails with
388+
#
389+
# xlings: version '2026.8.11.2' not found for 'mcpp'
390+
# available: 2026.8.11.3
391+
#
392+
# $MCPP is the binary the bootstrap installed, which IS
393+
# reference_mcpp (both come from .xlings.json — asserted by
394+
# tests/e2e/233_bench_matrix.sh).
395+
e="mcpp=$MCPP_UNDER_TEST,mcpp=$MCPP"
385396
fi
386397
engines="${engines:+$engines,}$e"
387398
done

bench/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ than what it said.
5353

5454
| what | pinned to | declared in |
5555
|---|---|---|
56-
| cmake | **4.4.2** | `matrix.json``tools` |
56+
| cmake | **4.0.2** | `matrix.json``tools` |
5757
| xmake | **3.1.0** | `matrix.json``tools` |
5858
| bazel | **9.2.0** | `matrix.json``tools` |
5959
| gcc | **16.1.0** | `bench/src/toolchain.cppm` |
@@ -65,15 +65,15 @@ than what it said.
6565
| mcpp under test | the checkout | built by CI, resolved by `newest_artifact.sh` |
6666

6767
**Everything is installed by xlings**, at those exact versions, on every runner.
68-
`xlings install cmake@4.4.2 xmake@3.1.0 bazel@9.2.0 mcpp@2026.8.11.3` is
68+
`xlings install cmake@4.0.2 xmake@3.1.0 bazel@9.2.0 mcpp@2026.8.11.3` is
6969
literally what CI runs, and the job prints the resolved version of each one and
7070
warns loudly if it is not the pinned one.
7171

7272
Four things this bought, each of which had already gone wrong:
7373

7474
* **cmake 3.31.6** is what the GitHub runner images ship. It does not have the
7575
CMake 4.0 experimental key for `import std`, so *every module cell failed to
76-
configure*. With 4.4.2 they pass.
76+
configure*. With 4.0.2 they pass.
7777
* **`command -v g++`** on those images is gcc 13.3.0. cmake cannot configure
7878
C++23 modules with it and xmake crashes it with an internal compiler error —
7979
while mcpp quietly used its own registry's gcc 16.1 regardless. The table read

bench/README.zh-CN.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ bench --project bench/projects/xlings/xlings-2026.8.13.1 \
4949

5050
| 项目 | 钉到 | 声明位置 |
5151
|---|---|---|
52-
| cmake | **4.4.2** | `matrix.json``tools` |
52+
| cmake | **4.0.2** | `matrix.json``tools` |
5353
| xmake | **3.1.0** | `matrix.json``tools` |
5454
| bazel | **9.2.0** | `matrix.json``tools` |
5555
| gcc | **16.1.0** | `bench/src/toolchain.cppm` |
@@ -61,14 +61,14 @@ bench --project bench/projects/xlings/xlings-2026.8.13.1 \
6161
| 被测 mcpp | 当前 checkout | CI 现场构建,由 `newest_artifact.sh` 定位 |
6262

6363
**全部由 xlings 安装**,版本精确,每个 runner 一致。CI 里跑的字面就是
64-
`xlings install cmake@4.4.2 xmake@3.1.0 bazel@9.2.0 mcpp@2026.8.11.3`,而且
64+
`xlings install cmake@4.0.2 xmake@3.1.0 bazel@9.2.0 mcpp@2026.8.11.3`,而且
6565
job 会打印每个工具实际解析到的版本,与钉的版本不符就大声告警。
6666

6767
这解决了四件已经真实发生过的事:
6868

6969
* **cmake 3.31.6** 是 GitHub runner 镜像自带的版本。它没有 CMake 4.0 的
7070
`import std` 实验开关键,所以*每一个 module 格子都 configure 失败*。换成
71-
4.4.2 之后全过。
71+
4.0.2 之后全过。
7272
* **`command -v g++`** 在那些镜像上是 gcc 13.3.0。cmake 用它配不出 C++23
7373
modules,xmake 直接把它编崩(internal compiler error)—— 而 mcpp 一直悄悄用
7474
自己 registry 里的 gcc 16.1。表格是 `48 failed / 6 ok`,却仍然被当作「构建引擎

bench/matrix.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"developer box had 3.1.0. A version that varies per runner is a variable",
2626
"the report does not record and the reader cannot see."
2727
],
28-
"cmake": "4.4.2",
28+
"cmake": "4.0.2",
2929
"xmake": "3.1.0",
3030
"bazel": "9.2.0",
3131
"gcc": "16.1.0",
@@ -38,7 +38,8 @@
3838
"configure C++23 modules with it, xmake crashes it with an internal",
3939
"compiler error, and mcpp quietly used the registry payload anyway — so the",
4040
"table read `48 failed` while claiming to compare build engines."
41-
]
41+
],
42+
"_cmake_note": "4.0.2, not the newest. `CMAKE_EXPERIMENTAL_CXX_IMPORT_STD` is gated by a UUID that CHANGES WITH THE CMAKE VERSION, and the descriptions in projects/ carry the 4.0 key; 4.4.2 rejects it with `this CMake's version of the feature` and the project fails to configure. It is also the version every published number in bench/results/ was measured with, so pinning it keeps the tables and the matrix describing the same tool. Moving to a newer cmake means updating the UUID in every description in the same commit."
4243
},
4344
"reference_mcpp": "2026.8.11.3",
4445
"_reference_mcpp_note": [

bench/src/engines/cmake.cppm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public:
5757
return std::format(
5858
"cmake {}.{} is too old for `import std;` — the experimental gate key "
5959
"changes with the version and these descriptions carry the 4.0 one "
60-
"(bench/matrix.json pins 4.4.2)", ver.major, ver.minor);
60+
"(bench/matrix.json pins 4.0.2)", ver.major, ver.minor);
6161
}
6262

6363
platform::RunResult configure(const Job& job) const override {
@@ -77,7 +77,7 @@ public:
7777
return platform::run(argv, {}, job.log_path, job.timeout_s);
7878
}
7979

80-
// Parsed out of the probe banner ("cmake version 4.4.2"), and cached: the
80+
// Parsed out of the probe banner ("cmake version 4.0.2"), and cached: the
8181
// support question is asked once per cell and spawning cmake each time would
8282
// add a process launch to every row of the matrix.
8383
struct Version { int major{}; int minor{}; };

0 commit comments

Comments
 (0)