Skip to content

Self-host M4: bootstrap-loop-gen1-link default to inventory emit driver (retire compile_smoke_m3_emit_native_entry TU) #2893

@PurHur

Description

@PurHur

Milestone

M4 (bootstrap loop) — parent #1492. Follow-up to closed #2843.

Problem

make bootstrap-loop-probe is green (May 2026 harness), but script/bootstrap-loop-gen1-link.sh still links gen-1 native emit via a separate sidecar TU by default:

m4_link_mode="selfhost M3 emit TU (compile_smoke_m3_emit_native_entry.php)"

HelloWorld strict and BOOTSTRAP_M3_USE_INVENTORY_EMIT_DRIVER=1 already prove compile_driver.php-only native emit (#2843). Gen-2→gen-3 spine uses build/bin-compile-aot argv -o (#2697).

The gen-1 slice should match: one honest compile spine, no parallel emit-helper link for routine M4.

Scope

Path Change
script/bootstrap-loop-gen1-link.sh Default BOOTSTRAP_M3_USE_INVENTORY_EMIT_DRIVER=1 / PHP_COMPILER_M3_INVENTORY_EMIT_DRIVER=1; drop compile_smoke_m3_emit_native_entry.php from default path
test/selfhost/bootstrap_loop_smoke/compile_driver.php Inventory emit entry for gen-2 smoke
lib/JIT.php Any deny-list gaps for loop bundle emit
docs/bootstrap-selfhost.md Gate row: gen-1 emit via inventory driver

Keep emit-helper TU behind explicit bisect env only (BOOTSTRAP_M3_EMIT_HELPER_TU=1).

Repro

grep -n compile_smoke_m3_emit_native_entry script/bootstrap-loop-gen1-link.sh
# default path still references emit-helper TU

# Green with inventory driver (opt-in today):
./script/docker-exec.sh -- bash -lc '
  export PHP_COMPILER_LLVM_PATH=/opt/llvm9 LD_LIBRARY_PATH=/opt/llvm9
  source script/php-env.sh
  BOOTSTRAP_M3_USE_INVENTORY_EMIT_DRIVER=1 make bootstrap-loop-gen1-link
'

Done when

  • Default make bootstrap-loop-gen1-link uses inventory compile_driver.php only (no *_m3_emit_native_entry.php link)
  • make bootstrap-loop-probe stays green
  • Bisect env documented for LLVM 9 emit-helper regressions

Labels

self-host, bootstrap, IMPORTANT

Links

#1492 · #2843 · #1498

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