Skip to content

Fix bootstrap filesystem AOT under self-host policy (#1116)#1145

Merged
PurHur merged 1 commit into
masterfrom
fix/1116-stdlib-filesystem-aot
May 23, 2026
Merged

Fix bootstrap filesystem AOT under self-host policy (#1116)#1145
PurHur merged 1 commit into
masterfrom
fix/1116-stdlib-filesystem-aot

Conversation

@PurHur
Copy link
Copy Markdown
Owner

@PurHur PurHur commented May 23, 2026

Summary

  • Register mkdir, file_put_contents, unlink, and rmdir in SelfHostBuiltinPolicy::CATEGORY_FILESYSTEM so PHP_COMPILER_SELFHOST_AOT=1 uses real JIT lowering instead of external stubs (fixes 00 stdout on the bootstrap fixture).
  • Point test/bootstrap-aot/stdlib_filesystem.php at a repo-local fixture path instead of sys_get_temp_dir() / getmypid(), which are not available in AOT.
  • Sync SelfHostBuiltinPolicyTest auto-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=1 compile + run test/bootstrap-aot/stdlib_filesystem.php → stdout 11
  • ./script/bootstrap-aot-link.sh → 65 target(s) OK (Docker php-compiler:22.04-dev, LLVM at /opt/llvm9)
  • vendor/bin/phpunit test/unit/SelfHostBuiltinPolicyTest.php

Made with Cursor

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>
@PurHur PurHur merged commit 9dae343 into master May 23, 2026
@PurHur PurHur deleted the fix/1116-stdlib-filesystem-aot branch May 23, 2026 18:30
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.

1 participant