Skip to content

verifyDepsBeforeRun: link: workspace dependencies are not held under dedicated lockfiles with injectWorkspacePackages #179

Closed
pnpm/pnpm
#17177

Description

@zkochan

Context

Follow-up from pnpm/pnpm#17150.

When sharedWorkspaceLockfile: false and injectWorkspacePackages: true, the dependency check before pnpm run / pnpm exec holds only the selected projects, because an injected workspace dependency is a copy inside the dependent project that its own install covers. A dependency declared with the link: protocol is still a symlink under that configuration, so a never-installed linked sibling escapes the check while the --filter=<project>... install the gate spawns does select it.

Both stacks take the shortcut:

  • v12: pnpm/crates/cli/src/cli_args/recursive.rs (projects_to_verify) and pnpm/crates/package-manager/src/optimistic_repeat_install/modules_dirs.rs
  • v11: pnpm11/exec/commands/src/selectProjectsToVerify.ts and pnpm11/deps/status/src/findModulesDirIssue.ts (selectProjectDirs)

Task

Keep walking the edges that remain symlinks (link: specs) when injection is on, and exclude only the injected ones. Cover a filtered command whose link: dependency has never been installed, in both stacks.


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

Activity

  1. zkochan commented on Oct 20, 2026

    @zkochan
    MemberAuthor

    Commit 22f095aeff on pnpm/pnpm#17150 follows link: edges in v11 (selectProjectsToVerify.ts) and in the v12 modules-directory walk (modules_dirs.rs). The v12 selection shortcut in pnpm/crates/cli/src/cli_args/recursive.rs (projects_to_verify) still returns only the selected projects under dedicated lockfiles with injectWorkspacePackages, so that part remains.


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

  2. self-assigned this
    on Oct 20, 2026
  3. zkochan commented on Oct 20, 2026

    @zkochan
    MemberAuthor

    Opened pnpm/pnpm#17177 to resolve this issue across both pnpm v11 and pnpm v12:

    • pnpm v12 (pnpm-cli and pnpm-package-manager): When sharedWorkspaceLockfile: false and injectWorkspacePackages: true, projects_to_verify and WorkspaceProjectIndex::dep_targets now continue to walk link: workspace dependency edges while skipping injected (workspace:) edges.
    • pnpm v11 (@pnpm/workspace.projects-graph): parseDependencySpec now rewrites link: prefixes to file: before invoking @pnpm/npm-package-arg (npa.resolve), which previously threw EUNSUPPORTEDPROTOCOL on link: specs and omitted link: edges from createProjectsGraph (affecting both selectProjectsToVerify and --filter=<project>...).
    • Tests: Added unit and end-to-end tests covering a filtered command whose link: dependency has never been installed under sharedWorkspaceLockfile: false and injectWorkspacePackages: true in both stacks.

    This covers the entire issue.

    Written by an agent (Antigravity, Claude Opus 4.6).

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