Fix bootstrap filesystem AOT under self-host policy (#1116)#1145
Merged
Conversation
Register mkdir, file_put_contents, unlink, and rmdir as real filesystem builtins in SelfHostBuiltinPolicy so PHP_COMPILER_SELFHOST_AOT=1 no longer external-stubs them. Point the bootstrap fixture at a repo-local path instead of sys_get_temp_dir()/getmypid(), which are not available in AOT. 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
mkdir,file_put_contents,unlink, andrmdirinSelfHostBuiltinPolicy::CATEGORY_FILESYSTEMsoPHP_COMPILER_SELFHOST_AOT=1uses real JIT lowering instead of external stubs (fixes00stdout on the bootstrap fixture).test/bootstrap-aot/stdlib_filesystem.phpat a repo-local fixture path instead ofsys_get_temp_dir()/getmypid(), which are not available in AOT.SelfHostBuiltinPolicyTestauto-stub count with the current batch size (32).Supersedes the overlapping portion of #1134 (#1117 stream JIT already landed in #1141).
Test plan
PHP_COMPILER_SELFHOST_AOT=1compile + runtest/bootstrap-aot/stdlib_filesystem.php→ stdout11./script/bootstrap-aot-link.sh→ 65 target(s) OK (Dockerphp-compiler:22.04-dev, LLVM at/opt/llvm9)vendor/bin/phpunit test/unit/SelfHostBuiltinPolicyTest.phpMade with Cursor