Skip to content

Commit 01057cb

Browse files
ondrejmirtesclaude
andcommitted
List ExpressionResultStorage.cpp in the Windows build and check config.w32 completeness
The Unix builds glob their sources, but config.w32 lists them explicitly, so the new file only surfaced as an unresolved external on the Windows link. side-by-side.php --check now verifies every .cpp under turbo-ext/src appears in config.w32 (and nothing stale remains listed), so the version job catches this before a Windows runner does. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcA8GGUMoDM6y7QTCwLj2S
1 parent 0b8e772 commit 01057cb

2 files changed

Lines changed: 28 additions & 2 deletions

File tree

‎turbo-ext/bin/side-by-side.php‎

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,32 @@ function checkStructure(array $manifest): array
332332
return $problems;
333333
}
334334

335+
/**
336+
* The Unix builds glob their sources (the Makefile wildcard, config.m4's
337+
* echo), but config.w32 lists them explicitly — a new .cpp missing from that
338+
* list only surfaces as an unresolved external on the Windows link.
339+
*
340+
* @return list<string> problems
341+
*/
342+
function checkWindowsSources(): array
343+
{
344+
$problems = [];
345+
preg_match_all('~(\w+)\.cpp~', file_get_contents('turbo-ext/config.w32'), $m);
346+
$listed = $m[1];
347+
$actual = array_map(
348+
static fn ($f) => basename($f, '.cpp'),
349+
array_merge(glob('turbo-ext/src/*.cpp'), glob('turbo-ext/src/parser/*.cpp')),
350+
);
351+
foreach (array_diff($actual, $listed) as $missing) {
352+
$problems[] = sprintf('%s.cpp is missing from the source lists in turbo-ext/config.w32 — the Windows build would fail with an unresolved external at link time', $missing);
353+
}
354+
foreach (array_diff($listed, $actual) as $extra) {
355+
$problems[] = sprintf('turbo-ext/config.w32 mentions %s.cpp, which does not exist under turbo-ext/src/', $extra);
356+
}
357+
358+
return $problems;
359+
}
360+
335361
if (in_array('--update-manifest', $argv, true)) {
336362
// Regenerate the manifest from ground truth: each stub names the shadowed
337363
// class, the autoloader locates its PHP implementation (the enabler is NOT
@@ -374,7 +400,7 @@ function checkStructure(array $manifest): array
374400

375401
if ($check) {
376402
$failed = false;
377-
foreach (checkStructure($manifest) as $problem) {
403+
foreach (array_merge(checkStructure($manifest), checkWindowsSources()) as $problem) {
378404
printf("✗ %s\n", $problem);
379405
$failed = true;
380406
}

‎turbo-ext/config.w32‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ if (PHP_PHPSTAN_TURBO != "no") {
2929
// directory by splitting on backslashes only — with forward slashes the
3030
// objects compile flat while the link list expects the subpath
3131
EXTENSION("phpstan_turbo",
32-
"src\\main.cpp src\\support.cpp src\\ArenaCache.cpp src\\CombinationsHelper.cpp src\\ConditionalExpressionHolder.cpp src\\ExpressionTypeHolder.cpp src\\NodeScanner.cpp src\\NodeTraverser.cpp src\\ScopeOps.cpp src\\TrinaryLogic.cpp src\\TypeCombinatorCache.cpp",
32+
"src\\main.cpp src\\support.cpp src\\ArenaCache.cpp src\\CombinationsHelper.cpp src\\ConditionalExpressionHolder.cpp src\\ExpressionResultStorage.cpp src\\ExpressionTypeHolder.cpp src\\NodeScanner.cpp src\\NodeTraverser.cpp src\\ScopeOps.cpp src\\TrinaryLogic.cpp src\\TypeCombinatorCache.cpp",
3333
true,
3434
flags);
3535
ADD_SOURCES(configure_module_dirname + "/src/parser",

0 commit comments

Comments
 (0)