Skip to content

Commit 999a71a

Browse files
committed
fix(e2e): bench 必须测被测二进制,而不是 PATH 上的 mcpp
CI 三个 e2e 分片全红,原因由新加的子进程日志转储一次点明: [error] xlings: 'mcpp' is not installed [error] hint: xlings install mcpp bench 默认用裸名 `mcpp`,在 e2e 沙箱里那是个 xlings shim,解析不到任何东西; 而 $MCPP 才是这次要测的构建产物。改为 `--engines mcpp=$MCPP` —— 这本来就是 更正确的语义:e2e 应当测它构建出来的那个二进制,不是环境里碰巧装了什么。 顺带证明了上一提交加的日志转储是必要的:在此之前,失败信息只有一个指向 已被 trap 删除的 tmpdir 的路径。
1 parent 5c8e87f commit 999a71a

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

bench-child.log

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
Inferred target mcpp (bin from src/main.cpp)
55
Compiling mcpp v2026.8.12.1 (.)
66
Cached mcpplibs.cmdline v0.0.1 (3 units)
7-
Finished release [optimized] in 0.22s
7+
Finished release [optimized] in 78.15s

tests/e2e/230_bench_harness.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ BENCH="$REPO/bench/$BENCH"
2121
# 1. Availability listing must classify mcpp itself as present. If this fails the
2222
# probe path is broken, and every later cell would be reported `unavailable`
2323
# for the wrong reason.
24-
out=$("$BENCH" --list)
24+
# Engines are named by BINARY, not by PATH lookup: `$MCPP` is the build under
25+
# test, while a bare `mcpp` resolves to whatever the sandbox has — on CI that is
26+
# an xlings shim reporting "'mcpp' is not installed", which failed every cell.
27+
out=$("$BENCH" --list --engines "mcpp=$MCPP")
2528
# The label carries the version it discovered ("mcpp@2026.8.12.1"), which is what
2629
# makes a two-binary comparison legible; match the prefix, not the whole token.
2730
echo "$out" | grep -qE '^mcpp(@[^ ]+)? +yes' || { echo "mcpp not reported available:"; echo "$out"; exit 1; }
@@ -39,7 +42,7 @@ dump_child_logs() {
3942
done
4043
}
4144

42-
"$BENCH" --engines mcpp --variants modules --scenarios cold,noop \
45+
"$BENCH" --engines "mcpp=$MCPP" --variants modules --scenarios cold,noop \
4346
--units 4 --fanin 2 --weight 2 --runs 1 \
4447
--work "$TMP/work" --out "$TMP/report.json" > "$TMP/stdout.txt" \
4548
|| { echo "harness exited non-zero"; dump_child_logs; exit 1; }
@@ -80,7 +83,7 @@ PY
8083
# 6. The three fixture variants must all generate and differ in SHAPE, not just
8184
# in file names: modules-impl is the variant whose whole point is that bodies
8285
# live outside the interface unit.
83-
"$BENCH" --engines mcpp --variants headers,modules,modules-impl --scenarios noop \
86+
"$BENCH" --engines "mcpp=$MCPP" --variants headers,modules,modules-impl --scenarios noop \
8487
--units 3 --fanin 1 --weight 1 --runs 1 \
8588
--work "$TMP/w2" --out "$TMP/r2.json" > /dev/null
8689
# Directory names are slugged from the engine label, which carries a version, so

0 commit comments

Comments
 (0)