Skip to content

VmFsUnlink/VmFsGlob: bootstrap without ext/ffi (#7314)#7378

Merged
PurHur merged 1 commit into
masterfrom
agent/runtime-php-unlink-7314
Jun 7, 2026
Merged

VmFsUnlink/VmFsGlob: bootstrap without ext/ffi (#7314)#7378
PurHur merged 1 commit into
masterfrom
agent/runtime-php-unlink-7314

Conversation

@PurHur
Copy link
Copy Markdown
Owner

@PurHur PurHur commented Jun 7, 2026

Summary

C runtime: no new C; VM no longer requires FFI::cdef for unlink/glob on the Zend driver. JIT/AOT unchanged (JitUnlink / __phpc_glob_vec).

php-src reference

  • ext/standard/filestat.cphp_unlink
  • ext/standard/dir.cPHP_FUNCTION(glob)

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit test/unit/VmFsUnlinkBootstrapTest.php test/unit/VmFsUnlinkTest.php test/unit/VmFsGlobTest.php'
# OK (1 test, 5 assertions) + existing unlink/glob unit tests

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter unlink_bootstrap'
# OK (2 tests, 2 assertions)

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
PHP_COMPILER_DISABLE_FFI=1 php bin/vm.php -r "
\$f = tempnam(sys_get_temp_dir(), \"t\");
var_export(file_exists(\$f));
var_export(unlink(\$f));
var_export(file_exists(\$f));
"'
# truetruefalse

Closes #7314

Made with Cursor

Route VM unlink/glob through host libc when FFI is disabled or unavailable,
matching the JIT/AOT native paths. Adds PHP_COMPILER_DISABLE_FFI gate and
compliance/unit coverage for bootstrap temp-file cleanup.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur PurHur merged commit 0aa9b5d into master Jun 7, 2026
@PurHur PurHur deleted the agent/runtime-php-unlink-7314 branch June 7, 2026 06:19
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: VmFsGlob/VmFsUnlink — delete host ext/ffi glob(3)/unlink(2) shims (bootstrap self-host)

1 participant