Skip to content

fix(workspace): honor native discovery exclusions - #14846

Merged
zkochan merged 2 commits into
mainfrom
fix-14844
Sep 12, 2026
Merged

zkochan merged 2 commits into
mainfrom
fix-14844

Conversation

@zkochan

@zkochan zkochan commented Sep 11, 2026 •

Copy link
Copy Markdown
Member

Summary

Cargo and Python discovery now honor explicit ! exclusions in pnpm-workspace.yaml packages. Excluded directories are pruned before traversal, preventing invalid fixture manifests from failing installs and independent excluded workspaces from receiving generated files.

Positive npm package patterns continue to leave native discovery unrestricted, including packages: []. The workspace root remains eligible. The discovery boundary and its relationship to Cargo membership are documented.

Validation: just ready (11,123 tests passed; 13 skipped), plus targeted Cargo and workspace tests.

Closes #14844.

Squash Commit Body

Pass workspace package patterns into the shared native manifest inventory
and prune directories matching explicit negations before opening them.
Reuse directory-pattern normalization with npm workspace discovery.

Preserve discovery outside positive npm patterns: existing Cargo installs
support packages: [] and may live outside the npm package layout. Cargo
workspace.exclude still controls Cargo membership; pnpm package negations
provide the boundary for discovering independent native workspaces.

Add an offline CLI regression for invalid and valid excluded Cargo
workspaces, plus inventory coverage for Cargo/Python, normalized and glob
exclusions, root inclusion, and invalid patterns. The CLI regression fails
on the original implementation with the reported cargo metadata error.

This affects the Rust v12 CLI only. The TypeScript v11 CLI has no Cargo
or Python ecosystem install integration.

Closes pnpm/pnpm#14844.

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.
  • Updated the documentation if needed.

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


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • Bug Fixes

    • Native Cargo and Python project discovery now respects excluded directories defined in pnpm-workspace.yaml.
    • Excluded projects are skipped during installation and are no longer parsed or modified, preventing generated configuration and source files from being added.
    • Recursive exclusions are applied to matching directories and their contents.
    • Invalid exclusion patterns now report clear validation errors.
  • Documentation

    • Added guidance explaining native project discovery and exclusion behavior.

Prune explicit workspace package exclusions before scanning Cargo and Python manifests.
Preserve native discovery outside positive npm package patterns and share directory
pattern normalization.

Closes #14844
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Honor workspace exclusions during native manifest discovery

🐞 Bug fix 🧪 Tests 📝 Documentation 🕐 20-40 Minutes

Grey Divider

AI Description

• Prunes explicitly excluded directories before Cargo and Python manifest discovery.
• Preserves unrestricted native discovery for positive patterns, empty packages, and workspace root.
• Adds regression coverage, release notes, and discovery-boundary documentation.
Diagram

graph TD
    A["Workspace Config"] --> B["CLI Inventory"] --> C["Pattern Helpers"] --> D{"Excluded Path?"}
    D -- "Yes" --> E["Prune Directory"]
    D -- "No" --> F["Scan Manifests"] --> G["Cargo and Python"]
Loading
High-Level Assessment

The current approach is appropriate: it extends the existing shared native inventory and reuses npm discovery's normalization semantics while pruning before filesystem access. Restricting native discovery to positive npm patterns would break supported layouts, while relying only on Cargo workspace exclusions would not cover Python or independent Cargo workspaces.

Files changed (9) +258 / -24

Bug fix (2) +45 / -2
workspace_inventory.rsForward workspace package patterns to native inventory +9/-1

Forward workspace package patterns to native inventory

• Stores configured workspace package patterns in the cached ecosystem inventory and passes them into shared Cargo and Python manifest discovery.

pnpm/crates/cli/src/ecosystem_install/workspace_inventory.rs

inventory.rsPrune negated package directories during inventory traversal +36/-1

Prune negated package directories during inventory traversal

• Accepts package patterns, compiles explicit negations, and treats matching relative directories as ignored before traversal opens them. Invalid exclusions are surfaced through a transparent inventory error while positive patterns remain unrestricted.

