Skip to content

Self-host M5: helloworld emit-TU — parseAndCompile null for lib/Compiler.php (trivial fixtures OK) #2666

Closed

Description

@PurHur

Milestone

M5 — emit-TU compile driver beyond trivial fixtures (child of #2633 / #2600)

Problem

M3 strict ladder is green for trivial sources via dedicated emit entries, but the shared build/selfhost-helloworld-emit helper returns parseAndCompile returned null for inventory-scale compiler PHP:

Source Via ./build/selfhost-helloworld-emit Via dedicated M3 emit entry
test/bootstrap-aot/compiler_smoke_standalone.php ✅ compile OK ✅ (compile-smoke strict)
examples/000-HelloWorld/main.php ✅ (make bootstrap-selfhost-helloworld) ✅
test/selfhost/compiler_unit_probe/compiler_unit_probe_compile.php ❌ null ✅ (make bootstrap-selfhost-compiler-unit-probe-strict)
lib/Compiler.php ❌ null —
bin/compile.php ❌ null —

This blocks unifying emit paths toward #1521 / #2600.

Scope

Path Work
test/selfhost/compiler_helloworld_smoke/helloworld_m3_emit_native_entry.php Align allowlist / Runtime init with unit-probe emit entry
lib/JIT/RuntimeEmitTuInit.php, lib/JIT/RuntimeInitCompiler.php Emit-TU init for lib/Compiler.php CFG scale
lib/Runtime.php parseAndCompile() null return → real error / first unsupported site
lib/Compiler.php First CFG lowering gap on full compiler unit
bin/compile.php Production driver (parent #2633)

Repro

./script/docker-exec.sh -- bash -lc '
  source script/php-env.sh
  BOOTSTRAP_M3_HELLOWORLD_STRICT=1 make bootstrap-selfhost-helloworld
  PHP_COMPILER_M3_COMPILE_MODE=compile \
  PHP_COMPILER_M3_SOURCE=lib/Compiler.php \
  PHP_COMPILER_M3_OUT=/tmp/compiler-aot \
  ./build/selfhost-helloworld-emit
'
# helloworld_compile_smoke: parseAndCompile returned null

# Contrast — green:
make bootstrap-selfhost-compiler-unit-probe-strict

Done when

Labels

self-host, bootstrap, IMPORTANT

Links

#2633 · #2600 · #1402 · #1492

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions