Skip to content

fix(deploy): link bins exposed by workspace dependencies - #14942

Merged
zkochan merged 2 commits into
mainfrom
fix-14899
Sep 16, 2026
Merged

zkochan merged 2 commits into
mainfrom
fix-14899

Conversation

@zkochan

@zkochan zkochan commented Sep 16, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Fix pnpm deploy in pnpm v12 so workspace directory dependencies without explicit hasBin metadata are checked for commands and linked into the deployed project's node_modules/.bin directory.
  • Record definitive bin metadata for workspace rows in newly generated deploy lockfiles, keeping binless workspace packages on the no-I/O fast path.
  • Keep registry-package metadata on the existing fast path and cover both shared-lockfile and legacy deploy modes with a regression test.

Closes #14899.

Squash Commit Body

Deploy-generated directory resolutions omitted `hasBin` from their lockfile metadata, so the precomputed has-bin set dropped every workspace dependency slot and the deployed project's `node_modules/.bin` directory came out empty.

Record definitive bin metadata when generating workspace directory rows. Probe directory resolutions whose metadata is absent for compatibility with older lockfiles while continuing to skip resolutions explicitly marked `hasBin: false`.

Closes pnpm/pnpm#14899

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 (Codex, GPT-5.6).

Summary by CodeRabbit

  • Bug Fixes

    • pnpm deploy now links command-line binaries provided by workspace dependencies into the deployed project’s node_modules/.bin directory.
    • Binary detection now correctly handles workspace and directory dependencies, including cases where binary metadata is unavailable.
    • Deployment metadata now accurately records whether linked workspace packages provide command-line binaries.
  • Release

    • Included a patch release for this deployment fix.

Directory resolutions carry no `hasBin` in their generated lockfile
metadata, so the pre-computed has-bin set dropped every workspace
dependency slot and the deployed project's `node_modules/.bin` came out
empty.

Close #14899
@coderabbitai

coderabbitai Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: f1f62529-efdd-4e8f-b266-927ee77fb1d1

📥 Commits

Reviewing files that changed from the base of the PR and between e4acd27 and 839f62d.

📒 Files selected for processing (7)
  • pnpm/crates/cli/src/cli_args/deploy.rs
  • pnpm/crates/cli/src/cli_args/deploy/lockfile.rs
  • pnpm/crates/cli/src/cli_args/deploy/tests.rs
  • pnpm/crates/cli/tests/suite/deploy.rs
  • pnpm/crates/deps-restorer/src/link_bins/tests.rs
  • pnpm/crates/package-manager/src/dependencies_graph_to_lockfile.rs
  • pnpm/crates/package-manager/src/dependencies_graph_to_lockfile/packages.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • pnpm/crates/deps-restorer/src/link_bins/tests.rs

Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The change records workspace package bin metadata during deploy, expands bin probing for implicit metadata, and verifies standard and legacy deploys link workspace commands. A changeset declares a patch release for pacquet.

Changes

Workspace dependency bin linking

Layer / File(s) Summary
Record workspace bin metadata
pnpm/crates/package-manager/src/dependencies_graph_to_lockfile.rs, pnpm/crates/package-manager/src/dependencies_graph_to_lockfile/packages.rs, pnpm/crates/cli/src/cli_args/deploy.rs, pnpm/crates/cli/src/cli_args/deploy/lockfile.rs, pnpm/crates/cli/src/cli_args/deploy/tests.rs
ProjectInfo records manifest bin presence. Deploy lockfile metadata uses that value for linked workspace packages.
Expand bin detection and coverage
pnpm/crates/deps-restorer/src/link_bins.rs, pnpm/crates/deps-restorer/src/link_bins/tests.rs
build_has_bin_set includes binary, variation, and directory resolutions that require bin probing. Tests cover directory resolutions without has_bin metadata.
Verify deploy integration and release metadata
pnpm/crates/cli/tests/suite/deploy.rs, .changeset/cuddly-spoons-link.md
Deploy tests verify .bin/lib-cli for standard and legacy production deploys. They also verify has_bin metadata for binary and binless workspace packages. The changeset declares a patch release for pacquet.

Priority: ➖ Normal

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

