Skip to content

Self-host M3: wire inventory compile_driver in bootstrap-selfhost-jit-unit-probe.sh #3038

Description

@PurHur

Milestone

M3 (emit honesty) — parent #1492. Blocks #3032 (delete jit_unit_probe_m3_emit_native_entry.php). Related #2879.

Category

bootstrap

Problem

HelloWorld, compile-smoke, runtime-smoke, and compiler-unit strict probes honor BOOTSTRAP_M3_USE_INVENTORY_EMIT_DRIVER=1 and log inventory compile_driver (no emit-helper TU). JIT unit probe does not — even when the env var is set, script/bootstrap-selfhost-jit-unit-probe.sh always links test/bootstrap-aot/jit_unit_probe_m3_emit_native_entry.php:

bootstrap-selfhost-jit-unit-probe: native emit helper link OK (
  …, selfhost M3 emit TU (jit_unit_probe_m3_emit_native_entry.php))

There is no test/selfhost/jit_unit_probe/compile_driver.php (compiler-unit has one).

php-src reference

N/A (bootstrap gate). Parity target is internal inventory contract documented in docs/bootstrap-selfhost.md and script/bootstrap-inventory.php — same emit path as HelloWorld/compiler-unit.

Repro

./script/docker-exec.sh -- bash -lc '
  BOOTSTRAP_M3_LINK_COMPILE_DRIVER=1 \
  BOOTSTRAP_M3_COMPILE_DRIVER_REAL_LOWERING=1 \
  BOOTSTRAP_M3_RUNTIME_COMPILE=1 \
  BOOTSTRAP_M3_USE_INVENTORY_EMIT_DRIVER=1 \
  BOOTSTRAP_M3_JIT_UNIT_PROBE_STRICT=1 \
  make bootstrap-selfhost-jit-unit-probe-strict
'

Observed (2026-06-01): links jit_unit_probe_m3_emit_native_entry.php
Expected: log contains inventory compile_driver and emit_path=native (matches helloworld/compiler-unit, #2879)

Scope

Path Work
test/selfhost/jit_unit_probe/compile_driver.php Create — mirror compiler_unit_probe/compile_driver.php (PHP_COMPILER_M3_COMPILE_MODE, PHP_COMPILER_M3_SOURCE, PHP_COMPILER_M3_OUT; bundle jit_unit_probe_compile.php)
script/bootstrap-selfhost-jit-unit-probe.sh Copy inventory-driver branch from bootstrap-selfhost-compiler-unit-probe.sh (lines ~22–79): honor BOOTSTRAP_M3_USE_INVENTORY_EMIT_DRIVER / PHP_COMPILER_M3_INVENTORY_EMIT_DRIVER
Makefile bootstrap-selfhost-jit-unit-probe-strict — set BOOTSTRAP_M3_USE_INVENTORY_EMIT_DRIVER=1 like helloworld target

Not: VM-only changes; new emit-helper TU unless inventory path blocked.

Done when

  • make bootstrap-selfhost-jit-unit-probe-strict logs inventory compile_driver with emit_path=native
  • BOOTSTRAP_M3_USE_INVENTORY_EMIT_DRIVER=1 behaviour matches helloworld/compiler-unit probes
  • #3032 can delete jit_unit_probe_m3_emit_native_entry.php
  • php script/bootstrap-inventory.php --check still 0 blockers after probe change

Verification

./script/docker-exec.sh -- bash -lc 'make bootstrap-selfhost-jit-unit-probe-strict 2>&1 | tee /tmp/jit-unit.log; grep -E "inventory compile_driver|emit_path=native" /tmp/jit-unit.log'

Links

Activity

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

    MOST IMPORTANTThis are the most important targetsarea:compilerCompiler / CFG / JITimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-0:FoundationPhase 0 – foundation & DevEx

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions