Skip to content

fix(overrides): measure a workspace: path in an override from the workspace - #17016

Merged
zkochan merged 4 commits into
pnpm:mainfrom
lazerg:fix-17010
Oct 17, 2026
Merged

zkochan merged 4 commits into
pnpm:mainfrom
lazerg:fix-17010

Conversation

@lazerg

@lazerg lazerg commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #17010.

An override is written once in pnpm-workspace.yaml and applied to every project it matches. file:, link: and bare-path values are anchored at the workspace root and rendered again for each project. A workspace:./path value was not, so it was measured from the consuming project. Without injection that produced a dangling link, and with injectWorkspacePackages: true the install failed with "Could not install from ... as it does not exist".

Both versions had the bug, so both are fixed. The overrider now claims a workspace: value when it starts with workspace:., which is the only workspace: shape the resolver reads as a path. It renders that value relative to each project and keeps a leading ./, so the result still reaches the local resolver and keeps the workspace: protocol (and the injection behavior that comes with it). For a manifest with no directory, such as a dependency of a non-workspace package, the value is left as declared, since an absolute workspace:/... would be read as a version range.

In pnpm 12, an override written in a file listed under include has its workspace: path rewritten to start at the workspace root, as file: and link: values already are. pnpm 11 has no include.

With the fix, an override to workspace:./packages/target gives the same lockfile entry as declaring workspace:../../target in the consumer directly, with and without injectWorkspacePackages.

Not covered here: when the overridden dependency belongs to a non-workspace package pulled in by a nested project, pnpm 11 resolves the declared value from the lockfile directory and works, while pnpm 12 resolves it from the importer's directory (opts_relative_to_declaring_manifest only redirects file:) and still points inside the importer. That is an existing v11/v12 difference in how a dependency's workspace: path is resolved, not in the overrider, so I left it out of this PR.

Squash Commit Body

`pnpm.overrides` is written once, at the workspace root, and applied to
every package that matches. `file:`, `link:` and bare-path values are
anchored at the root and rendered again for each package the override
rewrites. A `workspace:` path was not, so `workspace:./packages/target`
was measured from the consuming package. Without injection the install
left a dangling link; with `injectWorkspacePackages` it failed because
the directory does not exist.

The overrider now claims a value starting with `workspace:.`, the only
`workspace:` shape the resolver reads as a path, and renders it relative
to each package with a leading `./`, so it keeps reaching the local
resolver under the `workspace:` protocol. A manifest with no directory
keeps the value as declared, because an absolute `workspace:/...` would
be read as a version range.

An override in a file listed under `include` has its `workspace:` path
rebased from that file to the workspace root, as `file:` and `link:`
values are.

Present in both pnpm v11 and v12, so fixed in both.

Closes pnpm/pnpm#17010

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.

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

Summary by CodeRabbit

  • New Features
    • pnpm.overrides now resolves workspace: paths relative to the directory containing pnpm-workspace.yaml, including for packages nested within the workspace.
    • When package-directory context is unavailable, workspace override paths retain their declared form.
  • Bug Fixes
    • Fixed workspace override linking and package injection for nested consumers.
    • Workspace paths in included configuration files are rebased relative to the included file.
  • Documentation
    • Clarified how relative workspace: override paths are resolved in included configuration files.

@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: pnpm/pnpm/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8e71bf11-7a4f-478e-9f8c-4193c9bb421b
📥 Commits

Reviewing files that changed from the base of the PR and between ed257b1 and 8213c09.

📒 Files selected for processing: 1
  • pnpm/crates/local-spec/src/tests.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

📝 Walkthrough

The change adds support for relative workspace: paths in overrides. It rebases paths for nested workspace packages, preserves declared paths when package directories are unavailable, and adds tests for regular and injected installs.

Changes: Workspace override paths

