Problem
North Star 2 M5 requires no vendor/autoload.php at cold bootstrap while the compiler remains PHP (lib/ + ext/). Today Zend runs bin/compile.php; the self-host bundle uses PHP_COMPILER_SELFHOST_AOT stubs for compiler paths but still expects Composer vendor on disk for php-parser/php-cfg/php-llvm at link time.
Vendor PHP is not compiled from source inside the self-host binary today (see docs/bootstrap-selfhost.md non-goals).
Goal (M5 v1)
Prelink bootstrap vendor as native objects or bitcode (same pattern as lib/AOT/runtime/*.c):
| Package |
Role |
nikic/php-parser |
AST |
ircmaxell/php-cfg |
CFG |
ircmaxell/php-types |
Types |
ircmaxell/php-llvm |
LLVM FFI |
pre/plugin |
Parser plugin |
Inventory: php script/bootstrap-vendor-inventory.php → docs/bootstrap-vendor-inventory.md (~497 PHP files).
Deliverable: linked native compiler binary runs script/bootstrap-wave-check.sh without vendor/ tree on PATH.
Implementation hints
| Piece |
Path |
Notes |
| Inventory |
script/bootstrap-vendor-inventory.php |
Already lists files; extend with blocker tags |
| Build |
Makefile target bootstrap-vendor-objects |
Emit build/bootstrap-vendor/*.o via AOT or clang from generated C |
| Link |
lib/AOT/Linker.php |
Link prelinked archive + compiler_minimal / full spine objects |
| CI |
BOOTSTRAP_VENDOR_PRELINK_GATE=0 → 1 in ci-local.sh tail |
Opt-in until green |
| Docs |
docs/bootstrap-m5-fast-path.md |
Cold-boot story for #1492 |
Prerequisites (do not skip)
Acceptance criteria
php script/bootstrap-vendor-inventory.php --check
make bootstrap-vendor-objects # when target exists
# Cold boot probe (no vendor/):
BOOTSTRAP_VENDOR_PRELINK_GATE=1 ./script/bootstrap-wave-check.sh
docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev make bootstrap-selfhost-probe
Non-goals
Links
Problem
North Star 2 M5 requires no
vendor/autoload.phpat cold bootstrap while the compiler remains PHP (lib/+ext/). Today Zend runsbin/compile.php; the self-host bundle usesPHP_COMPILER_SELFHOST_AOTstubs for compiler paths but still expects Composer vendor on disk for php-parser/php-cfg/php-llvm at link time.Vendor PHP is not compiled from source inside the self-host binary today (see
docs/bootstrap-selfhost.mdnon-goals).Goal (M5 v1)
Prelink bootstrap vendor as native objects or bitcode (same pattern as
lib/AOT/runtime/*.c):nikic/php-parserircmaxell/php-cfgircmaxell/php-typesircmaxell/php-llvmpre/pluginInventory:
php script/bootstrap-vendor-inventory.php→docs/bootstrap-vendor-inventory.md(~497 PHP files).Deliverable: linked native compiler binary runs
script/bootstrap-wave-check.shwithoutvendor/tree onPATH.Implementation hints
script/bootstrap-vendor-inventory.phpMakefiletargetbootstrap-vendor-objectsbuild/bootstrap-vendor/*.ovia AOT or clang from generated Clib/AOT/Linker.phpcompiler_minimal/ full spine objectsBOOTSTRAP_VENDOR_PRELINK_GATE=0→1inci-local.shtaildocs/bootstrap-m5-fast-path.mdPrerequisites (do not skip)
PHP_COMPILER_SELFHOST_AOTstub surface before vendor prelinkAcceptance criteria
build/bootstrap-vendor/*.o(or.bcarchive)lib/AOT/Linker.phplinks prelinked vendor + generated compiler.ovendor/on diskdocs/bootstrap-m5-fast-path.mdNon-goals
Links