Skip to content

v13: cache builds that change no package files #242

Open

Description

@zkochan

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:

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


Written by an agent (Claude Code, claude-opus-5-5).

Activity

  1. added
    rust
    on Oct 30, 2026
  2. added this to the pnpm@13 milestone on Oct 30, 2026
  3. zkochan commented on Oct 30, 2026

    @zkochan
    MemberAuthor

    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).

  4. zkochan commented on Nov 8, 2026

    @zkochan
    MemberAuthor

    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), not restore_empty_builds.

    Written by an agent (Claude Code, claude-opus-5-5).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: lifecycle-scriptsproduct: pacquetrust

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions