Category
Foundation · php-in-php · runtime-shrink · cold-build / #32122 class
Problem
Context::ensureMinimalUserStandaloneBodies() still eagerly NestedJIT/links a large stdlib batch on every thin AOT user-script init (hello-world / aot-smoke path), even when the script never calls those builtins:
Same always-on NestedJIT vs Runtime ABI drift / cold-build surface class as closed #34566 / #34474 / #32122 .1-mint risk. Call sites already ensureLinked / ensureStandaloneBodies / emit* before lookup.
php-src reference
PHP implementation target
Repro
./script/aot-smoke.sh
./script/docker-exec.sh -- bash -lc 'script/cold-build-check.sh'
./script/phpunit.sh --filter 'ContextMinimalStandaloneLazyStdlib|ExamplesHelloWorldAot'
./script/docker-exec.sh -- bash -lc 'printf "%s\n" "<?php echo file_get_contents(__FILE__) !== \"\" ? \"ok\" : \"fail\", PHP_EOL;" >/tmp/fgc.php && php bin/compile.php -o /tmp/fgc.bin /tmp/fgc.php && /tmp/fgc.bin'
Done when
Parent
Category
Foundation· php-in-php · runtime-shrink · cold-build / #32122 classProblem
Context::ensureMinimalUserStandaloneBodies()still eagerly NestedJIT/links a large stdlib batch on every thin AOT user-script init (hello-world / aot-smoke path), even when the script never calls those builtins:StringUtf8Latin1/RewriteVarsRuntime/DefineRuntime/StringStrContains/StatPathRuntimeStringFileGetContents/MetaTagsRuntime/StringHashCrypto/MbNumericEntityStringReadfile/StringBin2hex/StringAddslashes/StringStripslashes/StringFilePutContentsIniRuntime::ensureLinked(comment still cites Type::register__compiler_ini_*shells removed in php-in-php: drop Type::initialize always-on Ini/IncludePath/Session*/WeakRef/Define/RewriteVars ensureLinked — lazy Jit* ABI (peer #34463) #34474)StringRandomBytes::implementSame always-on NestedJIT vs Runtime ABI drift / cold-build surface class as closed
#34566/#34474/#32122.1-mint risk. Call sites alreadyensureLinked/ensureStandaloneBodies/emit*before lookup.php-src reference
ext/standard/— respective builtins; no new C floorPHP implementation target
lib/JIT/Context.php— remove the listed always-on calls fromensureMinimalUserStandaloneBodies(); keep echo/error/argv/superglobal/htmlspecialchars init essentialsContextMinimalStandaloneLazyStdlibRuntimeShrinkTest(peer php-in-php: drop Type::initialize always-on SessionStorageGlobals::ensureGlobals — lazy at session call sites (peer #34550) #34566)runtime/*.c/lib/AOT/runtime/*.cRepro
Done when
ensureMinimalUserStandaloneBodiesdoes not eagerly link the listed stdlib batchfile_get_contents/ini_get/hash/str_containsstill work under thin AOT (lazy ensure)runtime/*.cParent