pnpm/crates/workspace/src/inventory.rs

Refactor (3) +37 / -19
directory_patterns.rsShare normalized negated directory-pattern handling +28/-0

Share normalized negated directory-pattern handling

• Introduces reusable helpers that normalize directory patterns, identify supported negations, validate their globs, and preserve original patterns in errors.

pnpm/crates/workspace/src/directory_patterns.rs

lib.rsRegister shared directory-pattern module +1/-0

Register shared directory-pattern module

• Adds the internal directory-pattern module used by project and native inventory discovery.

pnpm/crates/workspace/src/lib.rs

projects.rsReuse shared workspace pattern normalization +8/-19

Reuse shared workspace pattern normalization

• Replaces local normalization and negation parsing with the shared helpers, retaining npm workspace discovery behavior while aligning validation semantics with native inventory discovery.

pnpm/crates/workspace/src/projects.rs

Tests (2) +148 / -3
cargo_install.rsCover excluded Cargo workspaces through offline install +56/-0

Cover excluded Cargo workspaces through offline install

• Adds an end-to-end regression proving invalid excluded manifests are not parsed and valid excluded workspaces receive no generated pnpm or Cargo files.

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

tests.rsTest native inventory exclusion semantics +92/-3

Test native inventory exclusion semantics

• Updates inventory calls for the new pattern argument and covers Cargo/Python pruning, normalized and glob exclusions, root inclusion, recursive base pruning, and invalid-pattern reporting.

pnpm/crates/workspace/src/inventory/tests.rs

Documentation (2) +28 / -0
fix-native-discovery-exclusions.mdAdd patch release note for native discovery exclusions +5/-0

Add patch release note for native discovery exclusions

• Adds a pacquet patch changeset explaining that excluded Cargo and Python projects are neither parsed nor modified.

.changeset/fix-native-discovery-exclusions.md

ECOSYSTEM_INSTALL.mdDocument native discovery boundaries and exclusions +23/-0

Document native discovery boundaries and exclusions

• Explains that explicit negations prune Cargo and Python discovery, while positive npm patterns and empty package lists do not constrain it. Clarifies root eligibility and the distinction between pnpm discovery exclusions and Cargo membership exclusions.

pnpm/plans/ECOSYSTEM_INSTALL.md

@coderabbitai

coderabbitai Bot commented Sep 11, 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: 2c0bbae9-4a04-4751-bb65-905b7033d0af

📥 Commits

Reviewing files that changed from the base of the PR and between 91830f0 and aad1848.

📒 Files selected for processing (1)
  • .changeset/fix-native-discovery-exclusions.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • .changeset/fix-native-discovery-exclusions.md

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


📝 Walkthrough

Walkthrough

Native Cargo and Python discovery now receives workspace package patterns, prunes directories matched by negated patterns before reading manifests, reports invalid patterns, and documents the behavior. Tests cover traversal and excluded Cargo workspaces.

Changes

Native discovery exclusions

