Skip to content

Self-host: bootstrap-selfhost-helloworld fails (compile_driver) — parseAndCompile 'Unknown type encountered' #9068

Description

@PurHur

Category

bootstrap — M3 helloworld self-host gate (blocks #1492 ladder)

Problem

make bootstrap-selfhost-helloworld fails while AOT-linking the inventory compile_driver emit helper. Runtime::parseAndCompile() aborts with Unknown type encountered on both compile_driver.php and main.php in the helloworld smoke tree.

php-src reference

N/A — compile-pipeline / type-lowering gap during self-host AOT (not Zend runtime parity).

Repro

# Full gate (Docker, ~minutes):
./script/docker-exec.sh -- bash -lc 'make bootstrap-selfhost-helloworld'

# Observed failure (2026-06-17):
# parseAndCompile failure: target=/compiler/test/selfhost/compiler_helloworld_smoke/compile_driver.php: Unknown type encountered
# parseAndCompile failure: target=/compiler/test/selfhost/compiler_helloworld_smoke/main.php: Unknown type encountered
# make: *** [Makefile:355: bootstrap-selfhost-helloworld] Error 1

# Link-only step (faster triage):
./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_HELLOWORLD_STRICT=1 \
  ./script/bootstrap-selfhost-helloworld-probe.sh
'

# Prerequisite check — link stage passes, helloworld fails:
./script/docker-exec.sh -- bash -lc 'make bootstrap-selfhost-link'

Shrink goal: bisect compile_driver.php / main.php with bin/compile.php or bin/vm.php -l until a minimal -r snippet triggers the same Unknown type encountered without the full helloworld Makefile.

Scope (this repo)

Path Work
test/selfhost/compiler_helloworld_smoke/compile_driver.php Failing compile unit
test/selfhost/compiler_helloworld_smoke/main.php Secondary failure
lib/Runtime.php Runtime::parseAndCompile() type dispatch
lib/Compiler.php Type lowering gap surfacing as "Unknown type encountered"
lib/JIT.php AOT emit of inventory compile driver

Done when

  • make bootstrap-selfhost-helloworld passes in Docker
  • Minimal repro PHPT or self-host guard added so regression fails before full helloworld link
  • If compile-only fast path applies, document proof gate (php-compiler-strict) in PR — default CI remains php-src-strict elsewhere

Related

Notes

  • make bootstrap-selfhost-link: OK (link stage alone passes)
  • Fails specifically on helloworld probe emit-helper link with real lowering enabled

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

    IMPORTANTCritical patharea: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