You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With verify-deps-before-run, editing package.json in a project that has a file: directory dependency failed pnpm run / pnpm exec with "a linked package is out of date", even when no dependency changed. pnpm v11 lets the same edit pass.
The repeat-install content check treated a file: directory specifier as up to date only if the lockfile resolved it to link:. Such a dependency resolves to a file: copy. The check now treats that copy the way it already treats injected workspace projects: up to date, because the directory freshness check that runs first has already compared the directory's package.json with its lockfile snapshot. A real change to the directory's dependencies still fails the gate.
Proof: I reproduced the issue's steps against a binary built from main (single project and workspace --filter, both fail). With this change both pass, and a drifted lib dependency still fails. The new e2e test fails without the fix.
Squash Commit Body
When a project manifest's content changed since the last install, the
repeat-install content check called `linked_dep_is_up_to_date`, which
treated a `file:` directory specifier as up to date only if the lockfile
resolved it to `link:`. A `file:` directory dependency resolves to a
`file:` copy, so every content edit to such a project failed
`verify-deps-before-run` with "a linked package is out of date".
The `File` branch that injected workspace projects already take now runs
first. `check_importer_satisfies` has already compared the directory's
manifest with its lockfile snapshot by then, as v11's
`localDirectoryDepIsUpToDate` does. A drifted directory now reports "a
modified manifest is no longer satisfied by the lockfile", the same
message injected workspace copies report.
pnpm v11 is not affected.
Fixes https://github.com/pnpm/pnpm/issues/17697
Checklist
I checked the referenced issue and verified that none of the PRs
already linked to it solves it.
New features are implemented only in the Rust pnpm v12 CLI. Bug fixes
are implemented in every affected version.
Added a changeset (pnpm changeset) if this PR changes any published
package. Keep it short and written for pnpm users — it becomes a release note.
Added or updated tests.
Reviewed with sol-loop: 1 round with gpt-6.1-sol. Sol verdict: approved
Written by an agent (Claude Code, claude-opus-5-5).
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Summary by CodeRabbit
Bug Fixes
Improved dependency verification for local file: directory dependencies. Editing unrelated package manifest entries no longer causes verification to fail when the local dependency is unchanged.
Changes to a local dependency’s manifest are still detected and reported as verification errors.
Reviewing files that changed from the base of the PR and between e252487 and 4c0071b.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
The dependency freshness check now accepts resolved file: dependencies before evaluating local-directory declarations. A Unix E2E test covers an unrelated project manifest edit with an unchanged local directory and verifies rejection after the local directory manifest changes.
The check accepts resolved file: dependencies. The E2E test verifies that an unrelated project manifest edit passes when the local directory is unchanged, and that changing the local directory manifest triggers the verify-deps error. A patch changeset records the fix.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
🟢 Approval recommended
No active review issues remain for the fix allowing unrelated manifest edits with file: directory dependencies.
No open issues 🎉
What changed in this PR
Fixes the Rust CLI’s verify-deps-before-run check rejecting unrelated package.json edits when a project has a file: directory dependency, addressing #17697.
Changes:
Accepts file: copies after the existing directory freshness check validates them.
Adds regression coverage for an unrelated manifest edit passing and changed directory dependencies failing.
Adds a patch release note.
No actionable findings remain. Tests were not run during this review.
HEAD and main are measured on the same runner. The tolerance is 5% of the main median or 2 ms, whichever is larger. A regression requires both the median slowdown and the gap between the fastest retained HEAD sample and slowest retained main sample to exceed this tolerance, after trimming up to 10% from each tail. Suspected regressions are rerun once with target order reversed and only fail if reproduced. This conservative noise guard is not a statistical confidence interval.
Inconclusive rows do not fail the check. They remain visible for performance review. Bencher retains absolute minimum timings for historical tracking; historical alerts do not gate this PR. Sequential measurements can still be affected by runner drift.
Each install runs 2 more times per revision, untimed, under strace --follow-forks --summary-only. A file syscall regresses when HEAD's fewest calls exceed main's most by more than 2% of main or 50 calls, whichever is larger. mkdir and mkdirat count only the calls that created a directory, since concurrent installs fail a varying number with EEXIST. A syscall whose identical runs differ by more than that tolerance is reported unstable and not gated, unless HEAD's fewest calls also exceed main's most by more than the tolerance plus that difference. Each scenario lists its largest change relative to its tolerance and every row that is not within tolerance.
Scenario
Engine
Syscall
main calls (max)
HEAD calls (min)
Change
Tolerance
Identical-run spread
Result
isolated-fresh-restore-cold-cache-cold-store
pacquet
access
11
11
+0.0%
50
0
Within tolerance
isolated-fresh-restore-cold-cache-cold-store
pnpr
access
11
11
+0.0%
50
0
Within tolerance
isolated-fresh-restore-hot-cache-hot-store
pacquet
access
11
11
+0.0%
50
0
Within tolerance
isolated-fresh-restore-hot-cache-hot-store
pnpr
access
11
11
+0.0%
50
0
Within tolerance
isolated-repeat-install-hot-cache-hot-store
pacquet
access
8
8
+0.0%
50
0
Within tolerance
isolated-repeat-install-hot-cache-hot-store
pnpr
access
8
8
+0.0%
50
0
Within tolerance
isolated-repeat-install-cold-cache-hot-store
pacquet
access
8
8
+0.0%
50
0
Within tolerance
isolated-repeat-install-cold-cache-hot-store
pnpr
access
8
8
+0.0%
50
0
Within tolerance
isolated-fresh-install-cold-cache-cold-store
pacquet
access
11
11
+0.0%
50
0
Within tolerance
isolated-fresh-install-cold-cache-cold-store
pacquet
readlink
16491
16445
-0.3%
329
456
Unstable (identical runs differ by 456, not gated)
isolated-fresh-install-cold-cache-cold-store
pnpr
ioctl
11
12
+9.1%
50
7
Within tolerance
isolated-fresh-install-hot-cache-hot-store
pacquet
openat
15644
15650
+0.0%
312
4
Within tolerance
isolated-fresh-install-hot-cache-hot-store
pnpr
access
11
11
+0.0%
50
0
Within tolerance
isolated-fresh-install-cold-cache-hot-store
pacquet
access
11
11
+0.0%
50
0
Within tolerance
isolated-fresh-install-cold-cache-hot-store
pacquet
openat
18268
17757
-2.8%
365
483
Unstable (identical runs differ by 483, not gated)
Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm; the linked, injected, and Cargo workspace scenarios compare current Rust against main Rust. Bencher consumes pacquet@HEAD and pnpr@HEAD.
The tables below show mean ± σ. Bencher tracks absolute minimum latency; PR regression checks compare HEAD and main samples from the same runner. Historical timing alerts do not gate PRs.
Scenario: Isolated linker: fresh restore, cold cache + cold store
Scenario: GVS linker: fresh restore, hot cache + hot store
Same install as the isolated fresh-restore hot/hot scenario, into the shared virtual store, the layout pnpm 12 installs into by default. Scenarios run on separate machines, so compare main and branch within each table.
Scenario: Store only: unlocked direct deps, cold cache + hot store
Store-only install (enableModulesDir: false, per-file store index, trusted lockfile) against a lockfile missing the direct dependencies that have peers, with the metadata cache wiped per iteration: the install resolves those from the registry, reuses their subtrees from the lockfile and checks the store, linking nothing. Direct installs only.
Scenario: Cargo: repeat install, hot cache + hot store
Frozen repeat install of a Cargo workspace (cargo.enabled: true) whose crates are already materialized in <storeDir>/v11/crates/ and linked into .pnpm/crates/crates-io. Direct installs only.
…linked check
When a project manifest's content changed since the last install, the
repeat-install content check called `linked_dep_is_up_to_date`, which
treated a `file:` directory specifier as up to date only if the lockfile
resolved it to `link:`. A `file:` directory dependency resolves to a
`file:` copy, so every content edit to such a project failed
`verify-deps-before-run` with "a linked package is out of date".
The `File` branch that injected workspace projects already take now runs
first. `check_importer_satisfies` has already compared the directory's
manifest with its lockfile snapshot by then, as v11's
`localDirectoryDepIsUpToDate` does.
Fixespnpm#17697
…est, and generate the oracle's edit axes from the read set (#17702)
The repeat-install oracle's edit axes now come from the input list the
read-set test checks. `repeat_install_oracle::Input` names each kind of
file a full install reads in the workspace outside `node_modules`. The
read-set test sorts every file it observes into one kind and requires
every kind to be observed. The oracle matrix has a test per kind that
runs its edit scenario, and a match over the kinds fails to compile when
one has no test, so a new kind of install input needs an oracle axis.
The local-directory axis found that `verifyDepsBeforeRun` let a command
run after a dependency was added to a `file:` directory dependency's
manifest, in both CLIs. The run gate lets local file dependencies
through and skips every project the last validation proved installed,
and no validation records a local directory's manifest. When the state
records a local directory that is no workspace project, the gate now
holds the proven projects too, so the content check compares the
directory's manifest with its lockfile snapshot. v12's content check
now reads that manifest through the resolver's hooks, as the frozen
install's check does, so a `readPackage` hook or `packageExtensions`
entry that changes it does not fail the gate.
v12's `linked_dep_is_up_to_date` matched a `file:` specifier before the
`file:` copy branch and reported every such dependency out of date. The
copy branch now runs first, as in #17698.
Part of pnpm/tasks#254.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
With
verify-deps-before-run, editingpackage.jsonin a project that has afile:directory dependency failedpnpm run/pnpm execwith "a linked package is out of date", even when no dependency changed. pnpm v11 lets the same edit pass.The repeat-install content check treated a
file:directory specifier as up to date only if the lockfile resolved it tolink:. Such a dependency resolves to afile:copy. The check now treats that copy the way it already treats injected workspace projects: up to date, because the directory freshness check that runs first has already compared the directory'spackage.jsonwith its lockfile snapshot. A real change to the directory's dependencies still fails the gate.Fixes #17697
Proof: I reproduced the issue's steps against a binary built from
main(single project and workspace--filter, both fail). With this change both pass, and a driftedlibdependency still fails. The new e2e test fails without the fix.Squash Commit Body
Checklist
already linked to it solves it.
are implemented in every affected version.
pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
Reviewed with sol-loop: 1 round with gpt-6.1-sol. Sol verdict: approved
Written by an agent (Claude Code, claude-opus-5-5).
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit
file:directory dependencies. Editing unrelated package manifest entries no longer causes verification to fail when the local dependency is unchanged.