Change: Bug fix · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant DeployTest
  participant pnpm_deploy
  participant deps_restorer
  participant node_modules_bin
  DeployTest->>pnpm_deploy: run standard or legacy production deploy
  pnpm_deploy->>deps_restorer: restore dependencies and link bins
  deps_restorer->>node_modules_bin: create workspace dependency binary link
  node_modules_bin-->>DeployTest: expose lib-cli
Loading

Assessment against linked issues

Objective Addressed Explanation
Ensure pnpm deploy links bins exposed by workspace dependencies in production deploys, including legacy mode [#14899] ✅
Prevent workspace dependency bins from being omitted when resolution metadata lacks has_bin: true [#14899] ✅

Suggested labels: product: pacquet

Merge Risk: ⚪ Minimal · up to 839f6

No concrete current-head risk is identified that would block merging.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-14899

Warning

Git: CodeRabbit could not clone the repository, so clone-backed analysis was skipped and this review may be incomplete. Verify repository clone access, such as SSH credentials, before requesting another full review. If clone access is intentionally unavailable, use path_filters to narrow the review scope.


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.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Link workspace dependency binaries during deploy

🐞 Bug fix 🧪 Tests 🕐 20-40 Minutes

Grey Divider

AI Description

• Probe workspace directory dependencies when lockfile bin metadata is absent during deployment.
• Preserve fast-path skips for explicit false and registry package metadata.
• Test bin linking in shared-lockfile and legacy deploy modes.
Diagram

graph TD
  A["Deploy command"] --> B["Lockfile metadata"] --> C{"Probe bins?"}
  C -->|"Directory metadata absent"| D["Workspace manifest"] --> E["Bin resolver"] --> F["Deployed .bin"]
  C -->|"Explicit false"| G["Skip manifest"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Probe all metadata-absent dependencies
  • ➕ Simplifies classification of packages lacking hasBin metadata
  • ➕ Handles other resolution types conservatively if their metadata is incomplete
  • ➖ Adds unnecessary manifest reads for registry packages known not to expose bins
  • ➖ Weakens the existing warm-cache optimization
2. Emit hasBin for directory resolutions
  • ➕ Makes lockfile metadata complete and preserves exact fast-path filtering
  • ➕ Centralizes package capability detection during lockfile generation
  • ➖ Requires broader changes to lockfile generation and compatibility behavior
  • ➖ Does not repair deployments using existing lockfiles without the metadata

Recommendation: Use the PR's selective directory-resolution fallback. It fixes current and existing lockfiles while preserving authoritative hasBin: false handling and registry-package performance; emitting complete directory metadata can be considered separately as a forward-looking optimization.

Files changed (4) +62 / -14

Bug fix (1) +7 / -3
link_bins.rsProbe directory resolutions with missing bin metadata +7/-3

Probe directory resolutions with missing bin metadata

• Includes directory resolutions in the precomputed bin candidate set when 'hasBin' is absent, allowing their manifests to be inspected. Explicit 'hasBin: false' entries and registry metadata retain the existing fast path.

pnpm/crates/deps-restorer/src/link_bins.rs

Tests (2) +50 / -11
deploy.rsCover workspace bins in both deploy modes +48/-0

Cover workspace bins in both deploy modes

• Adds a workspace package exposing 'lib-cli', deploys the consuming application in standard and legacy modes, and verifies the command link exists in each deployment.

pnpm/crates/cli/tests/suite/deploy.rs

tests.rsValidate implicit directory bin candidates +2/-11

Validate implicit directory bin candidates

• Extends the bin-set unit test to require directory resolutions without 'hasBin' metadata alongside runtime resolutions, while registry packages without bin metadata remain excluded.

pnpm/crates/deps-restorer/src/link_bins/tests.rs

Documentation (1) +5 / -0
cuddly-spoons-link.mdDocument workspace binary linking fix +5/-0

Document workspace binary linking fix

• Adds a patch release note explaining that deployed workspace dependency commands are now linked into 'node_modules/.bin'.

.changeset/cuddly-spoons-link.md

@greptile-apps

greptile-apps Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge; the workspace-bin regression is covered without introducing a confirmed correctness or rules-compliance issue.

Reviews (2) · Last reviewed commit: "fix(deploy): record workspace bin metada..."

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Sep 16, 2026
@qodo-code-review

qodo-code-review Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Informational

1. Workspace installs repeat manifest reads ✓ Resolved 🐞 Bug ➹ Performance
Description
build_has_bin_set now marks every directory resolution with absent has_bin as a bin candidate,
so binless workspace packages lose the metadata fast path. Because directory packages have no
warm-cache manifest and candidates are processed for each snapshot edge and again for importer
links, installs and deploys repeatedly read and parse the same package.json.
Code

pnpm/crates/deps-restorer/src/link_bins.rs[R204-205]

+                    || (meta.has_bin.is_none()
+                        && matches!(meta.resolution, LockfileResolution::Directory(_)))
Relevance

● Weak

Similar manifest-read performance optimization in bin linking was rejected; directory probing is
intentional for workspace-bin correctness.

PR-#13171
PR-#13151

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Directory resolutions deliberately receive no store cache key, so their manifests cannot appear in
the warm manifest map. The changed predicate retains them for every dependency edge; each cache miss
then reads and parses the manifest, while direct importer linking has an additional disk fallback
for the same key.

pnpm/crates/deps-restorer/src/create_virtual_store/cache_keys.rs[84-94]
pnpm/crates/deps-restorer/src/link_bins.rs[400-485]
pnpm/crates/deps-restorer/src/link_bins/direct.rs[159-215]
pnpm/crates/cli/src/cli_args/deploy/lockfile.rs[203-228]

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

## Issue description
Directory resolutions without `has_bin` now trigger repeated filesystem reads and JSON parsing for the same workspace package across snapshot edges and importer links.

## Fix Focus Areas
- pnpm/crates/deps-restorer/src/link_bins.rs[191-208]
- pnpm/crates/deps-restorer/src/link_bins.rs[400-485]
- pnpm/crates/deps-restorer/src/link_bins/direct.rs[109-215]
- pnpm/crates/cli/src/cli_args/deploy/lockfile.rs[187-229]
- pnpm/crates/cli/src/cli_args/deploy.rs[337-360]

## Recommended Fix
Preserve conservative probing for genuinely unknown legacy directory rows, but memoize each parsed directory manifest or negative no-bin result by metadata key for the duration of each linking pass. Also derive `has_bin` from the already-discovered workspace manifests when generating deploy package metadata so newly generated binless directory rows retain the no-I/O fast path; add a filesystem-counter test where several slots reference one binless directory package and verify it is not parsed once per edge.

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


Grey Divider

Context sources
✅ Compliance rules (platform): 37 rules
✅ Cross-repo context — repo relationships
Review mode: 🚀 Fast: The push makes a localized deploy bin-detection change across related code paths with regression tests, without security-sensitive or broad cross-cutting behavior.

Grey Divider

Tip of the day
💡 Did you know, you can group findings by type and pick your Finding display, from Minimal to Full

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

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.

@github-actions

github-actions Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                                            main                                   pr
-----                                            ----                                   --
lockfile/parse_pnpm_lock                         1.07     12.3±0.45ms    30.4 MB/sec    1.00     11.6±0.06ms    32.4 MB/sec
packument/parse                                  1.05     38.7±0.14µs  1713.1 MB/sec    1.00     37.0±0.11µs  1791.1 MB/sec
tarball/download_dependency                      1.00      4.0±0.19ms  1091.4 KB/sec    1.03      4.1±0.27ms  1063.0 KB/sec
tarball_batch/cold_store_many_medium_tarballs    1.06    189.5±9.88ms 84.4 KElem/sec    1.00    179.0±8.23ms 89.4 KElem/sec
workspace_resolution/hoist_heavy                 1.09    258.7±8.12ms        ? ?/sec    1.00    236.6±1.71ms        ? ?/sec
workspace_sort/chained_projects                  1.00     11.9±0.26ms        ? ?/sec    1.19     14.1±0.68ms        ? ?/sec

@codecov-commenter

codecov-commenter commented Sep 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.96%. Comparing base (4e60888) to head (839f62d).
⚠️ Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #14942      +/-   ##
==========================================
+ Coverage   90.93%   90.96%   +0.02%     
==========================================
  Files        1268     1270       +2     
  Lines      170292   170360      +68     
==========================================
+ Hits       154850   154961     +111     
+ Misses      15442    15399      -43     

☔ 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 Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: 839f62d2785e

Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm; the linked-workspace scenario compares current Rust against main Rust. Bencher consumes pacquet@HEAD and pnpr@HEAD.

The tables below show mean ± σ; Bencher thresholds on the minimum latency, which is far less perturbed by shared-runner contention (noise only adds time).

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.310 ± 0.077 2.236 2.476 1.66 ± 0.17
pacquet@main 2.354 ± 0.141 2.220 2.600 1.69 ± 0.19
pnpr@HEAD 1.393 ± 0.134 1.281 1.639 1.00
pnpr@main 1.444 ± 0.123 1.284 1.619 1.04 ± 0.13
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.31024980444,
      "stddev": 0.07659047641867447,
      "median": 2.3017903228399996,
      "user": 1.2180616199999998,
      "system": 1.4254029599999998,
      "min": 2.23638353184,
      "max": 2.47572961984
    },
    {
      "command": "pacquet@main",
      "mean": 2.35399937674,
      "stddev": 0.14057789090328326,
      "median": 2.28847209034,
      "user": 1.15513102,
      "system": 1.4011748599999998,
      "min": 2.22020414584,
      "max": 2.60006283784
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.3925109952399999,
      "stddev": 0.13408965265143058,
      "median": 1.32338382934,
      "user": 1.0997850200000001,
      "system": 1.27498976,
      "min": 1.28138194284,
      "max": 1.63868498484
    },
    {
      "command": "pnpr@main",
      "mean": 1.44377033754,
      "stddev": 0.12320817441011715,
      "median": 1.4416228713400001,
      "user": 1.11055342,
      "system": 1.2567666599999998,
      "min": 1.28367337584,
      "max": 1.61927139684
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 226.3 ± 4.8 220.9 233.8 1.00 ± 0.04
pacquet@main 225.3 ± 7.7 214.8 240.2 1.00
pnpr@HEAD 312.9 ± 43.1 241.6 390.3 1.39 ± 0.20
pnpr@main 261.5 ± 58.4 214.8 390.9 1.16 ± 0.26
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.22625588696000004,
      "stddev": 0.004804732848804838,
      "median": 0.22500202786,
      "user": 0.22920168,
      "system": 0.5653446599999999,
      "min": 0.22086894836,
      "max": 0.23380308136
    },
    {
      "command": "pacquet@main",
      "mean": 0.22528224706,
      "stddev": 0.007687447417189402,
      "median": 0.22430841036000002,
      "user": 0.24816697999999998,
      "system": 0.5565228600000001,
      "min": 0.21478055736,
      "max": 0.24015488736
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.31293765826000003,
      "stddev": 0.043056543922349776,
      "median": 0.31923342886000006,
      "user": 0.34025587999999996,
      "system": 0.6878089600000001,
      "min": 0.24164962336,
      "max": 0.39030114936000004
    },
    {
      "command": "pnpr@main",
      "mean": 0.26148238516,
      "stddev": 0.058447949080676104,
      "median": 0.23965147386000002,
      "user": 0.26021627999999997,
      "system": 0.61750066,
      "min": 0.21476057236,
      "max": 0.39085063536000003
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 6.6 ± 0.6 5.7 9.7 1.00
pacquet@main 6.7 ± 0.6 5.7 8.8 1.02 ± 0.12
pnpr@HEAD 7.7 ± 1.5 5.8 13.9 1.16 ± 0.25
pnpr@main 6.7 ± 0.8 5.7 10.4 1.01 ± 0.14
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.006641463821627298,
      "stddev": 0.0005933757512915023,
      "median": 0.006484446840000001,
      "user": 0.0041222325984252,
      "system": 0.0028898721259842503,
      "min": 0.005682260840000001,
      "max": 0.009714197840000001
    },
    {
      "command": "pacquet@main",
      "mean": 0.0067431757078304285,
      "stddev": 0.0005670569196499503,
      "median": 0.00669294784,
      "user": 0.004312695810473816,
      "system": 0.002807731471321697,
      "min": 0.005719851840000001,
      "max": 0.00884354384
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.007691927735238094,
      "stddev": 0.0015038343569919643,
      "median": 0.00712531884,
      "user": 0.00458821523809524,
      "system": 0.003532770190476191,
      "min": 0.005793017840000001,
      "max": 0.01391001184
    },
    {
      "command": "pnpr@main",
      "mean": 0.006701842548206689,
      "stddev": 0.0007503794492182097,
      "median": 0.006484014840000001,
      "user": 0.0039300929483282645,
      "system": 0.0031445630395136805,
      "min": 0.005734288840000001,
      "max": 0.01035227584
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 7.7 ± 1.1 5.7 11.5 1.18 ± 0.18
pacquet@main 7.6 ± 1.3 6.0 12.9 1.17 ± 0.20
pnpr@HEAD 6.8 ± 0.4 6.1 8.2 1.05 ± 0.08
pnpr@main 6.5 ± 0.3 6.0 8.4 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.007699474900594058,
      "stddev": 0.0011107024839865911,
      "median": 0.007650426960000001,
      "user": 0.004730213201320131,
      "system": 0.0033839720132013197,
      "min": 0.00571605496,
      "max": 0.011549788960000001
    },
    {
      "command": "pacquet@main",
      "mean": 0.007626561083076924,
      "stddev": 0.0012841058189542924,
      "median": 0.0072071159600000005,
      "user": 0.004863793846153841,
      "system": 0.0032002009846153847,
      "min": 0.00604724796,
      "max": 0.01293408696
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.0068497588061538495,
      "stddev": 0.0004029750881559049,
      "median": 0.00679978496,
      "user": 0.004414004487179488,
      "system": 0.0028506591025641032,
      "min": 0.00605603396,
      "max": 0.008178408960000001
    },
    {
      "command": "pnpr@main",
      "mean": 0.006517561456987956,
      "stddev": 0.00030851349225895404,
      "median": 0.006486562960000001,
      "user": 0.0041702722891566275,
      "system": 0.002739908554216868,
      "min": 0.00596616496,
      "max": 0.008362984960000002
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.466 ± 0.075 2.424 2.676 1.66 ± 0.12
pacquet@main 2.474 ± 0.076 2.421 2.646 1.67 ± 0.12
pnpr@HEAD 1.494 ± 0.105 1.373 1.748 1.01 ± 0.09
pnpr@main 1.483 ± 0.093 1.375 1.637 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.46572027814,
      "stddev": 0.0747072831137282,
      "median": 2.4425596991400003,
      "user": 1.7174727599999997,
      "system": 1.5722020799999998,
      "min": 2.42406316964,
      "max": 2.67605181864
    },
    {
      "command": "pacquet@main",
      "mean": 2.47401892454,
      "stddev": 0.07611725381625108,
      "median": 2.44833087864,
      "user": 1.7461567599999999,
      "system": 1.61372188,
      "min": 2.42055204864,
      "max": 2.64586059564
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.49437645154,
      "stddev": 0.10522517656885676,
      "median": 1.4635354171400001,
      "user": 1.0299647599999997,
      "system": 1.2016790799999997,
      "min": 1.37333741964,
      "max": 1.74759874864
    },
    {
      "command": "pnpr@main",
      "mean": 1.4829310566399998,
      "stddev": 0.09265422110704924,
      "median": 1.46505293914,
      "user": 1.03978296,
      "system": 1.22812658,
      "min": 1.37508958764,
      "max": 1.63699449064
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 333.2 ± 15.0 310.1 364.1 1.26 ± 0.09
pacquet@main 333.7 ± 18.1 314.1 373.7 1.26 ± 0.10
pnpr@HEAD 264.0 ± 13.9 242.1 282.1 1.00
pnpr@main 269.9 ± 15.0 248.7 294.8 1.02 ± 0.08
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.33324579312,
      "stddev": 0.015004432149587146,
      "median": 0.33358966672,
      "user": 0.49622871999999996,
      "system": 0.78941248,
      "min": 0.31009780072000004,
      "max": 0.36411688472000003
    },
    {
      "command": "pacquet@main",
      "mean": 0.33366888922000004,
      "stddev": 0.018117573193357345,
      "median": 0.32761084122000006,
      "user": 0.52770202,
      "system": 0.75783698,
      "min": 0.31408040272000004,
      "max": 0.37370198672000005
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.26396511042000004,
      "stddev": 0.013912468533033856,
      "median": 0.26664039272000006,
      "user": 0.20160471999999996,
      "system": 0.5027107799999999,
      "min": 0.24210525472000002,
      "max": 0.28206066672
    },
    {
      "command": "pnpr@main",
      "mean": 0.26992125512000004,
      "stddev": 0.014964161520296233,
      "median": 0.27060036222000006,
      "user": 0.22039062,
      "system": 0.4982959800000001,
      "min": 0.24865512472,
      "max": 0.29481150972000003
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.527 ± 0.012 1.517 1.551 6.28 ± 0.17
pacquet@main 1.516 ± 0.013 1.490 1.536 6.24 ± 0.17
pnpr@HEAD 0.243 ± 0.006 0.235 0.254 1.00
pnpr@main 0.256 ± 0.005 0.249 0.264 1.05 ± 0.04
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.52706207562,
      "stddev": 0.011600093812586655,
      "median": 1.52259557872,
      "user": 0.74041536,
      "system": 0.91761494,
      "min": 1.51715522072,
      "max": 1.5510514207200001
    },
    {
      "command": "pacquet@main",
      "mean": 1.51634973692,
      "stddev": 0.012999979230108656,
      "median": 1.51546005922,
      "user": 0.74463736,
      "system": 0.8793246399999999,
      "min": 1.48977544972,
      "max": 1.5364036167200001
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.24303056082,
      "stddev": 0.006470927647101044,
      "median": 0.24216963972000002,
      "user": 0.18586586,
      "system": 0.45188364000000003,
      "min": 0.23522244972000003,
      "max": 0.25408198172
    },
    {
      "command": "pnpr@main",
      "mean": 0.25637950692,
      "stddev": 0.005260755133986552,
      "median": 0.25674138422,
      "user": 0.19393316,
      "system": 0.50156874,
      "min": 0.24948494672000002,
      "max": 0.26375740172
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 186.5 ± 11.0 172.7 207.9 2.08 ± 0.14
pacquet@main 192.0 ± 14.0 174.6 219.9 2.15 ± 0.17
pnpr@HEAD 89.5 ± 2.4 84.9 95.7 1.00
pnpr@main 89.8 ± 2.3 85.4 94.6 1.00 ± 0.04
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.18647339072500002,
      "stddev": 0.011007600229360766,
      "median": 0.18683738710000003,
      "user": 0.19648707749999997,
      "system": 0.0587642375,
      "min": 0.17267220710000003,
      "max": 0.20786438510000002
    },
    {
      "command": "pacquet@main",
      "mean": 0.19198929078750004,
      "stddev": 0.013961576359229214,
      "median": 0.1897846736,
      "user": 0.19379076499999998,
      "system": 0.069705675,
      "min": 0.17458942410000003,
      "max": 0.21989351710000002
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.08950125075625001,
      "stddev": 0.002392087980567775,
      "median": 0.0893580651,
      "user": 0.03294548374999999,
      "system": 0.013011100000000001,
      "min": 0.08486995309999999,
      "max": 0.0956639621
    },
    {
      "command": "pnpr@main",
      "mean": 0.08975018743333334,
      "stddev": 0.0023244584894891876,
      "median": 0.0895674541,
      "user": 0.03375336727272728,
      "system": 0.012304533333333334,
      "min": 0.0853988861,
      "max": 0.0946365031
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 576.1 ± 33.5 531.8 624.3 1.00
pacquet@main 601.0 ± 51.3 532.3 672.6 1.04 ± 0.11
pnpm@HEAD 2931.0 ± 125.1 2785.2 3204.1 5.09 ± 0.37
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.5761240541888889,
      "stddev": 0.03354219344820477,
      "median": 0.5615134793000001,
      "user": 0.5951207066666667,
      "system": 0.13835871555555557,
      "min": 0.5317901833,
      "max": 0.6243165403000001
    },
    {
      "command": "pacquet@main",
      "mean": 0.6010000886333333,
      "stddev": 0.051287610540759296,
      "median": 0.5817678663000001,
      "user": 0.624169928888889,
      "system": 0.11866560444444445,
      "min": 0.5322536333000001,
      "max": 0.6726205013000001
    },
    {
      "command": "pnpm@HEAD",
      "mean": 2.9309824944111114,
      "stddev": 0.12511885904594305,
      "median": 2.8964936163,
      "user": 4.539807484444444,
      "system": 0.23219749333333337,
      "min": 2.7851771633,
      "max": 3.2041051913
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 185.5 ± 6.9 173.0 193.3 1.02 ± 0.06
pacquet@main 181.1 ± 7.3 170.7 192.3 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.18545376226000002,
      "stddev": 0.006920068956955731,
      "median": 0.18656581146,
      "user": 0.14056116666666665,
      "system": 0.09499541333333332,
      "min": 0.17295255046000002,
      "max": 0.19325624246
    },
    {
      "command": "pacquet@main",
      "mean": 0.18105973533500003,
      "stddev": 0.007340120237683634,
      "median": 0.18046174396000003,
      "user": 0.13401587499999998,
      "system": 0.09407813,
      "min": 0.17068943746,
      "max": 0.19229417446000002
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.443 ± 0.134 4.277 4.692 1.28 ± 0.05
pacquet@main 4.399 ± 0.129 4.310 4.702 1.27 ± 0.05
pnpr@HEAD 3.459 ± 0.080 3.366 3.598 1.00
pnpr@main 3.516 ± 0.156 3.336 3.760 1.02 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.4430314826999995,
      "stddev": 0.13391734919631995,
      "median": 4.4361977715,
      "user": 1.55297206,
      "system": 1.5229489399999998,
      "min": 4.2771849185,
      "max": 4.692224728499999
    },
    {
      "command": "pacquet@main",
      "mean": 4.3985173277,
      "stddev": 0.12859891961401174,
      "median": 4.342034846,
      "user": 1.64791546,
      "system": 1.6325553400000001,
      "min": 4.3103536415,
      "max": 4.701753485499999
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.4585487411000004,
      "stddev": 0.079535731185403,
      "median": 3.4388921615,
      "user": 1.47252416,
      "system": 1.46760564,
      "min": 3.3659918205,
      "max": 3.5984962725000003
    },
    {
      "command": "pnpr@main",
      "mean": 3.5157787544000003,
      "stddev": 0.15633655617761325,
      "median": 3.4856765825,
      "user": 1.43817906,
      "system": 1.4573222399999997,
      "min": 3.3360618725,
      "max": 3.7595288195000003
    }
  ]
}

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 118.6 ± 4.8 110.6 127.8 1.00
pacquet@main 120.0 ± 5.7 113.2 138.3 1.01 ± 0.06
pnpr@HEAD 138.3 ± 6.8 128.3 149.7 1.17 ± 0.07
pnpr@main 146.6 ± 5.1 140.4 157.9 1.24 ± 0.07
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.11859495442727272,
      "stddev": 0.004777349380556595,
      "median": 0.11809881520000001,
      "user": 0.14335339454545448,
      "system": 0.12568210727272727,
      "min": 0.1105752302,
      "max": 0.1278425012
    },
    {
      "command": "pacquet@main",
      "mean": 0.12004855893684212,
      "stddev": 0.005726715178158688,
      "median": 0.1183877042,
      "user": 0.1493050978947368,
      "system": 0.13171338,
      "min": 0.1132176332,
      "max": 0.1383273552
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.13827435503333332,
      "stddev": 0.006814968235400983,
      "median": 0.1385881897,
      "user": 0.16249138444444444,
      "system": 0.1465761022222222,
      "min": 0.12826488020000001,
      "max": 0.14966440720000002
    },
    {
      "command": "pnpr@main",
      "mean": 0.14662672508235292,
      "stddev": 0.005088210042641577,
      "median": 0.1451701512,
      "user": 0.1722419988235294,
      "system": 0.16713779176470583,
      "min": 0.14038490820000002,
      "max": 0.1579429882
    }
  ]
}

