Skip to content

store prune keeps GVS packages when the last registered project is gone #57

Done
pnpm/pnpm
#18487

Description

@zkochan

Both CLIs skip the global virtual store sweep when no live project is registered (pruneGlobalVirtualStore in pnpm11/store/controller, prune_global_virtual_store in pnpm/crates/store-dir). So once every registered project is deleted, pnpm store prune keeps all of their slots.

This matters most for v11 pnpm dlx, which installs through the global virtual store and registers each cache entry. If the expired dlx entries are the only registered projects, removing them leaves their packages in the store (see pnpm/pnpm#16387 and pnpm/pnpm#16383).

The guard can't just be relaxed to "sweep when the registry exists". Some projects use the global virtual store without being registered, and the guard is what keeps their slots when nothing else is registered:

  • v11 frozen-store installs skip registerProject (pnpm11/installing/context/src/index.ts).
  • v12 registration is best effort, and a failed write only logs a warning (register_workspace_in_store in pnpm/crates/package-manager/src/install/run/lockfile_load.rs).

Options include making v11 dlx install without the global virtual store (v12 dlx already does), or registering those projects reliably first so the guard can be narrowed.


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

Activity

  1. zkochan commented on Nov 27, 2026

    @zkochan
    MemberAuthor

    Opened pnpm/pnpm#18487 for the Rust CLI on main. A global virtual store install into a writable store now fails if it cannot register the project, including when the store is inside the project. Prune's mark walk now follows store links in all of a project's non-hidden directories, so a CLI-only --modules-dir stays covered. Prune then sweeps even after the last registered project is gone. It keeps links/ unchanged only when the store has no project registry.

    This only partly covers the task. The v11 half (v11 dlx installing through the global virtual store, and frozen-store installs skipping registration) lives on release/11 and is not part of this PR.


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

  2. added a commit that references this issue on Nov 27, 2026
    9e9de77
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions