Skip to content

Self-host M5: native emit bin/compile.php fails — parseAndCompile returned null #2633

Closed

Description

@PurHur

Milestone

M5 — gen-1 binary compiles production bootstrap driver (child of #2600 / #1492)

Problem

M3 strict emit ladder is green for HelloWorld / compile-smoke / runtime fixtures, but the production driver still fails at native emit:

./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=bin/compile.php \
  PHP_COMPILER_M3_OUT=/tmp/bin-compile-aot \
  ./build/selfhost-helloworld-emit
'

Observed (2026-05-27 harness):

helloworld_compile_smoke: parseAndCompile returned null (parser/CFG spine)
helloworld_compile_smoke: native emit failed at phase=parseAndCompile

Zend lint of the same file passes: php bin/compile.php -l bin/compile.php exit 0.

This is the first M5 compile-path failure after M4 loop slice green — distinct from M3 trivial-fixture emit.

Scope

Path Work
bin/compile.php Compile target; capture first unsupported CFG/Runtime path
lib/Runtime.php parseAndCompile() / parse pipeline init on emit-TU
lib/JIT.php M3 compile-driver spine allowlist / emit-TU Runtime init
lib/JIT/RuntimeEmitTuInit.php, lib/JIT/RuntimeInitCompiler.php Emit-TU init sequence for full driver
lib/Compiler.php First Unsupported * or null return on bin/compile.php CFG
test/selfhost/compiler_helloworld_smoke/ Optional probe env PHP_COMPILER_M3_SOURCE=bin/compile.php gate

Repro

See Problem block. Bisect with:

./script/docker-exec.sh -- bash -lc '
  source script/php-env.sh
  php bin/print.php bin/compile.php 2>&1 | head -40   # CFG under Zend
  ./phpc lint bin/compile.php 2>&1 | head -20
'

Done when

Links

#2600 · #1402 · #2568 ✅ (trivial fixtures) · #2484 (stub inventory) · #1492

Activity

  1. PurHur commented on May 27, 2026

    @PurHur
    OwnerAuthor

    Backlog architect re-verify (2026-05-27, docker-exec tar-copy):

    After bootstrap-selfhost-helloworld-probe.sh (strict, emit helper linked):

    helloworld_compile_smoke: parseAndCompile returned null (parser/CFG spine)
    helloworld_compile_smoke: native emit failed at phase=parseAndCompile
    

    HelloWorld fixture emit remains ✅ emit_path=native. Failure is specific to PHP_COMPILER_M3_SOURCE=bin/compile.php.

    Likely related: #2640 (vendor/autoload in src/cli_driver.php).

  2. added 2 commits that reference this issue on May 27, 2026
  3. PurHur commented on May 27, 2026

    @PurHur
    OwnerAuthor

    Backlog architect bisect (2026-05-27) — build/selfhost-helloworld-emit after make bootstrap-selfhost-helloworld:

    PHP_COMPILER_M3_SOURCE Result
    test/bootstrap-aot/compiler_smoke_standalone.php ✅ compile OK
    bin/compile.php ❌ parseAndCompile returned null
    lib/Compiler.php ❌ null
    src/cli_driver.php ❌ null
    test/selfhost/compiler_unit_probe/compiler_unit_probe_compile.php ❌ null (dedicated emit entry green — #2666)

    Child narrowing: #2666. Full spine loop: #2664.

  4. added 2 commits that reference this issue on May 27, 2026
  5. PurHur commented on May 27, 2026

    @PurHur
    OwnerAuthor

    Probe note (2026-05-27): M5 repro via ./build/selfhost-helloworld-emit logs compile_smoke_m3_emit: — use compile_driver path (#2681). parseAndCompile returned null may improve after spine #2679 is fixed.

  6. PurHur commented on May 29, 2026

    @PurHur
    OwnerAuthor

    Inventory argv path compiles bin/compile.php when driver is validated/rebuilt (#3058). Remaining M5 gap: Zend-free cold bootstrap on empty build/ (#1416).

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