Conversation
…raceful-fs The ESM rewrite in 8.0.0 dropped graceful-fs and switched to native fs.promises. fs.promises bypasses the userland patches graceful-fs installs on the callback API, so under high concurrency (e.g. linking bins for hundreds of workspace projects in parallel) the writes surface EMFILE instead of waiting for a free file descriptor. This restores the queueing behavior by defaulting to @pnpm/fs.graceful-fs, which exposes promisify(gfs.X) wrappers that preserve graceful-fs's retry queue. Custom fs injection (used by the test suite with memfs) still works via opts.fs. Closes pnpm/pnpm#11412.
Avoids the cross-repo release coordination needed for the @pnpm/fs.graceful-fs chmod/unlink additions. Inlines the same promisify(gfs.X) wrapping pattern that @pnpm/fs.graceful-fs uses to preserve graceful-fs's EMFILE retry queue under the promise API.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fsimplementation by switching from nativefs.promisestograceful-fs(promisified internally).fsinjection (used by the test suite with memfs) still works viaopts.fs.9.0.1.Fixes pnpm/pnpm#11412.
Background
In 8.0.0 this package dropped
graceful-fsin its ESM rewrite and switched to nativefs.promises.fs.promisesbypasses the userland patches thatgraceful-fsinstalls on the callback API, so under high concurrency (e.g. linking bins for hundreds of workspace projects in parallel) the writes surfaceEMFILEinstead of waiting for a free file descriptor.We re-add
graceful-fsand callpromisify(gfs.X)so the queueing applies to the promise API too — same pattern@pnpm/fs.graceful-fsuses, inlined here so this fix can ship without waiting on a@pnpm/fs.graceful-fsrelease.Test plan
node --test test/test.js test/e2e.test.js— all 58 tests pass on macOS