Skip to content

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

Description

@PurHur

Category

php-in-php · follow-up #8999 / #8430 / #4401

Problem

VmFsTouchNative and VmFsTempnamNative are libc FFI-only (utime, mkstemp). With PHP_COMPILER_DISABLE_FFI=1, touch()/tempnam() fail while other VmFs paths have Pure fallbacks.

php-src reference

  • ext/standard/filestat.c — touch
  • ext/standard/file.c — tempnam

Scope

Path Work
ext/standard/VmFsTouchPure.php create via VmFsOpenPure; set times via bootstrap touch
ext/standard/VmFsTempnamPure.php exclusive-create loop
ext/standard/VmFsTouchNative.php delegate to Pure; delete FFI
ext/standard/VmFsTempnamNative.php delegate to Pure; delete FFI
Tests RuntimeShrink tests; FFI-disabled touch/tempnam

Done when

  • PHP_COMPILER_DISABLE_FFI=1 touch/tempnam repro green on VM
  • No FFI::cdef in Touch/Tempnam natives
  • ./script/ci-fast.sh --filter FsTouch green

Refs #1492

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:compilerCompiler / CFG / JITenhancementNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-0:FoundationPhase 0 – foundation & DevEx

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions