Skip to content

php-in-php: VmFsTouch/VmFsTempnam — pure PHP, drop libc FFI (#12145) - #12147

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-12145-touch-tempnam-pure
Jun 26, 2026
Merged

php-in-php: VmFsTouch/VmFsTempnam — pure PHP, drop libc FFI (#12145)#12147
PurHur merged 1 commit into
masterfrom
agent/issue-12145-touch-tempnam-pure

Conversation

@PurHur

@PurHur PurHur commented Jun 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add VmFsTouchPure (create via VmFsOpenNative, times via bootstrap touch())
  • Add VmFsTempnamPure (exclusive-create loop with mode x)
  • VmFsTouchNative / VmFsTempnamNative delegate to Pure — ~180 lines of libc FFI removed
  • VmTmpfilePure falls back to php://temp when mkstempOpen unavailable
  • Spine: VmFsTouchPure.php, VmFsTempnamPure.php

Closes #12145

php-src reference

  • ext/standard/filestat.cphp_touch
  • ext/standard/file.ctempnam

C/runtime shrink

  • Deleted utime/stat/open FFI table from VmFsTouchNative.php
  • Deleted mkstemp/close/unlink FFI table from VmFsTempnamNative.php

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php script/check-selfhost-spine-coverage-sync.php
vendor/bin/phpunit --filter "VmFsTouchTempnam|VmFsRuntimeShrink|FsDirRuntimeShrink|VmTmpfilePure"
'
make bootstrap-selfhost-vm-driver-execute-probe
check-selfhost-spine-coverage-sync: OK (3279 files)
PHPUnit — OK (20 tests, 104 assertions)
bootstrap-selfhost-vm-driver-execute-probe: OK

Made with Cursor

…2145)

Add VmFsTouchPure and VmFsTempnamPure; Native classes delegate without
utime/mkstemp FFI. VmTmpfilePure falls back to php://temp when mkstempOpen
is unavailable.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 43d1310 into master Jun 26, 2026
@PurHur
PurHur deleted the agent/issue-12145-touch-tempnam-pure branch June 26, 2026 15:07
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.

php-in-php: VmFsTouchNative/VmFsTempnamNative — pure PHP touch/tempnam, drop libc FFI (#1492)

1 participant