You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow-up from #1432 / PR #1465. Four compat shims landed in compiler_lib_spine_smoke; src/cli.php remains deferred from the M2 spine bundle until M4 entry wiring.
Parent epic:#1492 (North Star 2 self-host). M4 loop:#1498 ✅ scaffold · native gen-2 #2075.
Problem
src/cli.php is the Zend-side entry for phpc-style argv dispatch during bootstrap. Today it:
requires vendor/autoload.php at top level
Parses $argv and may exit at include time
That breaks bundled AOT lint (php bin/compile.php -l test/selfhost/...) and spine smoke targets that expect side-effect-free compilation units.
Goal
src/cli.php compiles under compiler_lib_spine_smoke (or a thin src/cli_stub.php) and can be invoked from a native gen-2 driver (#2075) without Zend vendor/ on disk.
Implementation hints
Piece
Path
Notes
Entry split
src/cli.php → src/cli_main.php
Top-level only defines functions; main($argv) callable from native bootstrap
Autoload guard
PHP_COMPILER_SELFHOST_AOT
Skip vendor/autoload.php when bundled stubs provide classes (#1520)
src/cli.php requires vendor/autoload.php and executes argv at include time — incompatible with bundled AOT lint / self-host spine until refactor above lands.
Acceptance criteria
script/apply-patches.sh
php bin/compile.php -l test/selfhost/compiler_lib_spine_smoke/main.php
# After refactor:
php bin/compile.php -l src/cli.php
BOOTSTRAP_LIB_SPINE_SMOKE=1 make bootstrap-selfhost-lib-spine-smoke
make bootstrap-aot-link
vendor/bin/phpunit test/unit/BootstrapSelfhostBundleTest.php
Docker:
docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \
make bootstrap-selfhost-lib-spine-smoke
Summary
Follow-up from #1432 / PR #1465. Four compat shims landed in
compiler_lib_spine_smoke;src/cli.phpremains deferred from the M2 spine bundle until M4 entry wiring.Parent epic: #1492 (North Star 2 self-host). M4 loop: #1498 ✅ scaffold · native gen-2 #2075.
Problem
src/cli.phpis the Zend-side entry forphpc-style argv dispatch during bootstrap. Today it:requiresvendor/autoload.phpat top level$argvand mayexitat include timeThat breaks bundled AOT lint (
php bin/compile.php -l test/selfhost/...) and spine smoke targets that expect side-effect-free compilation units.Goal
src/cli.phpcompiles undercompiler_lib_spine_smoke(or a thinsrc/cli_stub.php) and can be invoked from a native gen-2 driver (#2075) without Zendvendor/on disk.Implementation hints
src/cli.php→src/cli_main.phpmain($argv)callable from native bootstrapPHP_COMPILER_SELFHOST_AOTvendor/autoload.phpwhen bundled stubs provide classes (#1520)docs/m3-allowlist-snapshot.txt,docs/m4-allowlist-*.txtsrc/cli.phpwhen emit path stable (#1937)test/selfhost/compiler_lib_spine_smoke/main.phpsrc/cli.phpafter shimsmain()calls compiled CLI dispatcherphp script/bootstrap-inventory.php --checkSuggested steps (ordered)
src/cli.phpso include does not execute argv handlingcompiler_lib_spine_smoke(lint-only first)Blocker (current)
src/cli.phprequiresvendor/autoload.phpand executes argv at include time — incompatible with bundled AOT lint / self-host spine until refactor above lands.Acceptance criteria
script/apply-patches.sh php bin/compile.php -l test/selfhost/compiler_lib_spine_smoke/main.php # After refactor: php bin/compile.php -l src/cli.php BOOTSTRAP_LIB_SPINE_SMOKE=1 make bootstrap-selfhost-lib-spine-smoke make bootstrap-aot-link vendor/bin/phpunit test/unit/BootstrapSelfhostBundleTest.phpDocker:
docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \ make bootstrap-selfhost-lib-spine-smokeDependencies
PHP_COMPILER_SELFHOST_AOTstub surfaceGates (when ready)
Links
Verification
Local/Docker only; do not require GitHub Actions (#394 ✅).