Skip to content

feat(fs.graceful-fs): expose promisified chmod and unlink#11413

Merged
zkochan merged 2 commits into
mainfrom
fix/11412
Apr 30, 2026
Merged

feat(fs.graceful-fs): expose promisified chmod and unlink#11413
zkochan merged 2 commits into
mainfrom
fix/11412

Conversation

@zkochan

@zkochan zkochan commented Apr 30, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds chmod and unlink (promisified) to @pnpm/fs.graceful-fs's default export so callers can perform mode changes and removals through the same EMFILE-queueing layer as the other operations.
  • Required by an upcoming @zkochan/cmd-shim release that switches its default fs implementation to @pnpm/fs.graceful-fs to fix #11412 (EMFILE: too many open files on Windows during bin linking in large workspaces).

Background

@zkochan/cmd-shim@8.0.0 dropped graceful-fs in its ESM rewrite and switched to native fs.promises. fs.promises bypasses the userland patches that graceful-fs installs on the callback API, so under high concurrency the writes surface EMFILE instead of waiting for a free file descriptor. cmd-shim needs chmod and unlink to fully replace its fs.promises usage with @pnpm/fs.graceful-fs.

Test plan

  • pnpm --filter @pnpm/fs.graceful-fs run compile succeeds
  • chmod and unlink appear in the generated lib/index.d.ts as typeof gfs.chmod.__promisify__ / typeof gfs.unlink.__promisify__

zkochan added 2 commits April 30, 2026 22:24
So callers can perform mode changes and removals through the same
EMFILE/ENFILE-queueing layer as the other operations.
@zkochan zkochan merged commit 7f490af into main Apr 30, 2026
9 checks passed
@zkochan zkochan deleted the fix/11412 branch April 30, 2026 20:42
zkochan added a commit that referenced this pull request Apr 30, 2026
* feat(fs.graceful-fs): expose promisified chmod and unlink

So callers can perform mode changes and removals through the same
EMFILE/ENFILE-queueing layer as the other operations.

* chore: remove ENFILE word to satisfy cspell
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.

v11 EMFILE: too many open files on Windows

1 participant