@github-actions

github-actions Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/14942
Testbedpacquet
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
milliseconds (ms)
(Result Δ%)
Upper Boundary
milliseconds (ms)
(Limit %)
gvs-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
110.58 ms
(-3.20%)Baseline: 114.23 ms
137.08 ms
(80.67%)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
🚷 view threshold
2,424.06 ms
(-1.98%)Baseline: 2,472.94 ms
2,967.52 ms
(81.69%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
1,517.16 ms
(-3.51%)Baseline: 1,572.37 ms
1,886.84 ms
(80.41%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
310.10 ms
(-20.29%)Baseline: 389.04 ms
466.85 ms
(66.42%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
172.67 ms
(-12.95%)Baseline: 198.37 ms
238.04 ms
(72.54%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,236.38 ms
(-1.61%)Baseline: 2,272.96 ms
2,727.55 ms
(81.99%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,277.18 ms
(-1.50%)Baseline: 4,342.45 ms
5,210.93 ms
(82.08%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
220.87 ms
(+0.00%)Baseline: 220.86 ms
265.03 ms
(83.34%)
isolated-linker.linked-workspace-resolve.hot-cache.offline📈 view plot
🚷 view threshold
172.95 ms
(-0.90%)Baseline: 174.52 ms
209.42 ms
(82.59%)
isolated-linker.peer-heavy-resolve.hot-cache.offline📈 view plot
🚷 view threshold
531.79 ms
(-3.98%)Baseline: 553.82 ms
664.58 ms
(80.02%)
isolated-linker.repeat-install.cold-cache.hot-store📈 view plot
🚷 view threshold
5.72 ms
(-12.87%)Baseline: 6.56 ms
7.87 ms
(72.61%)
isolated-linker.repeat-install.hot-cache.hot-store📈 view plot
🚷 view threshold
5.68 ms
(-18.77%)Baseline: 7.00 ms
8.39 ms
(67.69%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

github-actions Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/14942
Testbedpnpr

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds flag.

Click to view all benchmark results
BenchmarkLatencymilliseconds (ms)
gvs-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
128.26 ms
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,373.34 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
235.22 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
242.11 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
84.87 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,281.38 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
3,365.99 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
241.65 ms
isolated-linker.repeat-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
6.06 ms
isolated-linker.repeat-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
5.79 ms
🐰 View full continuous benchmarking report in Bencher

Generated deploy lockfiles now carry definitive bin metadata for workspace directory resolutions.

This keeps binless workspaces on the metadata fast path.

Legacy rows without the field retain conservative probing.

Restore the cross-version rationale on the implicit bin metadata regression test.
@zkochan

zkochan commented Sep 16, 2026

Copy link
Copy Markdown
Member Author

Addressed the performance finding in commit 839f62d. Newly generated deploy lockfiles now record definitive hasBin: true or hasBin: false metadata for workspace directory rows using manifests that are already loaded, so binless workspace packages remain on the no-I/O fast path. The conservative manifest probe remains only for older lockfiles where directory metadata is absent. The regression test covers both metadata values and both deploy modes.


Written by an agent (Codex, GPT-5.6).

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 839f62d

@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 merged commit d515d47 into main Sep 16, 2026
55 checks passed
@zkochan
zkochan deleted the fix-14899 branch September 16, 2026 08:38
u9g pushed a commit to u9g/pnpm that referenced this pull request Sep 25, 2026
Deploy-generated directory resolutions omitted `hasBin` from their lockfile metadata, so the precomputed has-bin set dropped every workspace dependency slot and the deployed project's `node_modules/.bin` directory came out empty.

Record definitive bin metadata when generating workspace directory rows. Probe directory resolutions whose metadata is absent for compatibility with older lockfiles while continuing to skip resolutions explicitly marked `hasBin: false`.

Closes pnpm#14899
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product: pacquet reviewed: coderabbit CodeRabbit submitted an approving review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pnpm deploy can omit workspace dependency bins in pnpm 12

2 participants