Repository navigation
Description
Planned for pnpm v13. This is a breaking change, so it waits for the next major.
Change
Treat a side-effects cache entry from a build that changed no files in its package as a cache hit for every node linker. pnpm then skips the build script when it reuses the entry, as it already does for entries with files. A package whose build must run in every project is listed in sideEffectsCache.exclude.
Current behavior
pnpm/pnpm#14744 (the fix for pnpm/pnpm#14717) drops such an entry on read, so the script runs again on every install that reaches the build step. This matches pnpm v11.
The behavior is already inconsistent:
- With
enableGlobalVirtualStore: true, a second project that shares the store reuses the already-built directory and skips the script. The guarantee from fix(store-dir): rebuild when the side-effects cache has nothing to restore pnpm#14744 does not hold there. - With
nodeLinker.type: loaded, which is experimental, feat(store-loader): handle temporary builds and filesystem access pnpm#17318 already treats such an entry as a cache hit, withsideEffectsCache.excludeas the opt-out.
Why it is breaking
A dependency whose postinstall writes outside its own package, such as the git hook installer simple-git-hooks, stops running in the second project on a machine. The install succeeds and prints nothing about the skipped script. Users have to list such packages in sideEffectsCache.exclude.
Work
- Stop dropping empty rows in
side_effects_overlay(pnpm/crates/store-dir) and in the remote side-effects cache, and publish empty artifacts again. - Revert the tests from fix(store-dir): rebuild when the side-effects cache has nothing to restore pnpm#14744 to expect a cache hit, and add tests showing that
sideEffectsCache.excluderuns the script in every project. - Remove the loaded-linker-only path added in feat(store-loader): handle temporary builds and filesystem access pnpm#17318 (
restore_empty_buildsincreate_virtual_store/cas/cached_builds.rs), since the shared read path then covers it. - Document the change in the
sideEffectsCacheandsideEffectsCache.excludesettings, and give the v13 release note an example of a git hook installer.
Written by an agent (Claude Code, claude-opus-5-5).
Activity
fix(store-loader): load builds that change no package files from CAS
zkochan commentedon Oct 30, 2026
Related: pnpm/pnpm#17526. With
enableGlobalVirtualStore: true, pnpm 12 already skips such a build in a second project that shares the slot, while pnpm 11 runs it again. Fixing that for pnpm 12 restores pnpm 11 behavior until this change lands.Written by an agent (Claude Code, claude-opus-5-5).
fix(store-loader): load builds that change no package files from CAS
fix(store-loader): load builds that change no package files from CAS
feat(store-loader): handle temporary builds and filesystem access (#1…
zkochan commentedon Nov 8, 2026
Status check against main (2026-11-08).
Still planned for v13. The GVS inconsistency listed here was fixed by pnpm/pnpm#17528 (pnpm/pnpm#17526 is closed). The loaded-linker path is now
deps-restorer/.../partition/empty_builds.rs(EmptyBuilds::Restore, pnpm/pnpm#17318), notrestore_empty_builds.Written by an agent (Claude Code, claude-opus-5-5).