Fix wave 12 bootstrap AOT resolver/superglobal/string regressions (#1086)#1158
Merged
Conversation
…ns (#1086). Add trim/urlencode to SelfHostBuiltinPolicy real lowering, return owned __string__* copies from string builtins, and compile bootstrap-aot fixtures with PHP_COMPILER_SELFHOST_AOT=0 so inherited env does not stub resolver paths. Keep ConstStringFolder stubbed under self-host for probe ICmp stability. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PHP_COMPILER_SELFHOST_AOT=1is inherited from the environment (CI/dev shells): compile bootstrap fixtures withPHP_COMPILER_SELFHOST_AOT=0and keeptrim/urlencodeon the real JIT path viaSelfHostBuiltinPolicy.__string__*copies fromtrim/urlencodeJIT (__string__separate) so nested string compares/strlenno longer segfault on module-string constants.ConstStringFolderstubbed under self-host AOT (probe ICmp); resolver/superglobal bootstrap fixtures use real lowering via the bootstrap-aot compile gate.Root cause
Commit 4404c25 (#1097) widened self-host stubbing (
Superglobals::*,IncludePathResolver::resolve) andtrim/urlencodewere absent fromSelfHostBuiltinPolicy, so with inheritedPHP_COMPILER_SELFHOST_AOT=1bootstrap-aot-link compiled stubbed/no-op builtins. String builtins returning module__string__*constants without__string__separatealso broke consumers (strlen,!==).Before / after stdout (bootstrap-aot fixtures)
include_path_resolver_smoke.php0\n1\n11\n1\n1superglobal_name_check.php0010stdlib_string_trim.php1\nstdlib_string_urlencode.php1\nTest plan
PHP_COMPILER_SELFHOST_AOT=0 bin/compile.phpon all 4 fixtures → stdout matches Zendmake bootstrap-selfhost-probe(probe still green)./script/bootstrap-aot-link.shfor the 4 targets (viaPHP_COMPILER_SELFHOST_AOT=0compile prefix)Partial #1086 — squash when green.
Made with Cursor