Layer / File(s) Summary
Parse and render workspace paths
pnpm/crates/local-spec/src/lib.rs, pnpm/crates/local-spec/src/tests.rs
LocalSpec now parses relative workspace: paths against a base directory and renders rebased paths with the protocol. Tests cover rebasing, path prefixes, and rejected specifier forms.
Apply workspace paths in Rust overrides
pnpm/crates/package-manager/src/overrides.rs, pnpm/crates/package-manager/src/overrides/tests.rs, pnpm/crates/workspace/src/include/*
Rust override handling parses and renders workspace paths across dependency, peer, and undeclared-dependency overrides. Included configuration rebases workspace override paths between source and target directories. Tests cover nested override paths and included configuration.
Resolve workspace paths in the read-package hook
pnpm11/hooks/read-package-hook/src/createVersionsOverrider.ts, pnpm11/hooks/read-package-hook/test/createVersionOverrider.test.ts
The hook recognizes relative workspace: targets, rebases them when a package directory is available, and preserves the declared specifier otherwise. Tests cover nested, root, and directory-less packages.
Validate workspace override installs
pnpm/crates/cli/tests/suite/*, pnpm11/installing/deps-installer/test/install/overrides.ts, pnpm/docs/config-includes.md, .changeset/overrides-workspace-relative-paths.md
Install tests check workspace override links and lockfile entries, including nested consumers with injected workspace packages. The documentation and changeset describe workspace override path handling.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix · Severity of issue fixed: Medium

Assessment against linked issues

Objective Addressed Explanation
Rebase relative workspace override paths so they refer to the intended workspace target for each importer, including nested consumers. [#17010] ✅
Support workspace override paths with and without workspace package injection. [#17010] ✅

Suggested labels: product: pnpm@11, product: pacquet

Merge Risk: ⚪ Minimal · up to 8213c

Relative workspace override paths are intended to resolve from the workspace for nested consumers. The supplied review evidence identifies no actionable merge risk.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov-commenter

codecov-commenter commented Oct 17, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.53%. Comparing base (3f26021) to head (8213c09).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #17016      +/-   ##
==========================================
- Coverage   92.53%   92.53%   -0.01%     
==========================================
  Files        1775     1775              
  Lines      228495   228577      +82     
==========================================
+ Hits       211441   211512      +71     
- Misses      17054    17065      +11     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Same-run regression check

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.

Scenario Engine main median HEAD median Change Tolerance Result
isolated-fresh-restore-cold-cache-cold-store pacquet 2342.07 ms 2414.02 ms 3.1% 117.10 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store pnpr 1354.81 ms 1516.75 ms 12.0% 67.74 ms Inconclusive (overlapping samples)
isolated-fresh-restore-hot-cache-hot-store pacquet 235.36 ms 233.54 ms -0.8% 11.77 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pnpr 244.00 ms 236.81 ms -2.9% 12.20 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pacquet 8.07 ms 7.94 ms -1.6% 2.00 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pnpr 12.41 ms 7.98 ms -35.6% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pacquet 7.47 ms 7.49 ms 0.3% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pnpr 7.91 ms 7.91 ms -0.0% 2.00 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pacquet 2511.03 ms 2519.86 ms 0.4% 125.55 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pnpr 1481.06 ms 1480.27 ms -0.1% 74.05 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pacquet 436.77 ms 508.50 ms 16.4% 21.84 ms Inconclusive (overlapping samples)
isolated-fresh-install-hot-cache-hot-store pnpr 291.75 ms 296.28 ms 1.6% 14.59 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pacquet 1614.09 ms 1604.03 ms -0.6% 80.70 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pnpr 285.96 ms 281.20 ms -1.7% 14.30 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pacquet 281.49 ms 442.25 ms 57.1% 14.07 ms Inconclusive (overlapping samples)
isolated-fresh-resolve-hot-cache-offline pnpr 98.72 ms 99.02 ms 0.3% 4.94 ms Within tolerance
isolated-peer-heavy-resolve-hot-cache-offline pacquet 236.69 ms 234.06 ms -1.1% 11.83 ms Within tolerance
isolated-linked-workspace-resolve-hot-cache-offline pacquet 206.41 ms 200.71 ms -2.8% 10.32 ms Within tolerance
isolated-injected-workspace-repeat-install-hot-cache-hot-store pacquet 76.15 ms 119.64 ms 57.1% 3.81 ms Inconclusive (overlapping samples)
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pacquet 4411.32 ms 4471.14 ms 1.4% 220.57 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pnpr 3466.11 ms 3450.76 ms -0.4% 173.31 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pacquet 121.51 ms 116.64 ms -4.0% 6.08 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pnpr 137.32 ms 135.86 ms -1.1% 6.87 ms Within tolerance
store-only-unlocked-direct-deps-cold-cache-hot-store pacquet 1123.28 ms 1119.64 ms -0.3% 56.16 ms Within tolerance

Integrated-Benchmark Report (Linux)

Commit: 8213c09453fd

Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm; the linked and injected 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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.420 ± 0.136 2.257 2.657 1.74 ± 0.17
pacquet@main 2.396 ± 0.124 2.269 2.606 1.72 ± 0.17
pnpr@HEAD 1.485 ± 0.122 1.305 1.626 1.07 ± 0.12
pnpr@main 1.391 ± 0.113 1.298 1.665 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.4202451941400005,
      "stddev": 0.13640202607422705,
      "median": 2.41401715424,
      "user": 1.3471966400000002,
      "system": 1.43349628,
      "min": 2.25656295474,
      "max": 2.65728118674
    },
    {
      "command": "pacquet@main",
      "mean": 2.3958335229400003,
      "stddev": 0.12444069586305004,
      "median": 2.3420741507400002,
      "user": 1.2758211400000001,
      "system": 1.3596288799999998,
      "min": 2.2693917797400003,
      "max": 2.6061886637400002
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.4849516827399998,
      "stddev": 0.12235191494047853,
      "median": 1.51674950474,
      "user": 1.1485686400000001,
      "system": 1.2477544799999998,
      "min": 1.30495829674,
      "max": 1.62557141474
    },
    {
      "command": "pnpr@main",
      "mean": 1.39107836424,
      "stddev": 0.11315143599264678,
      "median": 1.35481350474,
      "user": 1.1602813399999998,
      "system": 1.26920128,
      "min": 1.29835312774,
      "max": 1.66483661774
    }
  ]
}

Scenario: Isolated linker: fresh restore, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 249.2 ± 41.4 219.3 358.6 1.04 ± 0.18
pacquet@main 275.0 ± 66.4 230.9 394.0 1.15 ± 0.28
pnpr@HEAD 239.2 ± 7.8 227.9 252.6 1.00
pnpr@main 243.5 ± 8.3 230.6 255.6 1.02 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.24918432026000006,
      "stddev": 0.04140864437113518,
      "median": 0.23354276606000002,
      "user": 0.28863946,
      "system": 0.6124757399999999,
      "min": 0.21927653156000002,
      "max": 0.35864396956000005
    },
    {
      "command": "pacquet@main",
      "mean": 0.27501519116000006,
      "stddev": 0.06643009241585435,
      "median": 0.23535763056000003,
      "user": 0.31613495999999996,
      "system": 0.69682324,
      "min": 0.23092330356000002,
      "max": 0.39404266856000003
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.23922650956,
      "stddev": 0.007776001519054356,
      "median": 0.23680816006000005,
      "user": 0.26968185999999994,
      "system": 0.5432357399999999,
      "min": 0.22787973356000002,
      "max": 0.25262840756000005
    },
    {
      "command": "pnpr@main",
      "mean": 0.24350085096000001,
      "stddev": 0.008324003589808329,
      "median": 0.24399946406000003,
      "user": 0.28515245999999994,
      "system": 0.5474434400000001,
      "min": 0.23057962056000003,
      "max": 0.25562660856
    }
  ]
}

Scenario: Isolated linker: repeat install, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 8.1 ± 0.8 6.6 12.2 1.00
pacquet@main 8.2 ± 0.7 7.0 10.6 1.01 ± 0.13
pnpr@HEAD 8.3 ± 0.9 7.0 11.9 1.02 ± 0.15
pnpr@main 11.6 ± 3.8 6.7 22.1 1.43 ± 0.49
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.008114919996637176,
      "stddev": 0.0008298970674555288,
      "median": 0.00793685874,
      "user": 0.005144627433628318,
      "system": 0.0037633575221238916,
      "min": 0.006637771740000001,
      "max": 0.01221463874
    },
    {
      "command": "pacquet@main",
      "mean": 0.008235440374730533,
      "stddev": 0.0006595670692867131,
      "median": 0.008065746240000001,
      "user": 0.0054492251497006,
      "system": 0.003638788323353294,
      "min": 0.007034647740000001,
      "max": 0.01062044474
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.008284999424713377,
      "stddev": 0.0009013466384768834,
      "median": 0.00798276974,
      "user": 0.0049771980891719775,
      "system": 0.004126040445859872,
      "min": 0.006952073740000001,
      "max": 0.011873796740000001
    },
    {
      "command": "pnpr@main",
      "mean": 0.011629069255850145,
      "stddev": 0.003753954067015713,
      "median": 0.012405017740000001,
      "user": 0.006946550720461098,
      "system": 0.005634263400576369,
      "min": 0.0067221897400000005,
      "max": 0.02208388274
    }
  ]
}

Scenario: Isolated linker: repeat install, cold cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 7.5 ± 0.3 6.9 9.2 1.00
pacquet@main 7.5 ± 0.4 6.8 10.4 1.00 ± 0.06
pnpr@HEAD 7.9 ± 0.4 7.2 9.9 1.06 ± 0.06
pnpr@main 7.9 ± 0.4 7.1 9.8 1.06 ± 0.06
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.007496544558657715,
      "stddev": 0.0002928341459252765,
      "median": 0.0074912482600000005,
      "user": 0.004554268590604025,
      "system": 0.0035174071140939593,
      "min": 0.00690912426,
      "max": 0.009235879260000001
    },
    {
      "command": "pacquet@main",
      "mean": 0.00750166906996886,
      "stddev": 0.00038311407448402956,
      "median": 0.00747036126,
      "user": 0.004563730778816201,
      "system": 0.0035524539563862936,
      "min": 0.00683339126,
      "max": 0.01044408026
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.007920071841939805,
      "stddev": 0.00035304400765021857,
      "median": 0.00791002726,
      "user": 0.004634257591973243,
      "system": 0.004048959464882943,
      "min": 0.00715409426,
      "max": 0.00989533826
    },
    {
      "command": "pnpr@main",
      "mean": 0.007930332631428571,
      "stddev": 0.0003519972354674219,
      "median": 0.007910922760000001,
      "user": 0.004790733571428569,
      "system": 0.003927278714285716,
      "min": 0.00714186126,
      "max": 0.009762789260000002
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.580 ± 0.132 2.486 2.857 1.73 ± 0.11
pacquet@main 2.520 ± 0.029 2.481 2.590 1.69 ± 0.07
pnpr@HEAD 1.516 ± 0.101 1.393 1.701 1.02 ± 0.08
pnpr@main 1.489 ± 0.056 1.419 1.609 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.5797352402400002,
      "stddev": 0.13195941075171147,
      "median": 2.51986019884,
      "user": 2.00233306,
      "system": 1.6930268800000001,
      "min": 2.48607133534,
      "max": 2.85667739634
    },
    {
      "command": "pacquet@main",
      "mean": 2.5201384019399997,
      "stddev": 0.02924890960877361,
      "median": 2.51102854334,
      "user": 1.8551046599999998,
      "system": 1.56823538,
      "min": 2.48091176834,
      "max": 2.59043153134
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.5159379143399998,
      "stddev": 0.10144484007224687,
      "median": 1.48026717584,
      "user": 1.22838346,
      "system": 1.2778876800000003,
      "min": 1.39322348034,
      "max": 1.70130363934
    },
    {
      "command": "pnpr@main",
      "mean": 1.48936962744,
      "stddev": 0.05649881006890904,
      "median": 1.48105533284,
      "user": 1.15052766,
      "system": 1.2447827800000002,
      "min": 1.41908045734,
      "max": 1.60918418634
    }
  ]
}

Scenario: Isolated linker: fresh install, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 548.9 ± 119.8 431.6 720.1 1.88 ± 0.42
pacquet@main 440.3 ± 17.2 413.4 468.6 1.50 ± 0.08
pnpr@HEAD 292.6 ± 10.9 270.9 306.4 1.00
pnpr@main 292.6 ± 9.3 281.1 305.9 1.00 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.54886985278,
      "stddev": 0.11979273223284534,
      "median": 0.5084992929800001,
      "user": 0.77517666,
      "system": 0.9494162599999999,
      "min": 0.43159349998,
      "max": 0.72014227898
    },
    {
      "command": "pacquet@main",
      "mean": 0.44028992667999994,
      "stddev": 0.017180067835230406,
      "median": 0.43676675598000003,
      "user": 0.64674536,
      "system": 0.7545423600000001,
      "min": 0.41338192398,
      "max": 0.46856034798
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.29261321598,
      "stddev": 0.010868438279986245,
      "median": 0.29627914548,
      "user": 0.24951936,
      "system": 0.5732646600000001,
      "min": 0.27092894298,
      "max": 0.30641552297999997
    },
    {
      "command": "pnpr@main",
      "mean": 0.29263302728,
      "stddev": 0.009250794903897849,
      "median": 0.29175495298,
      "user": 0.24216605999999996,
      "system": 0.58177056,
      "min": 0.28109921298,
      "max": 0.30588951098
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + hot store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.601 ± 0.020 1.565 1.632 5.65 ± 0.22
pacquet@main 1.679 ± 0.131 1.579 1.954 5.93 ± 0.51
pnpr@HEAD 0.289 ± 0.018 0.275 0.328 1.02 ± 0.07
pnpr@main 0.283 ± 0.010 0.268 0.298 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.6011413787600002,
      "stddev": 0.019593700793240174,
      "median": 1.60402650776,
      "user": 0.87812048,
      "system": 0.8687264600000001,
      "min": 1.56518741476,
      "max": 1.63206702376
    },
    {
      "command": "pacquet@main",
      "mean": 1.67888672726,
      "stddev": 0.13060132928831664,
      "median": 1.61408546676,
      "user": 1.0730563800000001,
      "system": 1.0473956599999998,
      "min": 1.5790035047600002,
      "max": 1.95441850776
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.28941204666000003,
      "stddev": 0.01767034398277032,
      "median": 0.28120493276,
      "user": 0.25757328,
      "system": 0.5372351599999999,
      "min": 0.27493379876,
      "max": 0.32842253076000005
    },
    {
      "command": "pnpr@main",
      "mean": 0.28324985336,
      "stddev": 0.010412152475172019,
      "median": 0.28596118076000004,
      "user": 0.24507848000000002,
      "system": 0.50568496,
      "min": 0.26806326876000003,
      "max": 0.29770815576000004
    }
  ]
}

Scenario: Isolated linker: fresh resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 408.1 ± 86.1 277.9 488.9 4.14 ± 0.88
pacquet@main 281.1 ± 17.2 256.3 309.1 2.85 ± 0.19
pnpr@HEAD 99.0 ± 2.7 94.9 103.7 1.00 ± 0.04
pnpr@main 98.6 ± 2.3 93.3 103.3 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.408143632,
      "stddev": 0.08612054390443258,
      "median": 0.44225224530000007,
      "user": 0.4082976800000001,
      "system": 0.17922239999999998,
      "min": 0.2778580063,
      "max": 0.4888550723000001
    },
    {
      "command": "pacquet@main",
      "mean": 0.28107205490000003,
      "stddev": 0.017173422385712088,
      "median": 0.2814917403,
      "user": 0.26597008,
      "system": 0.11073649999999999,
      "min": 0.25627082430000003,
      "max": 0.30913387830000005
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.09896709497857141,
      "stddev": 0.0027316146556115193,
      "median": 0.0990206978,
      "user": 0.04256410142857142,
      "system": 0.017976771428571424,
      "min": 0.0948594993,
      "max": 0.10373475730000001
    },
    {
      "command": "pnpr@main",
      "mean": 0.09863296247857138,
      "stddev": 0.002314318443924836,
      "median": 0.0987202478,
      "user": 0.04160967285714284,
      "system": 0.018151378571428574,
      "min": 0.0932610073,
      "max": 0.10326486730000001
    }
  ]
}

Scenario: Isolated linker: peer-heavy resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 235.0 ± 6.5 227.6 245.3 1.00
pacquet@main 235.7 ± 19.9 209.4 269.9 1.00 ± 0.09
pnpm@HEAD 3515.8 ± 99.5 3341.2 3622.1 14.96 ± 0.59
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.23502923693333333,
      "stddev": 0.00649261030726462,
      "median": 0.23406008460000002,
      "user": 0.24085856666666666,
      "system": 0.05610636666666666,
      "min": 0.22764539060000002,
      "max": 0.24527028760000003
    },
    {
      "command": "pacquet@main",
      "mean": 0.23574195193333333,
      "stddev": 0.019905207151874247,
      "median": 0.23669424860000002,
      "user": 0.23722634444444443,
      "system": 0.05056936666666667,
      "min": 0.20942880860000002,
      "max": 0.2699315996
    },
    {
      "command": "pnpm@HEAD",
      "mean": 3.5157584117111114,
      "stddev": 0.09949294582319294,
      "median": 3.5146880156,
      "user": 5.282477677777779,
      "system": 0.37951114444444445,
      "min": 3.3411796716,
      "max": 3.6221117426
    }
  ]
}

Scenario: Isolated linker: linked-workspace resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 201.9 ± 3.4 196.9 209.3 1.00
pacquet@main 220.0 ± 26.7 197.2 266.0 1.09 ± 0.13
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.20192594739428574,
      "stddev": 0.0034328495755519177,
      "median": 0.20070673318000004,
      "user": 0.1596288485714286,
      "system": 0.07605973714285715,
      "min": 0.19693739268000002,
      "max": 0.20926594568
    },
    {
      "command": "pacquet@main",
      "mean": 0.21999720646571427,
      "stddev": 0.02671795442965883,
      "median": 0.20640841218000003,
      "user": 0.1736947057142857,
      "system": 0.08329709428571429,
      "min": 0.19719835568000002,
      "max": 0.26595560968000004
    }
  ]
}

Scenario: Isolated linker: injected workspace repeat install, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 120.4 ± 12.3 95.3 149.2 1.35 ± 0.35
pacquet@main 89.3 ± 21.2 67.5 132.9 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.12040875816551723,
      "stddev": 0.01226580038841423,
      "median": 0.1196427352,
      "user": 0.04638598827586206,
      "system": 0.08299295172413795,
      "min": 0.0953087402,
      "max": 0.14923825220000003
    },
    {
      "command": "pacquet@main",
      "mean": 0.08930076520000002,
      "stddev": 0.021208457144931855,
      "median": 0.0761532277,
      "user": 0.03574872181818182,
      "system": 0.060192354545454546,
      "min": 0.0674823892,
      "max": 0.13286600820000002
    }
  ]
}

Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.486 ± 0.128 4.348 4.681 1.27 ± 0.07
pacquet@main 4.459 ± 0.119 4.347 4.706 1.27 ± 0.06
pnpr@HEAD 3.523 ± 0.151 3.393 3.796 1.00
pnpr@main 3.525 ± 0.125 3.414 3.770 1.00 ± 0.06
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.48580325672,
      "stddev": 0.12805119701036105,
      "median": 4.471140951520001,
      "user": 1.5495438199999998,
      "system": 1.5980540799999998,
      "min": 4.348402822020001,
      "max": 4.68060625802
    },
    {
      "command": "pacquet@main",
      "mean": 4.4592817703200005,
      "stddev": 0.11868972213904735,
      "median": 4.41131888402,
      "user": 1.36050842,
      "system": 1.4313442799999998,
      "min": 4.34714621102,
      "max": 4.70586575302
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.5225198335200005,
      "stddev": 0.15110203015856605,
      "median": 3.45076254002,
      "user": 1.28986392,
      "system": 1.3239677799999998,
      "min": 3.39340991202,
      "max": 3.79636721002
    },
    {
      "command": "pnpr@main",
      "mean": 3.52509790172,
      "stddev": 0.1253719706414487,
      "median": 3.46610849052,
      "user": 1.30255752,
      "system": 1.3390671799999998,
      "min": 3.41415459902,
      "max": 3.76992690702
    }
  ]
}

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.

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 117.9 ± 7.2 108.1 135.4 1.00
pacquet@main 121.9 ± 4.9 115.7 136.5 1.03 ± 0.08
pnpr@HEAD 136.4 ± 3.4 130.0 143.5 1.16 ± 0.08
pnpr@main 138.1 ± 5.1 129.8 152.6 1.17 ± 0.08
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.1178537892426087,
      "stddev": 0.007213337165227008,
      "median": 0.11663512246,
      "user": 0.1477041913043478,
      "system": 0.12369138782608693,
      "min": 0.10806365446,
      "max": 0.13541665045999998
    },
    {
      "command": "pacquet@main",
      "mean": 0.12189088959636364,
      "stddev": 0.004929364221265126,
      "median": 0.12150692146,
      "user": 0.15188116363636364,
      "system": 0.12215303999999995,
      "min": 0.11569898646000001,
      "max": 0.13646291446
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.13641650682842102,
      "stddev": 0.0034010020911194724,
      "median": 0.13585958246,
      "user": 0.16030816842105267,
      "system": 0.13594509263157892,
      "min": 0.13001545046,
      "max": 0.14354365446
    },
    {
      "command": "pnpr@main",
      "mean": 0.13807733084888885,
      "stddev": 0.00505649759336416,
      "median": 0.13731983145999999,
      "user": 0.1649038,
      "system": 0.12864970666666664,
      "min": 0.12976957946,
      "max": 0.15256793246
    }
  ]
}

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.

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.121 ± 0.017 1.090 1.148 1.00
pacquet@main 1.123 ± 0.017 1.089 1.147 1.00 ± 0.02
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.12092791018,
      "stddev": 0.017343963821338897,
      "median": 1.11964360198,
      "user": 0.50608526,
      "system": 0.19342072000000002,
      "min": 1.0900456004799999,
      "max": 1.14781666548
    },
    {
      "command": "pacquet@main",
      "mean": 1.12275484768,
      "stddev": 0.01714657602917066,
      "median": 1.1232781969799999,
      "user": 0.48936075999999995,
      "system": 0.21331171999999995,
      "min": 1.0892166104799998,
      "max": 1.14741480048
    }
  ]
}

@lazerg
lazerg marked this pull request as ready for review October 17, 2026 02:50
@lazerg
lazerg requested a review from zkochan as a code owner October 17, 2026 02:50
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Oct 17, 2026
lazerg and others added 3 commits October 17, 2026 09:48
pnpm now measures a workspace: path in an override from the workspace
root, so an override written in a file listed under include has to be
re-expressed from that root, as file: and link: values already are.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@qodo-code-review

qodo-code-review Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (1) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Workspace path tests omit Windows cases ✓ Resolved
Description
The new regression coverage exercises workspace-path parsing and re-anchoring only with
/-separated paths. Windows separator handling can therefore regress unnoticed across the changed
local-spec and override implementations.
Code

pnpm/crates/local-spec/src/tests.rs[R124-128]

+fn reanchors_a_workspace_path_against_the_consumer() {
+    assert_eq!(
+        render_workspace_path("workspace:./packages/target", "packages/deep/consumer").as_deref(),
+        Some("workspace:../../target"),
+    );
Relevance

●●● Strong

Recent local-spec precedent accepted Windows separator regression tests for path normalization and
re-anchoring.

PR-#15127
PR-#16887

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The checklist requires path and link changes to include Windows separator coverage. The added
local-spec regression test checks only workspace:./packages/target and POSIX-style consumer paths,
and the corresponding v11 and CLI tests likewise use slash-separated paths without a
Windows-specific case.

pnpm/crates/local-spec/src/tests.rs[123-150]
pnpm11/hooks/read-package-hook/test/createVersionOverrider.test.ts[467-527]
pnpm/crates/cli/tests/suite/workspace_path_overrides.rs[13-60]
Skill: review-code

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The workspace path override tests cover only POSIX-style separators, while the changed path parsing and re-anchoring logic must also be validated for Windows behavior.

## Fix Focus Areas
- pnpm/crates/local-spec/src/tests.rs[123-150]
- pnpm11/hooks/read-package-hook/test/createVersionOverrider.test.ts[467-527]
- pnpm/crates/cli/tests/suite/workspace_path_overrides.rs[13-60]

## Recommended Fix
Add explicit Windows-specific cases using backslash-separated paths, and assert that nested workspace consumers resolve the intended target correctly for both injected and non-injected installs where the platform test harness supports it.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

2. Workspace override tests omit trailing commas 📘 Rule violation ⚙ Maintainability
Description
The new multi-line calls to createVersionsOverrider and the returned overrider leave their final
arguments without trailing commas. These call sites are in the added regression tests, so the
formatting inconsistency is introduced in this PR and will produce noisier diffs when arguments
change.
Code

pnpm11/hooks/read-package-hook/test/createVersionOverrider.test.ts[R474-476]

+      newBareSpecifier: 'workspace:./packages/qar',
+    },
+  ], rootDir)
Relevance

● Weak

Recent reviews rejected equivalent trailing-comma findings in multiline TypeScript calls despite the
formatting rule.

PR-#16968
PR-#16903
PR-#12876

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The checklist requires trailing commas on the final item of every multi-line TypeScript argument
list. The added calls end with rootDir, path.join(...), and process.cwd() without trailing
commas.

Rule 713434: Require trailing commas in TypeScript collections and multi-line constructs
pnpm11/hooks/read-package-hook/test/createVersionOverrider.test.ts[467-527]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The added TypeScript regression tests contain multi-line argument lists whose final arguments do not have trailing commas.

## Fix Focus Areas
- pnpm11/hooks/read-package-hook/test/createVersionOverrider.test.ts[467-527]

## Recommended Fix
Add trailing commas to the final arguments of every multi-line function call introduced in this test, including the `createVersionsOverrider` calls and the returned overrider calls.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


Grey Divider

Context sources
❌ Tickets: failed to load — Ticket collection could not establish complete evidence
✅ Compliance rules (platform): 66 rules
✅ Cross-repo context — repo relationships
  Explored: repo: pnpm/update (sha: 2457663d) — View relationship
  Explored: repo: pnpm/pnpm.io (sha: e5b39ba5) — View relationship
Review mode: Auto: 🧠 Deep: Multiple path-resolution implementations and integration paths create dense subtle defect risk.
✅ Fix-loop round: fix loop

Grey Divider

Tip of the day
💡 Did you know, you can see how risky a PR is at a glance with blast radius labels

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Previous reviews

Review updated until commit 8213c09

Results up to commit ed257b1 🧠 Deep


🐞 Bugs (0) 📘 Rule violations (1) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Remediation recommended
1. Workspace path tests omit Windows cases ✓ Resolved
Description
The new regression coverage exercises workspace-path parsing and re-anchoring only with
/-separated paths. Windows separator handling can therefore regress unnoticed across the changed
local-spec and override implementations.
Code

pnpm/crates/local-spec/src/tests.rs[R124-128]

+fn reanchors_a_workspace_path_against_the_consumer() {
+    assert_eq!(
+        render_workspace_path("workspace:./packages/target", "packages/deep/consumer").as_deref(),
+        Some("workspace:../../target"),
+    );
Relevance

●●● Strong

Recent local-spec precedent accepted Windows separator regression tests for path normalization and
re-anchoring.

PR-#15127
PR-#16887

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The checklist requires path and link changes to include Windows separator coverage. The added
local-spec regression test checks only workspace:./packages/target and POSIX-style consumer paths,
and the corresponding v11 and CLI tests likewise use slash-separated paths without a
Windows-specific case.

pnpm/crates/local-spec/src/tests.rs[123-150]
pnpm11/hooks/read-package-hook/test/createVersionOverrider.test.ts[467-527]
pnpm/crates/cli/tests/suite/workspace_path_overrides.rs[13-60]
Skill: review-code

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The workspace path override tests cover only POSIX-style separators, while the changed path parsing and re-anchoring logic must also be validated for Windows behavior.

## Fix Focus Areas
- pnpm/crates/local-spec/src/tests.rs[123-150]
- pnpm11/hooks/read-package-hook/test/createVersionOverrider.test.ts[467-527]
- pnpm/crates/cli/tests/suite/workspace_path_overrides.rs[13-60]

## Recommended Fix
Add explicit Windows-specific cases using backslash-separated paths, and assert that nested workspace consumers resolve the intended target correctly for both injected and non-injected installs where the platform test harness supports it.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational
2. Workspace override tests omit trailing commas 📘 Rule violation ⚙ Maintainability
Description
The new multi-line calls to createVersionsOverrider and the returned overrider leave their final
arguments without trailing commas. These call sites are in the added regression tests, so the
formatting inconsistency is introduced in this PR and will produce noisier diffs when arguments
change.
Code

pnpm11/hooks/read-package-hook/test/createVersionOverrider.test.ts[R474-476]

+      newBareSpecifier: 'workspace:./packages/qar',
+    },
+  ], rootDir)
Relevance

● Weak

Recent reviews rejected equivalent trailing-comma findings in multiline TypeScript calls despite the
formatting rule.

PR-#16968
PR-#16903
PR-#12876

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The checklist requires trailing commas on the final item of every multi-line TypeScript argument
list. The added calls end with rootDir, path.join(...), and process.cwd() without trailing
commas.

Rule 713434: Require trailing commas in TypeScript collections and multi-line constructs
pnpm11/hooks/read-package-hook/test/createVersionOverrider.test.ts[467-527]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The added TypeScript regression tests contain multi-line argument lists whose final arguments do not have trailing commas.

## Fix Focus Areas
- pnpm11/hooks/read-package-hook/test/createVersionOverrider.test.ts[467-527]

## Recommended Fix
Add trailing commas to the final arguments of every multi-line function call introduced in this test, including the `createVersionsOverrider` calls and the returned overrider calls.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


Grey Divider

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 8213c09

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@zkochan

zkochan commented Oct 17, 2026

Copy link
Copy Markdown
Member

Rebased onto main and pushed two follow-ups:

  • ed257b1: in pnpm 12, an override in a file listed under include now has its workspace: path rebased from that file to the workspace root, as file: and link: values already were. Without this, the root-relative reading this PR adds would have measured a path written from config/overrides.yaml from the root. Covered in relative_paths_are_measured_from_the_including_fragment; the test fails without the fix. pnpm/docs/config-includes.md is updated to match. Catalogs are not affected: they don't re-anchor workspace: paths.
  • 8213c09: a local-spec test for a backslash-separated workspace:.\packages\target, from Qodo's Windows-separator finding.

Qodo's trailing-comma finding is declined. The calls close with ], rootDir) on the line of their last argument, which is the shape the rest of createVersionOverrider.test.ts uses, and lint passes.

Status on 8213c09: all checks pass. CodeRabbit reviewed this commit with no actionable comments. Qodo has no open findings beyond the declined one. Greptile's trial has ended, so it does not review. Nothing else remains within scope.


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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pnpm 12: relative workspace: overrides are not rebased (broken links / injected install failure)

3 participants