Skip to content

fix: Widen EBADF fstat version gate to include Node 24.15+#7104

Merged
arcanis merged 3 commits intoyarnpkg:masterfrom
rfoel:fix/fstat-node-24.15
Apr 17, 2026
Merged

fix: Widen EBADF fstat version gate to include Node 24.15+#7104
arcanis merged 3 commits intoyarnpkg:masterfrom
rfoel:fix/fstat-node-24.15

Conversation

@rfoel
Copy link
Copy Markdown
Contributor

@rfoel rfoel commented Apr 16, 2026

What's the problem this PR addresses?

#7103

The fix in #7070 added a version gate for the EBADF fstat error:

export const HAS_BROKEN_FSTAT_FOR_ZIP_FDS = major > 25 || (major === 25 && minor >= 7);

However, the breaking change from nodejs/node#61769 (lib: reduce cycles in esm loader and load it in snapshot) was backported to Node v24.15.0, causing the identical EBADF: bad file descriptor, fstat error on that version.

Works on v24.14.1, fails on v24.15.0.

How did you fix it?

Widened the version gate to also cover Node 24.15+:

export const HAS_BROKEN_FSTAT_FOR_ZIP_FDS = major > 25 || (major === 25 && minor >= 7) || (major === 24 && minor >= 15);

Checklist

  • I have read the Contributing Guide.
  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

rfoel added 3 commits April 16, 2026 15:12
The breaking change from nodejs/node#61769 was backported to Node
v24.15.0, but the version guard only covered Node >= 25.7. This adds
the Node 24.15+ range so PnP correctly reads CJS source from zip
files on that version as well.

Fixes yarnpkg#7103
The .pnp.loader.mjs is auto-generated β€” revert manual edit and let CI
rebuild it. Add .yarn/versions/7103.yml to declare the patch bump.
Add @yarnpkg/builder, @yarnpkg/core, @yarnpkg/doctor, @yarnpkg/nm,
@yarnpkg/pnpify, and @yarnpkg/sdks to the declined list β€” they depend
on packages planned for release but don't need a bump themselves.
@arcanis arcanis merged commit 7b2a0c3 into yarnpkg:master Apr 17, 2026
27 checks passed
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.

2 participants