Skip to content

fix(lockfile): omit empty bundled dependencies - #13148

Merged
zkochan merged 3 commits into
pnpm:mainfrom
zhangli091011:fix/issue-13123-empty-bundled-deps
Jul 30, 2026
Merged

zkochan merged 3 commits into
pnpm:mainfrom
zhangli091011:fix/issue-13123-empty-bundled-deps

Conversation

@zhangli091011

@zhangli091011 zhangli091011 commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Treat empty bundledDependencies and bundleDependencies arrays as absent when generating package lockfile entries.

Tarball-derived manifests can retain an empty array while registry metadata omits the field. Serializing that array made the resulting lockfile depend on which manifest source was used. Nonempty arrays and true remain preserved, bundledDependencies keeps precedence when meaningful, and an empty preferred value can fall back to meaningful bundleDependencies.

Pacquet is updated to match: BundledDependencies::from_manifest previously recorded an empty list (deliberately mirroring the old TypeScript gate); it now skips empty lists and falls through to the legacy spelling, and the changeset targets pacquet as well.

Closes #13123.

Squash Commit Body

Tarball manifests can contain an empty bundledDependencies array while registry
metadata for the same package omits the field. Treat empty arrays as absent so
lockfile generation does not depend on the manifest source used during
resolution.

Preserve nonempty arrays and true for both field spellings. Continue preferring
bundledDependencies when meaningful, but allow an empty value to fall back to
a meaningful bundleDependencies value.

Mirror the change in pacquet: BundledDependencies::from_manifest no longer
records an empty list and falls through to the legacy spelling instead.

Closes pnpm/pnpm#13123.

Checklist

  • The change is implemented in both the TypeScript CLI and the Rust pnpm/ port, or the description notes what still needs porting.
  • Added a changeset (pnpm changeset) if this PR changes any published package.
  • Added or updated tests.

Verification

  • Focused resolver test: 14 passed
  • Resolver TypeScript build and ESLint
  • Changeset validation
  • Full pre-push TypeScript compile, pnpm bundle, cspell, metadata validation, and ESLint
  • Rust: cargo test -p pacquet-lockfile (including the new empty-list tests), cargo fmt --check, clippy, and the workspace dylint pass

AI disclosure

OpenCode using myself/gpt-5.6-sol assisted with issue investigation, implementation, and test preparation. I reviewed the source changes, parity behavior, and verification results.


Written by an agent (OpenCode, myself/gpt-5.6-sol).
Pacquet parity commit and description update by an agent (Claude Code, claude-fable-5).

Summary by CodeRabbit

  • Bug Fixes

    • Prevented empty bundled dependency lists from being unnecessarily written to lockfiles.
    • Improved lockfile consistency by avoiding nondeterministic updates for packages without bundled dependencies.
  • Tests

    • Added coverage for bundled dependency metadata, including supported aliases and value formats.

@zhangli091011
zhangli091011 requested a review from zkochan as a code owner July 19, 2026 15:55
@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 →

@coderabbitai

coderabbitai Bot commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

Review 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: Pro Plus

Run ID: 6e5ffbd9-4013-4111-b21f-9dee9d0a43a9

📥 Commits

Reviewing files that changed from the base of the PR and between 0604c29 and 0892552.

📒 Files selected for processing (1)
  • .changeset/normalize-empty-bundled-dependencies.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • .changeset/normalize-empty-bundled-dependencies.md

📝 Walkthrough

Walkthrough

Lockfile rebuilding now omits empty bundled dependency arrays while preserving true and non-empty arrays. Tests cover both bundled dependency field names and mixed metadata shapes, and a patch changeset documents the fix.

Changes

Bundled dependency normalization

Layer / File(s) Summary
Lockfile serialization
pnpm11/installing/deps-resolver/src/updateLockfile.ts
bundledDependencies is emitted only when the value is true or a non-empty array.
Parameterized validation and release metadata
pnpm11/installing/deps-resolver/test/updateLockfile.test.ts, .changeset/normalize-empty-bundled-dependencies.md
Tests pass bundled dependency metadata through the graph and verify normalized lockfile output for field, alias, boolean, array, and mixed inputs; the changeset declares patch updates.

Estimated code review effort: 2 (Simple) | ~10 minutes

Assessment against linked issues

