Repository navigation
Conversation
There was a problem hiding this comment.
Pull request overview
This PR scopes “read-only filesystem” error suppression (EACCES/EROFS/EPERM) to Global Virtual Store (GVS) code paths so that non-GVS installs correctly surface real permission problems during bin linking and self-dependency symlinking.
Changes:
- Add an
allowReadonlyErrorsoption to@pnpm/link-binsand gate readonly error suppression on it. - Thread
enableGlobalVirtualStorethrough@pnpm/headlessbin-linking and self-dep symlinking paths to control suppression. - Add targeted tests in
@pnpm/link-binsplus a changeset for patch releases.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| pkg-manager/link-bins/test/index.ts | Adds tests covering readonly suppression vs passthrough vs non-readonly rethrow. |
| pkg-manager/link-bins/src/index.ts | Introduces allowReadonlyErrors and readonly error detection; gates suppression. |
| pkg-manager/headless/src/index.ts | Threads enableGlobalVirtualStore to bin linking and guards self-dep symlink suppression. |
| .changeset/fix-gvs-readonly-error-handling.md | Declares patch releases and documents the behavioral change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
bf92938 to
095b9a5
Compare
Narrow EACCES/EROFS/EPERM suppression to Global Virtual Store codepaths only, so non-GVS installs still throw on permission errors instead of silently skipping bin linking and self-dep symlinking. - Add allowReadonlyErrors flag to LinkBinOptions - Thread enableGlobalVirtualStore through linkAllBins - Use util.types.isNativeError() per codebase convention - Add tests for suppression, passthrough, and re-throw
095b9a5 to
8b5a284
Compare
|
I don't understand. There are many fs operations during install. Why only these fail and all others work? |
|
Good question. In GVS mode, most fs operations succeed because they either target the project's local The two operations that fail are the ones that write into the already-imported package directory (
Everything else either writes to the project-local |
|
Superseded by a better approach: skip post-import linking entirely for warm GVS packages instead of catching read-only errors. |
Context
Part of the ongoing work to make the Global Virtual Store (GVS) work with read-only content-addressable stores (e.g. Nix). When
enableGlobalVirtualStoreis active and the store is read-only, post-import linking operations (symlinkDependencyfor self-deps,fs.mkdirfor bin directories) fail withEACCES/EROFS/EPERMbecause the target lives inside an immutable store path.This PR suppresses those errors for GVS installs only, so non-GVS installs still get clear errors on genuine permission problems.
Follows #10965 (
virtualStoreOnly), #10709 (GVS warm reattach), #10836 (CI GVS config).What changed
@pnpm/link-binsallowReadonlyErrors?: booleantoLinkBinOptions_linkBinsonly suppressesmkdirerrors when the flag is setisReadonlyError()helper usingutil.types.isNativeError()(per codebase convention, matchingread-projects-contextandplugin-commands-installation)@pnpm/headlessenableGlobalVirtualStorethroughlinkAllBins→ all threelinkBins/linkBinsOfPackagescall sites asallowReadonlyErrorsif (opts.enableGlobalVirtualStore); non-GVS path has no try/catch overheadutil.types.isNativeError()instead of duck-typingTests (3 new in
@pnpm/link-bins)allowReadonlyErrors: true→ returns[](suppressed)allowReadonlyErrors: true→ throws (non-readonly errors always re-thrown)Verification
pnpm --filter @pnpm/link-bins test: 36/36 passpnpm --filter @pnpm/headless compile: clean (1 pre-existing lint warning)