Problem
BOOTSTRAP_LIB_SPINE_SMOKE=1 make bootstrap-selfhost-lib-spine-smoke is red on master (Docker php-compiler:22.04-dev, May 2026):
PHP Fatal error: Uncaught LogicException: Unknown type node: UnionType
in vendor/ircmaxell/php-cfg/lib/PHPCfg/Parser.php:206
… Runtime->parse() → bin/compile.php during spine bundle compile
php bin/compile.php -l test/selfhost/compiler_lib_spine_smoke/main.php fails with the same error.
Docs still claim M2 native link ✅ (docs/self-host-target.md, docs/bootstrap-selfhost.md). make bootstrap-loop-probe --dry-run fails at the M2 prerequisite step.
We already ship patches/php-cfg-intersection-type.patch for IntersectionType; union return/parameter types are not parsed.
First offender (spine bundle)
| File |
Symbol |
Syntax |
ext/standard/VmString.php |
VmString::str_word_count |
): int|array (line ~1931) |
Audit other inventory paths after the patch lands (grep -E '\): [A-Za-z_\\]+\|' ext/ lib/).
Goal
Spine bundle compiles and links natively without Zend:
BOOTSTRAP_LIB_SPINE_SMOKE=1 make bootstrap-selfhost-lib-spine-smoke
# stdout: compiler_lib_spine_smoke bundle OK
./script/bootstrap-loop-probe.sh --dry-run # M2 step passes
Implementation hints
| Piece |
Path |
Notes |
| Vendor patch |
patches/php-cfg-union-type.patch |
Mirror php-cfg-intersection-type.patch: Op\Type\Union, parseTypeNode() for Node\UnionType |
| Apply |
script/apply-patches.sh |
Composer patches entry if needed |
| CFG types |
lib/Compiler.php / lib/JIT.php |
Only if lowering gaps appear after parse (separate PR) |
| Spine |
test/selfhost/compiler_lib_spine_smoke/main.php |
No shim removal required for this slice |
Done when
Repro (local / Docker only)
script/apply-patches.sh
./script/docker-exec.sh -- bash -lc 'BOOTSTRAP_LIB_SPINE_SMOKE=1 make bootstrap-selfhost-lib-spine-smoke'
No GitHub Actions (#394 ✅).
Dependencies / links
Problem
BOOTSTRAP_LIB_SPINE_SMOKE=1 make bootstrap-selfhost-lib-spine-smokeis red onmaster(Dockerphp-compiler:22.04-dev, May 2026):php bin/compile.php -l test/selfhost/compiler_lib_spine_smoke/main.phpfails with the same error.Docs still claim M2 native link ✅ (
docs/self-host-target.md,docs/bootstrap-selfhost.md).make bootstrap-loop-probe --dry-runfails at the M2 prerequisite step.We already ship
patches/php-cfg-intersection-type.patchforIntersectionType; union return/parameter types are not parsed.First offender (spine bundle)
ext/standard/VmString.phpVmString::str_word_count): int|array(line ~1931)Audit other inventory paths after the patch lands (
grep -E '\): [A-Za-z_\\]+\|' ext/ lib/).Goal
Spine bundle compiles and links natively without Zend:
Implementation hints
patches/php-cfg-union-type.patchphp-cfg-intersection-type.patch:Op\Type\Union,parseTypeNode()forNode\UnionTypescript/apply-patches.shlib/Compiler.php/lib/JIT.phptest/selfhost/compiler_lib_spine_smoke/main.phpDone when
BOOTSTRAP_LIB_SPINE_SMOKE=1 make bootstrap-selfhost-lib-spine-smokeexits 0 on harnessphp bin/compile.php -l test/selfhost/compiler_lib_spine_smoke/main.phpexits 0docs/bootstrap-selfhost.mdM2 row matches reality (no false green)Repro (local / Docker only)
script/apply-patches.sh ./script/docker-exec.sh -- bash -lc 'BOOTSTRAP_LIB_SPINE_SMOKE=1 make bootstrap-selfhost-lib-spine-smoke'No GitHub Actions (#394 ✅).
Dependencies / links
bin/vm.phppromotion), Self-host M2: BootstrapVmDriver native execute smoke (post-#2134 bin/vm.php link) #2201 VM driver execute, M4: Bootstrap loop — native binary rebuilds next compiler revision #1498 / Self-host M4: Native gen-2 AOT emit without Zend fallback (post-#1498) #2075 M4 loop