Skip to content

Fix bootstrap stdlib filesystem AOT under self-host stub gating (#1116)#1144

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

Fix bootstrap stdlib filesystem AOT under self-host stub gating (#1116)#1144
PurHur merged 1 commit into
masterfrom
fix/1116-stdlib-filesystem-selfhost-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 they keep real JIT lowering when PHP_COMPILER_SELFHOST_AOT=1 (previously stubbed to no-op ExternalMethod, producing 00 instead of 11).
  • Add BootstrapPhaseCTest::testStdlibFilesystemAotLinkAndExecute for Phase C link+execute coverage.
  • Sync SelfHostBuiltinPolicyTest auto-stub batch count (32) and assert filesystem builtins are not stubbed.

Closes #1116. Supersedes stale #1134 (fopen/fread/fclose landed via #1141).

Test plan

  • PHP_COMPILER_SELFHOST_AOT=1 php bin/compile.php -o /tmp/fs test/bootstrap-aot/stdlib_filesystem.php && /tmp/fs11
  • phpunit test/unit/SelfHostBuiltinPolicyTest.php
  • phpunit test/aot/BootstrapPhaseCTest.php --filter testStdlibFilesystem
  • ./script/bootstrap-aot-link.shstdlib_filesystem.php not in failure list (4 unrelated targets still failing on master)
  • ./script/ci-fast.sh --filter SelfHostBuiltinPolicyTest

Made with Cursor

).

Register mkdir, file_put_contents, unlink, and rmdir in SelfHostBuiltinPolicy
so bootstrap stdlib_filesystem.php executes correctly when
PHP_COMPILER_SELFHOST_AOT=1, and add Phase C PHPUnit coverage.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur PurHur force-pushed the fix/1116-stdlib-filesystem-selfhost-aot branch from 9f18be5 to f8473ff Compare May 23, 2026 18:30
@PurHur PurHur merged commit e360eac into master May 23, 2026
1 check failed
@PurHur PurHur deleted the fix/1116-stdlib-filesystem-selfhost-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.

Stdlib: filesystem bootstrap fixture AOT execute

1 participant