Skip to content

Store project registry links break when the store and the project are spelled through different symlinks #206

Closed
pnpm/pnpm
#17332

Description

@zkochan

register_project (pnpm/crates/store-dir/src/project_registry.rs) and v11's registerProject (pnpm11/store/controller/src/storeController/projectRegistry.ts, via symlink-dir) write <store>/projects/<hash> as a relative symlink computed lexically. When the store path and the project path reach the same directory through spellings of different depth, for example macOS /var/... and /private/var/..., the relative link resolves to a missing directory. get_registered_projects then treats the entry as stale and unlinks it.

Impact: pnpm store prune no longer sees that project. If other registered projects use the global virtual store, prune sweeps the slots only the dropped project uses.

Reproduced on Linux with TMPDIR pointing at a symlink of a deeper directory, in global::virtual_store::store_prune_after_global_remove_keeps_only_the_slots_other_groups_use before its store path was canonicalized (pnpm/pnpm#17326). A likely fix is to canonicalize both ends before computing the relative target, or to store an absolute target.


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

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