Objective Addressed Explanation
Normalize empty bundledDependencies arrays to prevent nondeterministic lockfile entries [#13123] ✅
Preserve true and non-empty bundled dependency arrays while supporting the bundleDependencies alias [#13123] ✅

Possibly related PRs

  • pnpm/pnpm#13154: Directly overlaps the lockfile serialization change and its Jest coverage.
  • pnpm/pnpm#13406: Modifies handling of bundled dependency fields and boolean/list forms in lockfiles.

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

Suggested reviewers: zkochan

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@greptile-apps

greptile-apps Bot commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

Safe to merge — the change is a narrow, well-guarded filter that only removes empty arrays from the lockfile output; existing nonempty arrays, true, and absent fields are all unaffected.

Both the TypeScript and Rust implementations apply the same minimal guard (length > 0 / !is_empty()), the fallback precedence logic is preserved, and the new test matrix covers every meaningful combination of the two field spellings including the empty-array fall-through case that motivated the fix.

Files Needing Attention: No files require special attention.

Reviews (2): Last reviewed commit: "fix(pacquet): drop empty bundled-depende..." | Re-trigger Greptile

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Jul 19, 2026
@zhangli091011

Copy link
Copy Markdown
Contributor Author

@zkochan CI is fully green and CodeRabbit approved with no actionable findings, but Qodo reports that reviews are paused because this contributor account has no paid Teams seat: #13148 (comment). Since this is an account-level gate rather than a code issue, could the Qodo approval requirement be waived or replaced with manual review for this PR?

zhangli091011 and others added 3 commits July 30, 2026 10:58
…adata

The TypeScript CLI now omits empty bundledDependencies arrays from lockfile
package entries, so pacquet must stop recording them. An empty list under the
preferred spelling falls through to a meaningful legacy bundleDependencies
value, matching the TypeScript semantics.

Also add pacquet to the changeset, since this is a parity change.

Co-Authored-By: Claude Fable 5 <[email protected]>
@zkochan
zkochan force-pushed the fix/issue-13123-empty-bundled-deps branch from 0604c29 to 0892552 Compare July 30, 2026 09:08
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.86%. Comparing base (0f1c467) to head (0892552).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #13148   +/-   ##
=======================================
  Coverage   87.86%   87.86%           
=======================================
  Files         549      549           
  Lines       96091    96092    +1     
=======================================
+ Hits        84429    84432    +3     
+ Misses      11662    11660    -2     

☔ 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.

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (1) 📜 Skill insights (0)

Context used
✅ Compliance rules (platform): 24 rules

Grey Divider


Action required

1. Bundling flag still true 🐞 Bug ☼ Reliability
Description
After this PR, updateLockfile() omits empty bundledDependencies/bundleDependencies arrays from the
lockfile snapshot, but ResolvedPackage.hasBundledDependencies is still computed as true when the
manifest contains an empty array. This makes bundled-bin linking differ between a fresh resolve
(graph-driven) and a lockfile-driven reinstall, and can add unnecessary filesystem work scanning
<pkg>/node_modules for packages that bundle nothing.
Code

pnpm11/installing/deps-resolver/src/updateLockfile.ts[R152-161]

  if (
-    Array.isArray(pkg.additionalInfo.bundledDependencies) ||
+    (Array.isArray(pkg.additionalInfo.bundledDependencies) && pkg.additionalInfo.bundledDependencies.length > 0) ||
    pkg.additionalInfo.bundledDependencies === true
  ) {
    result['bundledDependencies'] = pkg.additionalInfo.bundledDependencies
  } else if (
-    Array.isArray(pkg.additionalInfo.bundleDependencies) ||
+    (Array.isArray(pkg.additionalInfo.bundleDependencies) && pkg.additionalInfo.bundleDependencies.length > 0) ||
    pkg.additionalInfo.bundleDependencies === true
  ) {
    result['bundledDependencies'] = pkg.additionalInfo.bundleDependencies
Relevance

●●● Strong

Matches PR goal: treat empty arrays as absent to avoid lockfile/graph reinstall drift.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The PR changes lockfile snapshot emission to skip empty arrays, but the resolver still treats []
as present (nullish check), while lockfile-driven graphs derive the flag from the snapshot field’s
presence; both fresh-install and reinstall paths use that flag to decide whether to link bundled
bins from <pkg>/node_modules.

pnpm11/installing/deps-resolver/src/updateLockfile.ts[152-162]
pnpm11/installing/deps-resolver/src/resolveDependencies.ts[2379-2397]
pnpm11/deps/graph-builder/src/lockfileToDepGraph.ts[315-326]
pnpm11/building/during-install/src/index.ts[380-388]

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

## Issue description
`updateLockfile.ts` now treats empty `bundledDependencies`/`bundleDependencies` arrays as absent when serializing a `PackageSnapshot`, but `resolveDependencies.ts` still sets `hasBundledDependencies` based on nullish presence (`??`) which treats `[]` as meaningful. This creates inconsistent behavior: the initial install (using the resolver graph) may attempt bundled-bin linking, while a reinstall from the generated lockfile will not.

## Issue Context
- The lockfile-driven dep graph sets `hasBundledDependencies` from `pkgSnapshot.bundledDependencies != null`, so omitting the field changes later behavior.
- `hasBundledDependencies` gates extra bin-linking work (`linkBins(<pkg>/node_modules, ...)`).

## Fix Focus Areas
- pnpm11/installing/deps-resolver/src/resolveDependencies.ts[2380-2407]
- pnpm11/installing/deps-resolver/src/updateLockfile.ts[152-162]

## What to change
1. Update `ResolvedPackage.hasBundledDependencies` computation in `resolveDependencies.ts` to match the new lockfile semantics:
  - Treat `bundledDependencies: []` and `bundleDependencies: []` as absent.
  - Preserve `true` and non-empty arrays.
  - Keep precedence: prefer `bundledDependencies` when meaningful, but if it is `false`/`[]`/other non-meaningful, fall through to `bundleDependencies`.

  Example shape:
  ```ts
  const preferred = options.pkg.bundledDependencies
  const legacy = options.pkg.bundleDependencies
  const preferredMeaningful = (Array.isArray(preferred) ? preferred.length > 0 : preferred === true)
  const legacyMeaningful = (Array.isArray(legacy) ? legacy.length > 0 : legacy === true)
  hasBundledDependencies: preferredMeaningful || (!preferredMeaningful && legacyMeaningful)
  ```
2. (Optional) Consider extracting a small helper used by both `hasBundledDependencies` and `toLockfileDependency()` to avoid future drift.

## Tests
Add/extend a test that demonstrates a package with `bundledDependencies: []` does **not** set `hasBundledDependencies` in the resolved graph (or does not take the bundled-bin linking branch), matching the lockfile-driven behavior.

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



Informational

2. Missing trailing comma in params 📘 Rule violation ⚙ Maintainability
Description
The multi-line parameter list for tarballGraph() is missing a trailing comma after the last
parameter. This violates the TypeScript trailing-comma requirement for multi-line constructs.
Code

pnpm11/installing/deps-resolver/test/updateLockfile.test.ts[R15-21]

+function tarballGraph (
+  resolution: { tarball: string, integrity?: string },
+  additionalInfo: {
+    bundledDependencies?: readonly string[] | boolean
+    bundleDependencies?: readonly string[] | boolean
+  } = {}
+): DependenciesGraph {
Relevance

● Weak

Trailing-comma multi-line TS signature nit has a direct rejection precedent.

PR-#13387

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713434 requires trailing commas for multi-line TypeScript constructs. In the
tarballGraph signature, the last parameter additionalInfo ... = {} (line 20) is on its own line
but is not followed by a trailing comma.

Rule 713434: Require trailing commas in TypeScript collections and multi-line constructs
pnpm11/installing/deps-resolver/test/updateLockfile.test.ts[15-21]

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 multi-line parameter list in `tarballGraph()` omits the trailing comma after the last parameter, which violates the trailing-comma rule for TypeScript multi-line constructs.

## Issue Context
This repo requires trailing commas in multi-line parameter/argument lists to keep diffs stable.

## Fix Focus Areas
- pnpm11/installing/deps-resolver/test/updateLockfile.test.ts[15-21]

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


3. Non-string arrays still bundle 🐞 Bug ⛨ Security
Description
BundledDependencies::from_manifest now claims it records only a nonempty list, but it only checks
that the JSON array is nonempty, not that any string names were parsed. An attacker-controlled
manifest like {"bundledDependencies":[null]} becomes Names([]), which is still treated as “bundled”
because downstream Rust code keys bundling/bin-linking off bundled_dependencies.is_some().
Code

pnpm/crates/lockfile/src/package_metadata.rs[R77-87]

        ["bundledDependencies", "bundleDependencies"].into_iter().find_map(|key| {
            match manifest?.get(key)? {
-                serde_json::Value::Array(items) => Some(BundledDependencies::Names(
-                    items
-                        .iter()
-                        .filter_map(serde_json::Value::as_str)
-                        .map(ToString::to_string)
-                        .collect(),
-                )),
+                serde_json::Value::Array(items) if !items.is_empty() => {
+                    Some(BundledDependencies::Names(
+                        items
+                            .iter()
+                            .filter_map(serde_json::Value::as_str)
+                            .map(ToString::to_string)
+                            .collect(),
+                    ))
+                }
Relevance

● Weak

Close rejection precedent: team rejected dropping array→None when it parses to zero string names
(e.g. [123]).

PR-#13406

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new parser branch only checks items.is_empty() and then filters to strings, so a nonempty
array with no strings yields an empty Vec but still returns Some(Names(empty)). Rust
bin-linking/bundling classification uses bundled_dependencies.is_some() as the signal, so
Some(Names([])) is enough to flip behavior.

pnpm/crates/lockfile/src/package_metadata.rs[67-92]
pnpm/crates/package-manager/src/link_bins.rs[440-457]
pnpm/crates/package-manager/src/hoisted_dep_graph.rs[651-658]
PR-#13346

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

## Issue description
`BundledDependencies::from_manifest` was updated to ignore `[]`, but it still returns `Some(Names(vec![]))` when the array is nonempty yet contains no strings (e.g. `[null]`, `[{}]`). Downstream code treats `bundled_dependencies.is_some()` as the bundling/bin-linking signal, so this malformed input can wrongly trigger bundled-bin linking and extra filesystem work.

## Issue Context
- Manifests/metadata are attacker-controlled inputs per repo security rules.
- Rust linker code uses the **presence** of `bundledDependencies` in lockfile metadata as the bundling signal.

## Fix Focus Areas
- pnpm/crates/lockfile/src/package_metadata.rs[67-92]

## What to change
1. In the `Value::Array(items)` arm, collect parsed string names first, filtering out non-strings (and ideally empty strings).
2. Only return `Some(BundledDependencies::Names(names))` if `names` is nonempty; otherwise return `None` so `find_map` can fall through to the legacy key or to `None`.

Example:
```rust
serde_json::Value::Array(items) => {
 let names: Vec<String> = items
   .iter()
   .filter_map(serde_json::Value::as_str)
   .filter(|s| !s.is_empty())
   .map(ToString::to_string)
   .collect();
 (!names.is_empty()).then_some(BundledDependencies::Names(names))
}
```
(keep the existing precedence/fall-through behavior).

## Tests
Add a regression test in `pnpm/crates/lockfile/src/package_metadata/tests.rs` that asserts:
- `{ "bundledDependencies": [null] }` → `None`
- `{ "bundledDependencies": [null], "bundleDependencies": ["a"] }` → falls through to `Names(["a"])`.

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


Grey Divider

ⓘ  1 issues published inline · 3 in summary

To customize comments, go to the Qodo configuration screen, or learn more in the docs.

Qodo Logo

Comment on lines 152 to 161
if (
Array.isArray(pkg.additionalInfo.bundledDependencies) ||
(Array.isArray(pkg.additionalInfo.bundledDependencies) && pkg.additionalInfo.bundledDependencies.length > 0) ||
pkg.additionalInfo.bundledDependencies === true
) {
result['bundledDependencies'] = pkg.additionalInfo.bundledDependencies
} else if (
Array.isArray(pkg.additionalInfo.bundleDependencies) ||
(Array.isArray(pkg.additionalInfo.bundleDependencies) && pkg.additionalInfo.bundleDependencies.length > 0) ||
pkg.additionalInfo.bundleDependencies === true
) {
result['bundledDependencies'] = pkg.additionalInfo.bundleDependencies

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

2. Bundling flag still true 🐞 Bug ☼ Reliability

After this PR, updateLockfile() omits empty bundledDependencies/bundleDependencies arrays from the
lockfile snapshot, but ResolvedPackage.hasBundledDependencies is still computed as true when the
manifest contains an empty array. This makes bundled-bin linking differ between a fresh resolve
(graph-driven) and a lockfile-driven reinstall, and can add unnecessary filesystem work scanning
<pkg>/node_modules for packages that bundle nothing.
Agent Prompt
## Issue description
`updateLockfile.ts` now treats empty `bundledDependencies`/`bundleDependencies` arrays as absent when serializing a `PackageSnapshot`, but `resolveDependencies.ts` still sets `hasBundledDependencies` based on nullish presence (`??`) which treats `[]` as meaningful. This creates inconsistent behavior: the initial install (using the resolver graph) may attempt bundled-bin linking, while a reinstall from the generated lockfile will not.

## Issue Context
- The lockfile-driven dep graph sets `hasBundledDependencies` from `pkgSnapshot.bundledDependencies != null`, so omitting the field changes later behavior.
- `hasBundledDependencies` gates extra bin-linking work (`linkBins(<pkg>/node_modules, ...)`).

## Fix Focus Areas
- pnpm11/installing/deps-resolver/src/resolveDependencies.ts[2380-2407]
- pnpm11/installing/deps-resolver/src/updateLockfile.ts[152-162]

## What to change
1. Update `ResolvedPackage.hasBundledDependencies` computation in `resolveDependencies.ts` to match the new lockfile semantics:
   - Treat `bundledDependencies: []` and `bundleDependencies: []` as absent.
   - Preserve `true` and non-empty arrays.
   - Keep precedence: prefer `bundledDependencies` when meaningful, but if it is `false`/`[]`/other non-meaningful, fall through to `bundleDependencies`.

   Example shape:
   ```ts
   const preferred = options.pkg.bundledDependencies
   const legacy = options.pkg.bundleDependencies
   const preferredMeaningful = (Array.isArray(preferred) ? preferred.length > 0 : preferred === true)
   const legacyMeaningful = (Array.isArray(legacy) ? legacy.length > 0 : legacy === true)
   hasBundledDependencies: preferredMeaningful || (!preferredMeaningful && legacyMeaningful)
   ```
2. (Optional) Consider extracting a small helper used by both `hasBundledDependencies` and `toLockfileDependency()` to avoid future drift.

## Tests
Add/extend a test that demonstrates a package with `bundledDependencies: []` does **not** set `hasBundledDependencies` in the resolved graph (or does not take the bundled-bin linking branch), matching the lockfile-driven behavior.

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

@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

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: 08925523c411

Each scenario reports direct installs and pnpr installs. 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.440 ± 0.128 2.356 2.774 1.52 ± 0.14
pacquet@main 2.659 ± 0.188 2.389 2.929 1.66 ± 0.18
pnpr@HEAD 1.604 ± 0.128 1.411 1.800 1.00
pnpr@main 1.669 ± 0.168 1.484 1.926 1.04 ± 0.13
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.4396314302000004,
      "stddev": 0.12831472187059517,
      "median": 2.388087127,
      "user": 1.65188216,
      "system": 1.31858054,
      "min": 2.356220086,
      "max": 2.773984006,
      "times": [
        2.356220086,
        2.373027678,
        2.386803498,
        2.773984006,
        2.389370756,
        2.358275081,
        2.366406885,
        2.476284043,
        2.511277488,
        2.404664781
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.659390636,
      "stddev": 0.18833320221938543,
      "median": 2.6088833055,
      "user": 1.9453994599999997,
      "system": 1.50390174,
      "min": 2.388648728,
      "max": 2.9291942950000003,
      "times": [
        2.804629674,
        2.485129449,
        2.388648728,
        2.9291942950000003,
        2.847451734,
        2.609361425,
        2.608405186,
        2.598413964,
        2.8581517080000003,
        2.464520197
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.6044862255,
      "stddev": 0.1276065269433619,
      "median": 1.5963622415,
      "user": 1.3967140600000003,
      "system": 1.50539024,
      "min": 1.410562731,
      "max": 1.799879603,
      "times": [
        1.5747869680000002,
        1.577393039,
        1.773406301,
        1.6153314440000002,
        1.656539312,
        1.799879603,
        1.667147913,
        1.410562731,
        1.433604095,
        1.5362108490000002
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.6689720651000002,
      "stddev": 0.16837852502079564,
      "median": 1.5970537565,
      "user": 1.59641846,
      "system": 1.6540153399999997,
      "min": 1.4837734980000001,
      "max": 1.925953472,
      "times": [
        1.803670022,
        1.860466219,
        1.6054566700000001,
        1.4854188640000001,
        1.587225342,
        1.5178873780000002,
        1.4837734980000001,
        1.8312183430000002,
        1.925953472,
        1.588650843
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 294.8 ± 13.7 271.1 309.4 1.01 ± 0.07
pacquet@main 291.1 ± 16.2 266.5 317.7 1.00
pnpr@HEAD 330.7 ± 31.0 266.6 371.0 1.14 ± 0.12
pnpr@main 338.3 ± 33.2 296.1 408.7 1.16 ± 0.13
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.29480888018000007,
      "stddev": 0.013721696982156511,
      "median": 0.29938324888,
      "user": 0.24679083999999998,
      "system": 0.57267914,
      "min": 0.27112021988000007,
      "max": 0.30936196088000006,
      "times": [
        0.30897817988000004,
        0.28273021488000005,
        0.27583128988000005,
        0.30936196088000006,
        0.29389217788000005,
        0.30514261588,
        0.29717776588000006,
        0.27112021988000007,
        0.30158873188,
        0.30226564488
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.29114301978000007,
      "stddev": 0.016237950139538933,
      "median": 0.28972027988000004,
      "user": 0.25237923999999995,
      "system": 0.57677284,
      "min": 0.26650079188000003,
      "max": 0.31772917788000005,
      "times": [
        0.28359340888000006,
        0.28270186188,
        0.26650079188000003,
        0.29245414288000005,
        0.28908261188000006,
        0.31037769188000003,
        0.31772917788000005,
        0.30586165888000005,
        0.27277090388,
        0.29035794788
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.3306660948800001,
      "stddev": 0.03095140427189125,
      "median": 0.33691645288000005,
      "user": 0.26195714,
      "system": 0.64723574,
      "min": 0.26656148288000003,
      "max": 0.37096413188000005,
      "times": [
        0.31054530988000006,
        0.33382180888000007,
        0.37096413188000005,
        0.35132795788000004,
        0.34001109688000003,
        0.32382671388000006,
        0.26656148288000003,
        0.35792296888,
        0.34953809188000007,
        0.30214138588000006
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.33832831288,
      "stddev": 0.03324621077400953,
      "median": 0.33292467688000005,
      "user": 0.26931554,
      "system": 0.6316200399999999,
      "min": 0.29612077688000005,
      "max": 0.40873069788000005,
      "times": [
        0.40873069788000005,
        0.32563964288,
        0.34393116788000005,
        0.34020971088000007,
        0.31196368588000006,
        0.30972923488000004,
        0.29612077688000005,
        0.32380441188000003,
        0.35135557988000005,
        0.37179821988000006
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.866 ± 0.125 2.713 3.056 1.70 ± 0.17
pacquet@main 2.726 ± 0.028 2.677 2.757 1.62 ± 0.14
pnpr@HEAD 1.693 ± 0.168 1.502 1.936 1.00 ± 0.13
pnpr@main 1.687 ± 0.147 1.516 1.861 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.8664833353200003,
      "stddev": 0.12526197183382454,
      "median": 2.85405465822,
      "user": 2.2222833799999995,
      "system": 1.8224166,
      "min": 2.7126466652200003,
      "max": 3.0561536362200004,
      "times": [
        3.0011315022200002,
        2.9551224462200003,
        2.97920626322,
        2.7665029052200003,
        2.72941755122,
        2.7126466652200003,
        2.8832274942200002,
        3.0561536362200004,
        2.7565430672200004,
        2.82488182222
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.7263078868200004,
      "stddev": 0.02804907231676148,
      "median": 2.7335228777200005,
      "user": 1.8887788799999998,
      "system": 1.5266420999999997,
      "min": 2.67742905322,
      "max": 2.75711810622,
      "times": [
        2.7423423922200003,
        2.67742905322,
        2.7470150182200004,
        2.72529051922,
        2.7559205442200003,
        2.72656127722,
        2.70154681222,
        2.75711810622,
        2.68937066722,
        2.7404844782200004
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.69318208412,
      "stddev": 0.16781406690585432,
      "median": 1.6910219527199999,
      "user": 1.4006012799999998,
      "system": 1.5138009000000001,
      "min": 1.50244418822,
      "max": 1.93577411322,
      "times": [
        1.77881459622,
        1.90867773322,
        1.52827166122,
        1.52700662422,
        1.93577411322,
        1.84132985622,
        1.68054182122,
        1.52745816322,
        1.50244418822,
        1.70150208422
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.6868725692200002,
      "stddev": 0.14660754210342392,
      "median": 1.6842866062200001,
      "user": 1.27891458,
      "system": 1.4590174,
      "min": 1.5156680682199999,
      "max": 1.86062102222,
      "times": [
        1.86062102222,
        1.8461926412199998,
        1.60095543422,
        1.56253716622,
        1.54523064422,
        1.5156680682199999,
        1.83727839122,
        1.76761777822,
        1.79986173622,
        1.53276281022
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 593.9 ± 60.5 508.9 693.6 1.80 ± 0.21
pacquet@main 489.8 ± 27.1 449.0 532.1 1.49 ± 0.12
pnpr@HEAD 329.8 ± 18.3 310.0 366.7 1.00
pnpr@main 343.1 ± 27.5 315.2 385.3 1.04 ± 0.10
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.59391414674,
      "stddev": 0.06045073778561396,
      "median": 0.58103395834,
      "user": 0.7708566599999999,
      "system": 0.87158292,
      "min": 0.50886570484,
      "max": 0.69363177084,
      "times": [
        0.54085321084,
        0.50886570484,
        0.5431966178400001,
        0.61823137584,
        0.58659667284,
        0.69363177084,
        0.6713829868400001,
        0.64077980284,
        0.57547124384,
        0.56013208084
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.48984274154000007,
      "stddev": 0.027084536265094092,
      "median": 0.48488260484,
      "user": 0.67141296,
      "system": 0.73641512,
      "min": 0.44901385684,
      "max": 0.5320594658400001,
      "times": [
        0.51444739084,
        0.48427744184000004,
        0.5151471158400001,
        0.45886972784,
        0.48548776784000003,
        0.50918210984,
        0.44901385684,
        0.46858375384,
        0.5320594658400001,
        0.48135878484
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.32977105184,
      "stddev": 0.018297114332125972,
      "median": 0.32669052634000006,
      "user": 0.21985936,
      "system": 0.5567595200000001,
      "min": 0.31003335184,
      "max": 0.36668405084,
      "times": [
        0.36668405084,
        0.33110323884000004,
        0.32211238284,
        0.31504557584000004,
        0.31003335184,
        0.32626574284000004,
        0.32711530984000003,
        0.31351050884000004,
        0.32961417984,
        0.35622617684
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.34314990134,
      "stddev": 0.02746372148466485,
      "median": 0.33797615384,
      "user": 0.24203926,
      "system": 0.5833727200000001,
      "min": 0.31521316384000003,
      "max": 0.38528269884,
      "times": [
        0.35331037484,
        0.35581560584,
        0.32253117484,
        0.31814524784000003,
        0.31537596884,
        0.32264193284000003,
        0.31521316384000003,
        0.36421437084,
        0.38528269884,
        0.37896847484
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.970 ± 0.082 1.886 2.124 5.05 ± 0.37
pacquet@main 1.950 ± 0.078 1.838 2.119 4.99 ± 0.37
pnpr@HEAD 0.414 ± 0.045 0.351 0.496 1.06 ± 0.13
pnpr@main 0.390 ± 0.024 0.352 0.428 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.97009143376,
      "stddev": 0.08215081867450022,
      "median": 1.94952791476,
      "user": 1.135218,
      "system": 0.9805834600000001,
      "min": 1.88632102426,
      "max": 2.12415069126,
      "times": [
        1.9606359222599998,
        1.9384199072600001,
        2.00697441226,
        2.12415069126,
        2.04550020926,
        1.89037749126,
        1.88632102426,
        2.04569076726,
        1.91459732726,
        1.88824658526
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.9500440388600002,
      "stddev": 0.07840111968961877,
      "median": 1.94254502726,
      "user": 1.1334755,
      "system": 0.94412006,
      "min": 1.83825767126,
      "max": 2.11885156626,
      "times": [
        1.95911902126,
        1.8970470342599999,
        1.90155062326,
        1.93543631426,
        1.96662606826,
        1.83825767126,
        1.94965374026,
        2.03029634826,
        2.11885156626,
        1.90360200126
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.41362051456,
      "stddev": 0.044781851033940764,
      "median": 0.39913867626,
      "user": 0.30605199999999994,
      "system": 0.6818250599999999,
      "min": 0.35061472726,
      "max": 0.49647736926,
      "times": [
        0.44774020226,
        0.39081565926,
        0.40482020626000004,
        0.49647736926,
        0.44435093826,
        0.39345714626,
        0.35061472726,
        0.45256504726,
        0.37849390726,
        0.37686994226000003
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.39044292516000006,
      "stddev": 0.023874496428603693,
      "median": 0.39264025526,
      "user": 0.2761637,
      "system": 0.6574110599999999,
      "min": 0.35196027626,
      "max": 0.42811419326,
      "times": [
        0.42811419326,
        0.39011664426000003,
        0.40466754926000004,
        0.39516386626,
        0.36746296126,
        0.35196027626,
        0.41148007126,
        0.40427124526,
        0.36141101926,
        0.38978142526000004
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 310.0 ± 39.3 273.7 412.1 3.15 ± 0.52
pacquet@main 285.5 ± 40.2 240.0 373.5 2.90 ± 0.51
pnpr@HEAD 105.1 ± 9.8 94.9 135.9 1.07 ± 0.15
pnpr@main 98.5 ± 10.7 88.1 140.6 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.30999172742000003,
      "stddev": 0.03934751225550144,
      "median": 0.30053074732000007,
      "user": 0.3107559999999999,
      "system": 0.09111240000000001,
      "min": 0.27368702432,
      "max": 0.41206722432000004,
      "times": [
        0.32470423732000003,
        0.29849416732000006,
        0.41206722432000004,
        0.28698631432000005,
        0.27368702432,
        0.32227346632000003,
        0.28264591232,
        0.30491704632000005,
        0.29157455432,
        0.30256732732
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.28548461932,
      "stddev": 0.040179311411015085,
      "median": 0.27390488332,
      "user": 0.2856495545454545,
      "system": 0.07744740909090908,
      "min": 0.24000167432,
      "max": 0.37346867532000005,
      "times": [
        0.26445903032,
        0.37346867532000005,
        0.27390488332,
        0.27124515232,
        0.32833897332000006,
        0.27852408132000006,
        0.30080006432000006,
        0.31167405332000003,
        0.24259163632,
        0.24000167432,
        0.25532258832000004
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.10510292275333334,
      "stddev": 0.00976620993196107,
      "median": 0.10205332632000001,
      "user": 0.029815899999999996,
      "system": 0.015913833333333335,
      "min": 0.09492912832000001,
      "max": 0.13587447232,
      "times": [
        0.09517372732000001,
        0.09492912832000001,
        0.10630613532000001,
        0.10027952032000001,
        0.11518475232000001,
        0.12120403232000002,
        0.11677769832000001,
        0.11558788932000001,
        0.11786217632000001,
        0.09921847432000001,
        0.10217927332000001,
        0.09640798932000001,
        0.10579807832000002,
        0.11135966832000001,
        0.11863576232000002,
        0.09825573532000001,
        0.10157130032000002,
        0.09846649132000002,
        0.10284819232000002,
        0.09996334632000001,
        0.10374969732000001,
        0.10416716232,
        0.13587447232,
        0.10338352832000001,
        0.09973806332000001,
        0.09739407432000001,
        0.09494453732000001,
        0.10192737932000001,
        0.09524263832000002,
        0.09865675832000001
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.09852282507862069,
      "stddev": 0.010651745916152977,
      "median": 0.09479854332000001,
      "user": 0.0266542724137931,
      "system": 0.013194293103448274,
      "min": 0.08812705632000001,
      "max": 0.14056005232,
      "times": [
        0.09737084032000001,
        0.11048150632,
        0.09395003732000001,
        0.09479854332000001,
        0.08812705632000001,
        0.09380007432000001,
        0.10975628332000001,
        0.09967258032000001,
        0.09707614732000001,
        0.09093807332,
        0.09375811632000002,
        0.08948572032000002,
        0.09361060932000001,
        0.09229771032000002,
        0.08979453332000001,
        0.09244530832000002,
        0.09191042232000002,
        0.09118770332000001,
        0.09621705032000001,
        0.10561562532000002,
        0.11005051632000001,
        0.09830593932000001,
        0.09289631632,
        0.09715572632000001,
        0.09901250832000001,
        0.11539388532000001,
        0.14056005232,
        0.09828031032000001,
        0.09321273132
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.843 ± 0.177 4.584 5.179 1.31 ± 0.06
pacquet@main 4.739 ± 0.120 4.595 4.916 1.28 ± 0.05
pnpr@HEAD 3.701 ± 0.094 3.556 3.834 1.00
pnpr@main 3.737 ± 0.210 3.532 4.129 1.01 ± 0.06
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.842925590519999,
      "stddev": 0.1769261285094337,
      "median": 4.840663580919999,
      "user": 2.8063781800000003,
      "system": 2.0432010199999997,
      "min": 4.58409891892,
      "max": 5.17853580992,
      "times": [
        4.805906998919999,
        5.17853580992,
        5.02769162192,
        4.68986293292,
        4.92294792692,
        4.86346198892,
        4.8178651729199995,
        4.8810447969199995,
        4.58409891892,
        4.65783973692
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.7388286958200005,
      "stddev": 0.1200540909206714,
      "median": 4.72109508492,
      "user": 2.5458953799999997,
      "system": 1.89406042,
      "min": 4.5945675569199995,
      "max": 4.9159462959199995,
      "times": [
        4.896533186919999,
        4.68458305392,
        4.642680587919999,
        4.5945675569199995,
        4.81675337792,
        4.616365099919999,
        4.828968017919999,
        4.9159462959199995,
        4.75760711592,
        4.63428266492
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.7012576040200003,
      "stddev": 0.09432916417385533,
      "median": 3.71795951842,
      "user": 1.78031418,
      "system": 1.7079645199999998,
      "min": 3.55580797292,
      "max": 3.83361274992,
      "times": [
        3.83361274992,
        3.59034657792,
        3.5949319489200002,
        3.77073208492,
        3.80232460992,
        3.74435143592,
        3.71218654692,
        3.72373248992,
        3.68454962292,
        3.55580797292
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 3.73712412302,
      "stddev": 0.21019451676887363,
      "median": 3.63548532242,
      "user": 1.68514278,
      "system": 1.66493802,
      "min": 3.53172494292,
      "max": 4.12897408692,
      "times": [
        3.58045661592,
        3.61112608292,
        3.65984456192,
        3.9801445059200002,
        4.12897408692,
        3.83580988892,
        3.56376314392,
        3.57140880292,
        3.53172494292,
        3.90798859792
      ]
    }
  ]
}

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13148
Testbedpacquet
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
milliseconds (ms)
(Result Δ%)
Upper Boundary
milliseconds (ms)
(Limit %)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
🚷 view threshold
2,712.65 ms
(-3.72%)Baseline: 2,817.60 ms
3,381.11 ms
(80.23%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
1,886.32 ms
(-3.73%)Baseline: 1,959.31 ms
2,351.17 ms
(80.23%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
508.87 ms
(-20.24%)Baseline: 638.02 ms
765.62 ms
(66.46%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
273.69 ms
(-28.55%)Baseline: 383.05 ms
459.66 ms
(59.54%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,356.22 ms
(-2.95%)Baseline: 2,427.85 ms
2,913.42 ms
(80.87%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,584.10 ms
(+1.41%)Baseline: 4,520.18 ms
5,424.22 ms
(84.51%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
271.12 ms
(-3.39%)Baseline: 280.64 ms
336.76 ms
(80.51%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13148
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)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,502.44 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
350.61 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
310.03 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
94.93 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,410.56 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
3,555.81 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
266.56 ms
🐰 View full continuous benchmarking report in Bencher

@zkochan
zkochan merged commit 2325c32 into pnpm:main Jul 30, 2026
37 checks passed
@welcome

welcome Bot commented Jul 30, 2026

Copy link
Copy Markdown

Congrats on merging your first pull request! 🎉🎉🎉

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.

bundledDependencies: [] nondeterministically added/removed in pnpm-lock.yaml (empty-array variant of #7576)

3 participants