Skip to content

Playground cache leases cannot traverse directory descriptors on macOS #1934

Description

@chubes4

Problem

Merged #1930 uses /dev/fd/<directory-fd> as an anchored directory path on Darwin/FreeBSD. Node on macOS can stat that descriptor but cannot enumerate it or open children through it. Any wp: latest runtime that acquires or inspects a custom archive lease now fails locally.

Reproduction

On macOS with current main (6bbfc836):

  • readdir('/dev/fd/<directory-fd>') fails ENOTDIR.
  • open('/dev/fd/<directory-fd>/<lease>.json') fails ENOENT.
  • npm run test:playground-custom-archive-cache fails in createFileLease() at playground-wordpress-archive-cache.ts:381.
  • Switching only directory enumeration back to the validated pathname gets farther, then child creation fails through the descriptor as above.

Acceptance criteria

  • Darwin local Playground runtimes can acquire, inspect, renew, and release archive leases.
  • The replacement/symlink race guarantees from Harden Playground cache retention safety #1930 remain explicit and covered; do not silently downgrade to unanchored pathname access.
  • npm run test:playground-custom-archive-cache and a wp: latest runtime integration pass on macOS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions