Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/local-ci-matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,9 @@ FILE_UPLOAD_WEB_DEPLOY_SMOKE_GATE=1 ./script/deploy-smoke.sh --example 006

## 007-ThrowsWeb gates ([#2076](https://github.com/PurHur/php-compiler/issues/2076), [#2093](https://github.com/PurHur/php-compiler/issues/2093))

Progressive ladder (VM throw/catch → AOT link → AOT execute). VM smoke default-on ([#2125](https://github.com/PurHur/php-compiler/issues/2125), [#2093](https://github.com/PurHur/php-compiler/issues/2093)); AOT gates opt-in until **#195** / **#57** / **#2101** land. Copy-paste ladder: `./phpc doctor --gates` (**#2102**).
Progressive ladder (VM throw/catch → AOT link → AOT execute). VM smoke default-on ([#2125](https://github.com/PurHur/php-compiler/issues/2125), [#2093](https://github.com/PurHur/php-compiler/issues/2093)); AOT gates opt-in until **#195** / **#57** / **#2101** land; execute default-on blocked on **#2157** (follow-up **#2135**). Copy-paste ladder: `./phpc doctor --gates` (**#2102**).

**`ci-local.sh` llvm tail** (mirror **006** link → execute): `ci_run_aot_link_phpunit` (`@group aot-link`, honors `THROWSWEB_AOT_LINK_GATE`) runs before `ci_run_throws_web_aot_execute` (`@group throwsweb-aot-execute`, honors `THROWSWEB_AOT_SMOKE_GATE`) — audit **#2178**; default-on flip **#2135** after **#2157** ✅.

| Stage | Variable | Default | When enabled |
|-------|----------|---------|--------------|
Expand Down
7 changes: 5 additions & 2 deletions lib/Doctor.php
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ private static function printThrowsWebSection(string $repoRoot): void
$smokeDefault,
$smokeOn,
false,
'make examples-throws-smoke · ci-fast/ci-local when THROWS_WEB_SMOKE_GATE=1 default (#2125)',
'make examples-throws-smoke · examples-web-smoke.sh --throws-only · ci-fast (#2125)',
'#2093'
);
self::printSessionsWebGateRow(
Expand All @@ -621,9 +621,12 @@ private static function printThrowsWebSection(string $repoRoot): void
);
$aotStatus = $aotOn && $llvmReady ? '✅' : '📋';
$aotExecuteNote = $llvmReady
? ($aotOn ? '#2101' : '#2101 · opt-in until throw/catch AOT green')
? ($aotOn ? '#2101' : '#2101 · opt-in until #2157 AOT throw/catch green; default-on follow-up #2135')
: 'LLVM required; #2101 when gate=1';
fwrite(STDOUT, " [{$aotStatus}] Stage 3 AOT execute — THROWSWEB_AOT_SMOKE_GATE default {$aotDefault} ({$aotExecuteNote})\n");
if (!$aotOn && $llvmReady) {
fwrite(STDOUT, " Blocker: #2157 user-class ValidationError AOT execute before #2135 default flip\n");
}
fwrite(STDOUT, " PHPUnit: ./script/ci-local.sh --filter ThrowsWebAotExecuteTest\n");
fwrite(STDOUT, " Shell: THROWSWEB_AOT_SMOKE_GATE=1 EXAMPLES_AOT_SMOKE_ONLY=007 ./script/examples-aot-smoke.sh (#2104)\n");

Expand Down
14 changes: 14 additions & 0 deletions test/unit/CiScriptsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,16 @@ public function testCiLocalExcludesThrowsWebAotExecuteUnlessGateOn(): void
$this->assertStringContainsString('THROWSWEB_AOT_SMOKE_GATE:-0}', $body);
}

public function testCiLocalRunsThrowsWebAotLinkBeforeExecute(): void
{
$local = (string) file_get_contents(dirname(__DIR__, 2).'/script/ci-local.sh');
$linkPos = strpos($local, 'ci_run_aot_link_phpunit');
$executePos = strpos($local, 'ci_run_throws_web_aot_execute');
$this->assertNotFalse($linkPos, 'ci-local.sh must call ci_run_aot_link_phpunit');
$this->assertNotFalse($executePos, 'ci-local.sh must call ci_run_throws_web_aot_execute');
$this->assertLessThan($executePos, $linkPos, 'AOT link must run before ThrowsWeb AOT execute (#2178)');
}

public function testCiFastHonorsMiniWebAppServeGate(): void
{
$fast = dirname(__DIR__, 2).'/script/ci-fast.sh';
Expand Down Expand Up @@ -1423,6 +1433,10 @@ public function testLocalCiMatrixDocumentsThrowsWebGates(): void
$this->assertStringContainsString('test007ThrowsWebAotLink', $doc);
$this->assertStringContainsString('ThrowsWebAotExecuteTest', $doc);
$this->assertStringContainsString('#2102', $doc);
$this->assertStringContainsString('ci_run_aot_link_phpunit', $doc);
$this->assertStringContainsString('ci_run_throws_web_aot_execute', $doc);
$this->assertStringContainsString('#2178', $doc);
$this->assertStringContainsString('#2157', $doc);
}

public function testCiDefaultsEnvDefinesThrowsWebAotGatesOff(): void
Expand Down
2 changes: 2 additions & 0 deletions test/unit/PhpcDoctorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ public function testDoctorGatesPrintsMiniWebAppLadder(): void
$this->assertStringContainsString('test007ThrowsWebAotLink', $result['stdout']);
$this->assertStringContainsString('ThrowsWebAotExecuteTest', $result['stdout']);
$this->assertStringContainsString('examples/007-ThrowsWeb/README.md', $result['stdout']);
$this->assertStringContainsString('#2157', $result['stdout']);
$this->assertStringContainsString('#2135', $result['stdout']);
}

/**
Expand Down