Repository navigation
Self-host M0/M2: lib/JIT.php Expr_ArrowFunction fatal blocks bootstrap-selfhost-link #2573
Copy link
Copy link
Closed
Labels
MOST IMPORTANTThis are the most important targetsThis are the most important targetsarea:compilerCompiler / CFG / JITCompiler / CFG / JITphase-0:FoundationPhase 0 – foundation & DevExPhase 0 – foundation & DevEx
Description
Milestone
M0/M2 — blocks compiler_minimal native link and M2 spine smoke until fixed (#1492)
Problem
make bootstrap-selfhost-link fails at Zend parse (before LLVM) with:
PHP Fatal error: Uncaught RuntimeException: Unknown Expr Type Expr_ArrowFunction
in vendor/ircmaxell/php-cfg/lib/PHPCfg/Parser.php:940
bootstrap-selfhost-link: compile failed (progress gate; see stderr above)
Root cause: lib/JIT.php uses PHP 7.4+ arrow functions in array_map callbacks on the compiler_minimal spine path:
lib/JIT.php:3664—static fn (string $n): string => ltrim($n, '\\')lib/JIT.php:4413— same pattern
PHPCfg\Parser (vendor php-cfg) does not implement Expr_ArrowFunction. Full language lowering is tracked in #142; this issue is the bootstrap unblock on the compile path.
Scope
| Path | Work |
|---|---|
lib/JIT.php |
Replace the two static fn callbacks with static function (string $n): string { return ltrim($n, '\\'); } (or equivalent closure) |
test/selfhost/compiler_minimal/main.php |
No change expected (already require_onces lib/JIT.php) |
test/selfhost/compiler_lib_spine_smoke/main.php |
Unblocked once JIT.php parses |
Out of scope: VM/JIT lowering for arrow functions (#142). Optional follow-up: php-cfg parse-only patch (#2574).
Repro (harness-safe)
./script/docker-exec.sh -- bash -lc 'make bootstrap-selfhost-link'
# exit 1 — Expr_ArrowFunction fatal
./script/docker-exec.sh -- bash -lc 'BOOTSTRAP_LIB_SPINE_SMOKE=1 make bootstrap-selfhost-lib-spine-smoke'
# same fatal at compile step
./script/docker-exec.sh -- bash -lc './script/bootstrap-loop-probe.sh --dry-run'
# exit 1 at M2 lib spine smoke (same stack trace)Done when
-
make bootstrap-selfhost-linkprintscompiler_minimal bundle OK -
BOOTSTRAP_LIB_SPINE_SMOKE=1 make bootstrap-selfhost-lib-spine-smokereaches native link (may still hit downstream M3/M4 blockers) -
./script/bootstrap-loop-probe.sh --dry-runpasses M2 spine step (M3 partial may still be 🚧)
Labels
Suggest: self-host, bootstrap, IMPORTANT (blocks entire M2–M4 ladder until green)
Links
- Epic: Self-host critical path — compiler compiles itself (M3→M5) #1492 epic · Language: Arrow functions (fn() => expr) #142 (full arrow fn language) · Self-host M0: php-cfg vendor patch — parse Expr_ArrowFunction for bootstrap spine #2574 (optional php-cfg parse patch)
- Downstream M3 emit issues (Self-host M3: runtime_m3_emit execute — parseAndCompile returned null (smallest emit TU) #2559, Self-host M3: Runtime::parseAndCompile native spine returns null in emit-TU bridge #2566, Self-host M3: helloworld_m3_emit execute — parseAndCompile returned null (HelloWorld emit TU) #2567) are unreachable until this gate is green
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
MOST IMPORTANTThis are the most important targetsThis are the most important targetsarea:compilerCompiler / CFG / JITCompiler / CFG / JITphase-0:FoundationPhase 0 – foundation & DevExPhase 0 – foundation & DevEx
Activity