Layer / File(s) Summary
Shared directory pattern handling
pnpm/crates/workspace/src/directory_patterns.rs, pnpm/crates/workspace/src/projects.rs, pnpm/crates/workspace/src/lib.rs
Directory normalization and negation parsing are centralized and reused by project discovery.
Inventory exclusion matching
pnpm/crates/workspace/src/inventory.rs, pnpm/crates/workspace/src/inventory/tests.rs
Inventory discovery compiles negated package patterns, prunes matching directories and descendants, and reports invalid patterns.
CLI integration and behavior validation
pnpm/crates/cli/src/ecosystem_install/workspace_inventory.rs, pnpm/crates/cli/tests/suite/cargo_install.rs, pnpm/plans/ECOSYSTEM_INSTALL.md, .changeset/fix-native-discovery-exclusions.md
The CLI passes workspace patterns into inventory discovery. Integration coverage verifies that excluded Cargo workspaces are not parsed or modified. Documentation and the changeset describe the behavior.

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
Prevent discovery from parsing Cargo manifests in trees excluded by pnpm-workspace.yaml and the selected Cargo workspace [#14844] ✅
Prevent excluded valid Cargo workspaces from receiving generated source configuration [#14844] ✅

Sequence Diagram(s)

sequenceDiagram
  participant pnpm_install
  participant EcosystemWorkspaceInventory
  participant find_workspace_inventory
  participant CargoDiscovery
  pnpm_install->>EcosystemWorkspaceInventory: create workspace inventory
  EcosystemWorkspaceInventory->>find_workspace_inventory: pass workspace package patterns
  find_workspace_inventory->>CargoDiscovery: traverse non-excluded directories
  CargoDiscovery-->>pnpm_install: return discovered manifests
Loading

Suggested labels: product: pacquet

Merge Risk: ⚪ Minimal · up to aad18

The reviewed change has no identified merge-blocking risk.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-14844

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

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

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Remediation recommended

1. One release note bundles two changes ✓ Resolved 📘 Rule violation ⚙ Maintainability
Description
The second sentence in the changeset combines excluded-project manifest parsing and generated source
configuration writes with or. These are distinct observable effects, so a later editor cannot
revise either release-note statement independently without also rewriting the other.
Code

.changeset/fix-native-discovery-exclusions.md[5]

+Cargo and Python discovery now skip directories excluded by `!` patterns in `pnpm-workspace.yaml` `packages`. Excluded native projects are no longer parsed or given generated source configuration [pnpm/pnpm#14844](https://github.com/pnpm/pnpm/issues/14844).
Relevance

●●● Strong

Recent accepted precedents consistently require splitting compound changeset sentences into separate
logical user-visible changes.

PR-#14736
PR-#14624
PR-#14666

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 3058304 requires every changeset sentence to describe one logical change. The new
changeset's second sentence joins two distinct outcomes with or: projects are no longer parsed and
are no longer given generated source configuration.

Rule 3058304: Avoid compound sentences in individual changeset entries
.changeset/fix-native-discovery-exclusions.md[5-5]

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 changeset combines two distinct observable changes in one sentence: excluded native projects are not parsed, and generated source configuration is not written to them.

## Fix Focus Areas
- .changeset/fix-native-discovery-exclusions.md[5-5]

## Recommended Fix
Split the second sentence into two direct sentences, one describing skipped parsing and one describing the absence of generated source configuration.

ⓘ 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
Review mode: ⏭️ Skipped: The latest push only revises wording in a changeset release-note document and has no behavioral or executable-code impact.

Grey Divider

Tip of the day
💡 Did you know, you can hide the parts of a finding you never read, like the evidence or the agent prompt

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 added the reviewed: coderabbit CodeRabbit submitted an approving review label Sep 11, 2026
@github-actions

github-actions Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                                            main                                   pr
-----                                            ----                                   --
lockfile/parse_pnpm_lock                         1.00     11.6±0.24ms    32.3 MB/sec    1.09     12.7±0.43ms    29.6 MB/sec
packument/parse                                  1.01     38.1±0.11µs  1743.2 MB/sec    1.00     37.6±0.16µs  1766.2 MB/sec
tarball/download_dependency                      1.01      4.0±0.21ms  1094.0 KB/sec    1.00      3.9±0.20ms  1104.4 KB/sec
tarball_batch/cold_store_many_medium_tarballs    1.00   195.8±12.72ms 81.7 KElem/sec    1.01    197.7±7.43ms 81.0 KElem/sec
workspace_resolution/hoist_heavy                 1.00    235.8±2.14ms        ? ?/sec    1.19   280.8±10.26ms        ? ?/sec
workspace_sort/chained_projects                  1.00     12.7±0.86ms        ? ?/sec    1.08     13.8±2.03ms        ? ?/sec

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit aad1848

@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 Sep 12, 2026

Copy link
Copy Markdown
Member Author

Addressed Qodo's release-note comment in aad1848. The parsing and generated-configuration effects now have separate sentences. just ready passed again with 11,123 tests passing and 13 skipped.


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

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.66667% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.80%. Comparing base (e29016f) to head (aad1848).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
pnpm/crates/workspace/src/inventory.rs 81.48% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #14846      +/-   ##
==========================================
- Coverage   90.80%   90.80%   -0.01%     
==========================================
  Files        1238     1239       +1     
  Lines      160122   160163      +41     
==========================================
+ Hits       145401   145433      +32     
- Misses      14721    14730       +9     

☔ 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

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: aad184814ed5

Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm. 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.353 ± 0.143 2.211 2.613 1.62 ± 0.19
pacquet@main 2.347 ± 0.148 2.215 2.552 1.61 ± 0.19
pnpr@HEAD 1.507 ± 0.145 1.294 1.658 1.03 ± 0.14
pnpr@main 1.457 ± 0.146 1.278 1.674 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.35270968928,
      "stddev": 0.14257923508742085,
      "median": 2.3204275804799996,
      "user": 1.2029118600000002,
      "system": 1.29899064,
      "min": 2.2108328234799997,
      "max": 2.6127230304799998
    },
    {
      "command": "pacquet@main",
      "mean": 2.3473418152799996,
      "stddev": 0.14769779948887896,
      "median": 2.26027865998,
      "user": 1.1739469599999999,
      "system": 1.32809354,
      "min": 2.21520667348,
      "max": 2.5516135104799997
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.5069362196800005,
      "stddev": 0.14498889667411474,
      "median": 1.52943169498,
      "user": 1.0865167599999999,
      "system": 1.27359014,
      "min": 1.2941611824800001,
      "max": 1.6580584974800001
    },
    {
      "command": "pnpr@main",
      "mean": 1.45663774258,
      "stddev": 0.1464839583638066,
      "median": 1.48543677298,
      "user": 1.08570006,
      "system": 1.2560676400000002,
      "min": 1.27759387148,
      "max": 1.67376340848
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 240.5 ± 50.4 195.8 338.3 1.15 ± 0.24
pacquet@main 208.8 ± 7.2 198.8 219.4 1.00
pnpr@HEAD 224.5 ± 5.0 214.2 230.7 1.07 ± 0.04
pnpr@main 224.2 ± 10.5 206.6 240.2 1.07 ± 0.06
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.24050389474,
      "stddev": 0.050403830076076545,
      "median": 0.21433811834000002,
      "user": 0.27195085999999996,
      "system": 0.5712526800000001,
      "min": 0.19575811434,
      "max": 0.33827243234
    },
    {
      "command": "pacquet@main",
      "mean": 0.20884475444,
      "stddev": 0.007224734322755154,
      "median": 0.20935222484000005,
      "user": 0.21408086,
      "system": 0.53904458,
      "min": 0.19881204334000002,
      "max": 0.21940484234000002
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.22447464144,
      "stddev": 0.005040115665489863,
      "median": 0.22439986134,
      "user": 0.23937706000000003,
      "system": 0.51338178,
      "min": 0.21423266534000002,
      "max": 0.23065067834000003
    },
    {
      "command": "pnpr@main",
      "mean": 0.22419946554000006,
      "stddev": 0.01046696220589597,
      "median": 0.22449350134,
      "user": 0.22077886000000002,
      "system": 0.52884558,
      "min": 0.20660425134000002,
      "max": 0.24015695834000003
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 6.9 ± 0.6 5.8 10.4 1.00
pacquet@main 6.9 ± 0.6 5.6 9.8 1.01 ± 0.12
pnpr@HEAD 6.9 ± 0.6 6.0 9.2 1.00 ± 0.12
pnpr@main 7.5 ± 0.5 6.6 10.0 1.09 ± 0.12
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.0068686609549999935,
      "stddev": 0.0005777802566511463,
      "median": 0.00679038508,
      "user": 0.004273880319148936,
      "system": 0.0030254494680851058,
      "min": 0.00580491108,
      "max": 0.01035066808
    },
    {
      "command": "pacquet@main",
      "mean": 0.006940450381408454,
      "stddev": 0.0006195817388062598,
      "median": 0.006837267080000001,
      "user": 0.004241008450704222,
      "system": 0.0031385369014084482,
      "min": 0.0056483070800000005,
      "max": 0.00981111408
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.00689073745829911,
      "stddev": 0.0005849478109003455,
      "median": 0.00672005708,
      "user": 0.004051196480938416,
      "system": 0.0032332185337243433,
      "min": 0.00603614208,
      "max": 0.00918965908
    },
    {
      "command": "pnpr@main",
      "mean": 0.007518331593888881,
      "stddev": 0.0005215988894413087,
      "median": 0.00744624558,
      "user": 0.004872550000000003,
      "system": 0.003134388555555555,
      "min": 0.00656356308,
      "max": 0.01003289808
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 7.6 ± 0.6 6.2 9.9 1.05 ± 0.11
pacquet@main 7.7 ± 0.9 5.9 11.0 1.05 ± 0.14
pnpr@HEAD 7.8 ± 0.6 6.3 9.9 1.07 ± 0.11
pnpr@main 7.3 ± 0.5 6.4 9.4 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.0076278665043971626,
      "stddev": 0.0006301981816531833,
      "median": 0.00756403082,
      "user": 0.00462404794326241,
      "system": 0.003437133900709221,
      "min": 0.00621319982,
      "max": 0.009858721820000001
    },
    {
      "command": "pacquet@main",
      "mean": 0.007652870414674553,
      "stddev": 0.0009187318475538327,
      "median": 0.00747155232,
      "user": 0.004874070059171598,
      "system": 0.0032135017751479308,
      "min": 0.00593433482,
      "max": 0.010992425820000002
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.007764332619331098,
      "stddev": 0.0006015366455747945,
      "median": 0.0077679158199999996,
      "user": 0.004710089096989963,
      "system": 0.0035218313043478256,
      "min": 0.00633900382,
      "max": 0.00994862682
    },
    {
      "command": "pnpr@main",
      "mean": 0.007282722707272723,
      "stddev": 0.0004555361423047129,
      "median": 0.0072421488200000005,
      "user": 0.004282563636363635,
      "system": 0.0034028462545454543,
      "min": 0.00636226782,
      "max": 0.009392363820000001
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.474 ± 0.093 2.427 2.735 1.70 ± 0.13
pacquet@main 2.458 ± 0.027 2.423 2.516 1.69 ± 0.12
pnpr@HEAD 1.518 ± 0.113 1.380 1.685 1.04 ± 0.11
pnpr@main 1.456 ± 0.100 1.379 1.721 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.47350745094,
      "stddev": 0.09315619425621066,
      "median": 2.44707171014,
      "user": 1.70537478,
      "system": 1.6621724999999998,
      "min": 2.42673936664,
      "max": 2.73530157564
    },
    {
      "command": "pacquet@main",
      "mean": 2.4584522164400004,
      "stddev": 0.02720747854711362,
      "median": 2.46126403264,
      "user": 1.7458966800000002,
      "system": 1.5454861,
      "min": 2.42303194464,
      "max": 2.51585163564
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.5179450990399999,
      "stddev": 0.11263846245542479,
      "median": 1.51441696964,
      "user": 1.0856613800000001,
      "system": 1.2643039,
      "min": 1.38040387864,
      "max": 1.68479214264
    },
    {
      "command": "pnpr@main",
      "mean": 1.4556466115400002,
      "stddev": 0.10035981066408739,
      "median": 1.4349789946399998,
      "user": 1.1105937799999999,
      "system": 1.2427381,
      "min": 1.37875348064,
      "max": 1.72060762964
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 345.2 ± 15.8 319.8 379.4 1.28 ± 0.07
pacquet@main 466.7 ± 105.3 338.5 585.5 1.73 ± 0.39
pnpr@HEAD 273.4 ± 8.2 257.0 285.4 1.01 ± 0.05
pnpr@main 269.9 ± 9.4 257.3 283.4 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.34522238118000004,
      "stddev": 0.015817668894152388,
      "median": 0.34325100748000004,
      "user": 0.5425376999999999,
      "system": 0.7814571599999999,
      "min": 0.31982200648000003,
      "max": 0.37941053748000003
    },
    {
      "command": "pacquet@main",
      "mean": 0.46670942568000007,
      "stddev": 0.1053429637654716,
      "median": 0.5116753299800001,
      "user": 0.7395169,
      "system": 1.0147137599999998,
      "min": 0.33845065148000003,
      "max": 0.58551918948
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.27344531318000004,
      "stddev": 0.008158895757081442,
      "median": 0.27310766648,
      "user": 0.219972,
      "system": 0.5181407599999999,
      "min": 0.25699876348,
      "max": 0.28541505448
    },
    {
      "command": "pnpr@main",
      "mean": 0.26989199728,
      "stddev": 0.009429147257481672,
      "median": 0.26728338448,
      "user": 0.22120199999999998,
      "system": 0.50952186,
      "min": 0.25731710548000003,
      "max": 0.28343687548
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.528 ± 0.015 1.501 1.547 5.58 ± 0.18
pacquet@main 1.563 ± 0.033 1.507 1.623 5.71 ± 0.22
pnpr@HEAD 0.274 ± 0.009 0.264 0.287 1.00
pnpr@main 0.274 ± 0.010 0.258 0.288 1.00 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.5284487095800003,
      "stddev": 0.015239711564147527,
      "median": 1.53087113168,
      "user": 0.7700261399999999,
      "system": 0.8382104,
      "min": 1.5010816716800002,
      "max": 1.5467121486800002
    },
    {
      "command": "pacquet@main",
      "mean": 1.5633955165800004,
      "stddev": 0.03327247756983857,
      "median": 1.56434440168,
      "user": 0.83952554,
      "system": 0.9134325000000001,
      "min": 1.50700649268,
      "max": 1.62294530568
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.27390989198,
      "stddev": 0.008531498021817945,
      "median": 0.27250321518000004,
      "user": 0.20832204,
      "system": 0.5162078,
      "min": 0.26384863268000003,
      "max": 0.28744265368
    },
    {
      "command": "pnpr@main",
      "mean": 0.27392310018000005,
      "stddev": 0.010248412092660563,
      "median": 0.27580511918,
      "user": 0.22176474000000002,
      "system": 0.5149893999999999,
      "min": 0.25780059568,
      "max": 0.28826297268
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 218.3 ± 21.3 192.1 270.1 2.46 ± 0.25
pacquet@main 200.4 ± 19.7 174.2 247.7 2.26 ± 0.23
pnpr@HEAD 89.9 ± 2.6 86.8 96.0 1.01 ± 0.04
pnpr@main 88.7 ± 2.3 86.2 94.1 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.21831143094,
      "stddev": 0.021330971085218274,
      "median": 0.21368023354000001,
      "user": 0.24063189999999998,
      "system": 0.06805096,
      "min": 0.19213828454,
      "max": 0.27009028154000003
    },
    {
      "command": "pacquet@main",
      "mean": 0.20037171538615384,
      "stddev": 0.01974074641099638,
      "median": 0.19992783254000002,
      "user": 0.20400661538461537,
      "system": 0.07069868307692308,
      "min": 0.17417171054,
      "max": 0.24771816054
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.08991749141500001,
      "stddev": 0.0026128184112808725,
      "median": 0.08946131203999999,
      "user": 0.03395396875,
      "system": 0.01143722875,
      "min": 0.08676654454,
      "max": 0.09597291054
    },
    {
      "command": "pnpr@main",
      "mean": 0.08871302538375,
      "stddev": 0.0022632540733888234,
      "median": 0.08764212254,
      "user": 0.029149843749999998,
      "system": 0.01451035375,
      "min": 0.08616684954,
      "max": 0.09412079654
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 640.8 ± 74.7 534.0 756.2 1.02 ± 0.20
pacquet@main 628.0 ± 97.7 533.7 794.0 1.00
pnpm@HEAD 2968.0 ± 105.7 2832.3 3129.6 4.73 ± 0.75
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.6407889970088889,
      "stddev": 0.0746798092658442,
      "median": 0.66130594312,
      "user": 0.6434558866666666,
      "system": 0.1650308911111111,
      "min": 0.53401290012,
      "max": 0.75619910712
    },
    {
      "command": "pacquet@main",
      "mean": 0.6280145062311111,
      "stddev": 0.09766561296699991,
      "median": 0.6198894971200001,
      "user": 0.640416442222222,
      "system": 0.15467178,
      "min": 0.53374955012,
      "max": 0.7940086381200001
    },
    {
      "command": "pnpm@HEAD",
      "mean": 2.9680282858977782,
      "stddev": 0.10574218924642628,
      "median": 2.9576977481199997,
      "user": 4.333178775555556,
      "system": 0.25994133555555554,
      "min": 2.83234315512,
      "max": 3.12958928712
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.443 ± 0.141 4.286 4.662 1.29 ± 0.05
pacquet@main 4.358 ± 0.145 4.275 4.746 1.27 ± 0.05
pnpr@HEAD 3.434 ± 0.071 3.347 3.573 1.00
pnpr@main 3.462 ± 0.123 3.347 3.697 1.01 ± 0.04
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.443187908940001,
      "stddev": 0.14137922198136266,
      "median": 4.41605413684,
      "user": 1.43040624,
      "system": 1.63106982,
      "min": 4.28605284334,
      "max": 4.66168926934
    },
    {
      "command": "pacquet@main",
      "mean": 4.35790170654,
      "stddev": 0.14483998460137082,
      "median": 4.29398612034,
      "user": 1.29059644,
      "system": 1.4633653199999999,
      "min": 4.27522891934,
      "max": 4.74551906134
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.43436341874,
      "stddev": 0.07056638105906565,
      "median": 3.42216721384,
      "user": 1.2730223399999998,
      "system": 1.3957433199999998,
      "min": 3.34686112034,
      "max": 3.57291638634
    },
    {
      "command": "pnpr@main",
      "mean": 3.4617127672400003,
      "stddev": 0.12327845608387088,
      "median": 3.42600881284,
      "user": 1.27290694,
      "system": 1.3352843199999997,
      "min": 3.34695698734,
      "max": 3.69729669234
    }
  ]
}

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 107.2 ± 2.9 103.3 114.5 1.00 ± 0.04
pacquet@main 107.2 ± 3.5 103.1 115.3 1.00
pnpr@HEAD 118.0 ± 3.3 111.3 126.8 1.10 ± 0.05
pnpr@main 119.6 ± 4.0 111.7 131.3 1.12 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.10720183930333332,
      "stddev": 0.0029380178877271477,
      "median": 0.10697735372,
      "user": 0.133221075,
      "system": 0.12515978333333333,
      "min": 0.10332937772,
      "max": 0.11453888272
    },
    {
      "command": "pacquet@main",
      "mean": 0.10718676676166666,
      "stddev": 0.003462618018913717,
      "median": 0.10624556022000001,
      "user": 0.12883361666666665,
      "system": 0.1310729083333333,
      "min": 0.10311506572000001,
      "max": 0.11528061372000001
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.11804506376545455,
      "stddev": 0.0033089250529027966,
      "median": 0.11817161972000001,
      "user": 0.14301215454545455,
      "system": 0.12397719999999998,
      "min": 0.11133671372000001,
      "max": 0.12679562172000003
    },
    {
      "command": "pnpr@main",
      "mean": 0.11963686398086958,
      "stddev": 0.004047934203583112,
      "median": 0.11953316472,
      "user": 0.13425474347826089,
      "system": 0.13329033043478258,
      "min": 0.11173999072,
      "max": 0.13130461372000002
    }
  ]
}

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/14846
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
103.33 ms
(-16.37%)Baseline: 123.55 ms
148.26 ms
(69.69%)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
🚷 view threshold
2,426.74 ms
(-2.76%)Baseline: 2,495.56 ms
2,994.68 ms
(81.04%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
1,501.08 ms
(-4.58%)Baseline: 1,573.09 ms
1,887.71 ms
(79.52%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
319.82 ms
(-19.37%)Baseline: 396.64 ms
475.96 ms
(67.19%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
192.14 ms
(-15.93%)Baseline: 228.55 ms
274.26 ms
(70.06%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,210.83 ms
(-7.90%)Baseline: 2,400.49 ms
2,880.59 ms
(76.75%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,286.05 ms
(-3.98%)Baseline: 4,463.88 ms
5,356.66 ms
(80.01%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
195.76 ms
(-13.91%)Baseline: 227.40 ms
272.88 ms
(71.74%)
isolated-linker.peer-heavy-resolve.hot-cache.offline📈 view plot
🚷 view threshold
534.01 ms
(-16.16%)Baseline: 636.94 ms
764.33 ms
(69.87%)
isolated-linker.repeat-install.cold-cache.hot-store📈 view plot
🚷 view threshold
6.21 ms
(-11.78%)Baseline: 7.04 ms
8.45 ms
(73.52%)
isolated-linker.repeat-install.hot-cache.hot-store📈 view plot
🚷 view threshold
5.80 ms
(-17.23%)Baseline: 7.01 ms
8.42 ms
(68.98%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/14846
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
111.34 ms
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,380.40 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
263.85 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
257.00 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
86.77 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,294.16 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
3,346.86 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
214.23 ms
isolated-linker.repeat-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
6.34 ms
isolated-linker.repeat-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
6.04 ms
🐰 View full continuous benchmarking report in Bencher

@benpsnyder

Copy link
Copy Markdown

Thanks for addressing this. I independently tested aad1848: all 99 focused workspace/Cargo tests passed locally. I’ve closed my overlapping PR #14848 in favor of this implementation. The explicit-negation discovery boundary addresses the issue I reported in #14844.

@zkochan
zkochan merged commit 3cec568 into main Sep 12, 2026
50 checks passed
@zkochan
zkochan deleted the fix-14844 branch September 12, 2026 09:52
biisal pushed a commit to biisal/pnpm that referenced this pull request Sep 15, 2026
Pass workspace package patterns into the shared native manifest inventory
and prune directories matching explicit negations before opening them.
Reuse directory-pattern normalization with npm workspace discovery.

Preserve discovery outside positive npm patterns: existing Cargo installs
support packages: [] and may live outside the npm package layout. Cargo
workspace.exclude still controls Cargo membership; pnpm package negations
provide the boundary for discovering independent native workspaces.

Add an offline CLI regression for invalid and valid excluded Cargo
workspaces, plus inventory coverage for Cargo/Python, normalized and glob
exclusions, root inclusion, and invalid patterns. The CLI regression fails
on the original implementation with the reported cargo metadata error.

This affects the Rust v12 CLI only. The TypeScript v11 CLI has no Cargo
or Python ecosystem install integration.

Closes pnpm#14844.
u9g pushed a commit to u9g/pnpm that referenced this pull request Sep 25, 2026
Pass workspace package patterns into the shared native manifest inventory
and prune directories matching explicit negations before opening them.
Reuse directory-pattern normalization with npm workspace discovery.

Preserve discovery outside positive npm patterns: existing Cargo installs
support packages: [] and may live outside the npm package layout. Cargo
workspace.exclude still controls Cargo membership; pnpm package negations
provide the boundary for discovering independent native workspaces.

Add an offline CLI regression for invalid and valid excluded Cargo
workspaces, plus inventory coverage for Cargo/Python, normalized and glob
exclusions, root inclusion, and invalid patterns. The CLI regression fails
on the original implementation with the reported cargo metadata error.

This affects the Rust v12 CLI only. The TypeScript v11 CLI has no Cargo
or Python ecosystem install integration.

Closes pnpm#14844.
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.

Cargo discovery processes excluded non-member trees and writes their source configuration

3 participants