Skip to content

Commit f30b4ca

Browse files
committed
bench: attach CMake's own detection log when configure fails
The std.cc question is answered, and it closes the last externally-checkable difference: the runner reports both manifest sources PRESENT. bench: std -> .../include/c++/16.1.0/bits/std.cc (present) bench: std.compat -> .../bits/std.compat.cc (present) So for the linux/gcc cmake arm everything I can inspect from outside now agrees with a machine where the same cmake 4.0.2 and the same gcc 16.1.0 configure, generate and build: the manifest is there, its sources are there, and the runner's exact flag shape (`-B<glibc>/lib -L<glibc>/lib`) reproduces here and works. What remains is inside CMake's own probe. CMake writes that down — CMakeConfigureLog.yaml — and nobody reads it, because it lives in a build directory CI deletes with the job. The cmake adapter now appends its tail to the cell's log ON FAILURE ONLY, so a green run costs nothing and a red one carries the evidence. This is the same move that has now named three failures on their first run after being added (xmake's missing std dependency, bazel's supports_pic, and this arm's crt1.o becoming a generate error): when a cell cannot be diagnosed from CI, fix the diagnosis before guessing again. Every guess I made about this one before the diagnostics existed was wrong.
1 parent b28d355 commit f30b4ca

1 file changed

Lines changed: 32 additions & 1 deletion

File tree

bench/src/engines/cmake.cppm

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,38 @@ public:
6868
};
6969
if (const auto cxx = resolve_cxx(job.compiler); !cxx.empty())
7070
argv.push_back(std::format("-DCMAKE_CXX_COMPILER={}", cxx));
71-
return platform::run(argv, {}, job.log_path, job.timeout_s);
71+
auto r = platform::run(argv, {}, job.log_path, job.timeout_s);
72+
73+
// ── When configure fails, append CMake's OWN detection log ──────────
74+
//
75+
// CMake's user-facing errors about the standard library are summaries:
76+
//
77+
// The "CXX_MODULE_STD" property ... requires that the
78+
// "__CMAKE::CXX23" target exist, but it was not provided by the
79+
// toolchain. Reason: Only `libstdc++` is supported
80+
//
81+
// names neither what it looked for nor what it found. Everything
82+
// checkable from OUTSIDE has been checked for the linux/gcc arm and it
83+
// all agrees with a machine where the same cmake and the same gcc
84+
// succeed: the manifest is present on the runner, both sources it names
85+
// are present, and the runner's exact flag shape reproduces and works
86+
// locally. What is left is inside CMake's own probe, and CMake writes
87+
// that down — in CMakeConfigureLog.yaml, which nobody ever reads
88+
// because it lives in a build directory that CI deletes with the job.
89+
//
90+
// Appended to the cell's log ONLY on failure, so a green run costs
91+
// nothing and a red one carries its own evidence.
92+
if (!r.ok()) {
93+
const auto detail = job.build_dir / "CMakeFiles" / "CMakeConfigureLog.yaml";
94+
if (const auto tail = platform::tail_of(detail, 120); !tail.empty()) {
95+
std::ofstream log(job.log_path, std::ios::app);
96+
if (log) {
97+
log << "\n--- CMakeConfigureLog.yaml (last 120 lines) ---\n"
98+
<< tail;
99+
}
100+
}
101+
}
102+
return r;
72103
}
73104

74105
platform::RunResult build(const Job& job) const override {

0 commit comments

Comments
 (0)