Skip to content

Self-host M5: gen-3 bin/compile.php recompile still uses compile_smoke_m3_emit path (not inventory Compiler) #2900

@PurHur

Description

@PurHur

Milestone

M5 (honest compiler driver) — parent #1492. Follow-up to closed #2890.

Problem

Gen-3 argv emit works for bootstrap fixtures (compiler_smoke_standalone.php) but stdout shows the smoke emit helper path, not full Compiler / inventory driver:

compile_smoke_m3_emit: compile OK -> build/gen3-smoke

Recompiling bin/compile.php with gen-2 still produces a gen-3 binary shaped for compile_smoke_m3_emit / M3 sidecars — not an inventory-scale compile driver that can emit arbitrary lib/ PHP without env bridges.

M3 HelloWorld already supports BOOTSTRAP_M3_USE_INVENTORY_EMIT_DRIVER=1 (#2843). Gen-3 product driver should match.

Scope

Path Work
lib/Runtime.php, lib/Compiler.php, lib/JIT.php Real lowering for compiled bin/compile.php argv → Runtime::parseAndCompile without compile_smoke_m3_emit TU
src/cli_driver.php, bin/compile.php Native $argv dispatch on gen-3 link
lib/JIT/SelfHostBuiltinPolicy.php Shrink deny-list / stub surface on compile spine
script/bootstrap-selfhost-full-revision-probe.sh Assert emit_path=native via inventory driver (grep for compile_smoke_m3_emit optional bisect only)

Repro

./script/docker-exec.sh -- bash -lc '
  source script/php-env.sh
  export PHP_COMPILER_LLVM_PATH=/opt/llvm9 LD_LIBRARY_PATH=/opt/llvm9
  BOOTSTRAP_M5_DRIVER_SMOKE=1 make bootstrap-selfhost-driver-smoke >/dev/null
  build/bin-compile-aot -o build/gen3-bin-compile bin/compile.php 2>&1 | grep compile_smoke_m3_emit
  build/gen3-bin-compile -o build/gen3-inv test/selfhost/compiler_unit_probe/compiler_unit_probe_compile.php 2>&1
  # target: inventory driver compiles unit probe without M3 env sidecars
'

Done when

  • Gen-3 driver native-emits a non-smoke inventory fixture (e.g. compiler_unit_probe_compile.php) with emit_path=native and no compile_smoke_m3_emit log line
  • bootstrap-selfhost-full-revision-probe updated to assert inventory path (or dedicated gen-3 probe)
  • Epic: Self-host critical path — compiler compiles itself (M3→M5) #1492 M5 “full Compiler CFG” row moves toward green

Labels

self-host, bootstrap, IMPORTANT

Links

#1492 · #2890 · #2893 · #2843

Metadata

Metadata

Assignees

No one assigned

    Labels

    MOST IMPORTANTThis are the most important targetsphase-0:FoundationPhase 0 – foundation & DevEx

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions