Skip to content

php-in-php: lazy CliArgvRuntime from ensureMinimal (#34822) - #34825

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-34822-cliargv-lazy-minimal
Aug 25, 2026
Merged

php-in-php: lazy CliArgvRuntime from ensureMinimal (#34822)#34825
PurHur merged 1 commit into
masterfrom
agent/issue-34822-cliargv-lazy-minimal

Conversation

@PurHur

@PurHur PurHur commented Aug 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • Drop CliArgvRuntime::ensureStandaloneBodies from Context::ensureMinimalUserStandaloneBodies so thin AOT hello-world / aot-smoke no longer eagerly links CLI argv ABI during init (#32122 / *.1 mint class; peer #34812 / #34807).
  • compileToFile thin path + CliArgvGlobalInit / JitGetopt already ensureLinked before lookup.
  • Restore builder insert block after ABI emit (peer MetaTags #27317 / #34812) so mid-{main} $argc/$argv ensureLinked does not orphan calls / fail Module.php:180.
  • Update peer shrink keep-lists + new unit shrink test; standalone unit test mirrors compileToFile ensure.

Closes #34822

php-src: ext/standard/basic_functions.c$argc / $argv CLI SAPI

Test plan

  • ./script/phpunit.sh --filter 'ContextMinimalStandaloneLazy|CliArgvRuntimeShrinkTest|CliArgvGlobalInitTest|CliArgvRuntimeStandaloneTest'OK (58 tests, 374 assertions)
  • ./script/aot-smoke.sh8/8
  • hello-world AOT → hi; $argc/$argv[0]1|y; mid-{main} echo "x"; echo $argcx1
  • hello-world binary still defines __phpc_cli_store_argv via compileToFile (nm count 1)

Made with Cursor

Drop always-on CLI argv ABI link during thin AOT init; call sites and
compileToFile already ensureLinked. Restore insert block after mid-{main}
emit to avoid Module.php:180 / *.1 mint (#32122 class).

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 47d9156 into master Aug 25, 2026
1 check failed
@PurHur
PurHur deleted the agent/issue-34822-cliargv-lazy-minimal branch August 25, 2026 20:12
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.

php-in-php: drop Context ensureMinimalUserStandaloneBodies always-on CliArgvRuntime — lazy at CliArgvGlobalInit / compileToFile (#32122 class)

1 participant