Skip to content

Self-host: M3 emit helper compile lib/Compiler.php via parseAndCompile - #2738

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-2666-emit-helper-parseandcompile
May 27, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-2666-emit-helper-parseandcompile

Conversation

@PurHur

@PurHur PurHur commented May 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Switch the emit-helper fallback from the emit-smoke subset to Runtime::parseAndCompile, enabling native emit of inventory-scale sources (notably lib/Compiler.php and bin/compile.php).
  • Avoid eagerly executing the heavy fallback path when the source matches a link-time trivial sidecar, preserving strict HelloWorld native emit stability.

Evidence (Docker)

  • BOOTSTRAP_M3_HELLOWORLD_STRICT=1 make bootstrap-selfhost-helloworld (green; emit_path=native)
  • BOOTSTRAP_M3_COMPILE_SMOKE_STRICT=1 make bootstrap-selfhost-compile-smoke-strict (green; emit_path=native)
  • After make bootstrap-selfhost-helloworld, the shared helper compiles inventory-scale sources:
    • PHP_COMPILER_M3_SOURCE=lib/Compiler.php ... ./build/selfhost-helloworld-emit → compile OK
    • PHP_COMPILER_M3_SOURCE=bin/compile.php ... ./build/selfhost-helloworld-emit → compile OK

Issue links

Made with Cursor

Teach the M3 emit helper bridge to call Runtime::parseAndCompile (not the emit-smoke subset) so it can compile inventory-scale sources like lib/Compiler.php and bin/compile.php. Restructure trivial-sidecar matching to avoid eagerly executing the heavy fallback path, preserving strict HelloWorld native emit.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 1274c0d into master May 27, 2026
@PurHur
PurHur deleted the agent/issue-2666-emit-helper-parseandcompile branch May 27, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Self-host M5: helloworld emit-TU — parseAndCompile null for lib/Compiler.php (trivial fixtures OK)

1 participant