Skip to content

fix(install): exclude stale workspace importers - #15249

Merged
zkochan merged 1 commit into
mainfrom
fix-15248
Sep 21, 2026
Merged

zkochan merged 1 commit into
mainfrom
fix-15248

Conversation

@zkochan

@zkochan zkochan commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

Summary

Frozen installs now start from the discovered workspace projects, so a project removed from pnpm-workspace.yaml no longer has its dependencies fetched or linked. Its missing local tarballs no longer fail the install. The wanted lockfile remains unchanged, and the current lockfile records only the installed dependency closure.

This fixes a pnpm 12 regression. pnpm 11 already selects the workspace projects correctly. Hoisted installs and manifest-independent pnpm fetch retain their existing scope.

Closes #15248.

Validation: 862 scoped package-manager and CLI tests, 23 CLI smoke tests, workspace check:rust and lint:rust, formatting, and spelling checks passed. The new regression test fails against pnpm 12.5.1 and passes with this fix.

Squash Commit Body

Use discovered importer IDs as the default roots of frozen materialization,
while preserving explicit selections and the full-lockfile scope used by
hoisted installs and manifest-independent fetches.

Reuse the current-lockfile merge helper without a previous lockfile for
full installs. This records the installed closure without retaining stale
importers and preserves the existing handling of skipped dependencies.
Verification still covers the complete wanted lockfile.

Add CLI regressions for a removed workspace project with a present or
missing local tarball and for fetch without project manifests.

Closes pnpm/pnpm#15248.

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-6).


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

@coderabbitai

coderabbitai Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 9 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: pnpm/pnpm/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 67c00694-f3bd-453d-9efe-ce8eb6d70563

📥 Commits

Reviewing files that changed from the base of the PR and between 449e0fa and 9cae404.

📒 Files selected for processing (9)
  • .changeset/frozen-workspace-importers.md
  • pnpm/crates/cli/tests/suite/install_stale_importers.rs
  • pnpm/crates/cli/tests/suite/main.rs
  • pnpm/crates/package-manager/src/install/apply_materialization/selection.rs
  • pnpm/crates/package-manager/src/install/materialize.rs
  • pnpm/crates/package-manager/src/install/materialize/frozen.rs
  • pnpm/crates/package-manager/src/install/materialize/scope.rs
  • pnpm/crates/package-manager/src/install/run/execution.rs
  • pnpm/crates/package-manager/src/install/state_options.rs

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.

@github-actions

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                                            main                                   pr
-----                                            ----                                   --
lockfile/parse_pnpm_lock                         1.00     17.3±2.62ms    21.7 MB/sec    1.15     19.9±4.90ms    18.8 MB/sec
packument/parse                                  1.00     43.1±1.49µs  1538.1 MB/sec    1.08     46.4±3.26µs  1428.5 MB/sec
tarball/download_dependency                      1.00      6.0±0.89ms   728.8 KB/sec    1.10      6.6±2.01ms   661.3 KB/sec
tarball_batch/cold_store_many_medium_tarballs    1.02   263.4±16.49ms 60.7 KElem/sec    1.00   259.0±16.73ms 61.8 KElem/sec
workspace_resolution/hoist_heavy                 1.00   318.6±18.63ms        ? ?/sec    1.50   477.6±63.83ms        ? ?/sec
workspace_sort/chained_projects                  1.00     15.8±1.16ms        ? ?/sec    1.74     27.5±7.91ms        ? ?/sec

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.47%. Comparing base (449e0fa) to head (9cae404).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #15249   +/-   ##
=======================================
  Coverage   91.47%   91.47%           
=======================================
  Files        1376     1376           
  Lines      184757   184763    +6     
=======================================
+ Hits       168998   169004    +6     
  Misses      15759    15759           

☔ 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

Same-run regression check

HEAD and main are measured on the same runner. The tolerance is 5% of the main median or 2 ms, whichever is larger. A regression requires both the median slowdown and the gap between the fastest retained HEAD sample and slowest retained main sample to exceed this tolerance, after trimming up to 10% from each tail. Suspected regressions are rerun once with target order reversed and only fail if reproduced. This conservative noise guard is not a statistical confidence interval.

Inconclusive rows do not fail the check. They remain visible for performance review. Bencher retains absolute minimum timings for historical tracking; historical alerts do not gate this PR. Sequential measurements can still be affected by runner drift.

Scenario Engine main median HEAD median Change Tolerance Result
isolated-fresh-restore-cold-cache-cold-store pacquet 2431.08 ms 2366.47 ms -2.7% 121.55 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store pnpr 1472.59 ms 1453.82 ms -1.3% 73.63 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pacquet 254.28 ms 250.71 ms -1.4% 12.71 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pnpr 298.13 ms 268.65 ms -9.9% 14.91 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pacquet 7.27 ms 6.60 ms -9.3% 2.00 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pnpr 9.24 ms 7.17 ms -22.3% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pacquet 13.34 ms 14.55 ms 9.1% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pnpr 13.94 ms 13.06 ms -6.3% 2.00 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pacquet 2962.60 ms 2768.02 ms -6.6% 148.13 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pnpr 1698.20 ms 1745.37 ms 2.8% 84.91 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pacquet 602.93 ms 634.98 ms 5.3% 30.15 ms Inconclusive (overlapping samples)
isolated-fresh-install-hot-cache-hot-store pnpr 424.45 ms 405.98 ms -4.4% 21.22 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pacquet 1720.57 ms 1723.70 ms 0.2% 86.03 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pnpr 383.63 ms 377.59 ms -1.6% 19.18 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pacquet 210.56 ms 218.98 ms 4.0% 10.53 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pnpr 96.27 ms 94.61 ms -1.7% 4.81 ms Within tolerance
isolated-peer-heavy-resolve-hot-cache-offline pacquet 1240.58 ms 1278.41 ms 3.0% 62.03 ms Within tolerance
isolated-linked-workspace-resolve-hot-cache-offline pacquet 202.60 ms 192.95 ms -4.8% 10.13 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pacquet 4401.17 ms 4501.20 ms 2.3% 220.06 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pnpr 3495.68 ms 3458.16 ms -1.1% 174.78 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pacquet 123.11 ms 124.20 ms 0.9% 6.16 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pnpr 133.13 ms 133.95 ms 0.6% 6.66 ms Within tolerance

Integrated-Benchmark Report (Linux)

Commit: 9cae404a1898

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 tracks absolute minimum latency; PR regression checks compare HEAD and main samples from the same runner. Historical timing alerts do not gate PRs.

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.427 ± 0.126 2.309 2.651 1.65 ± 0.15
pacquet@main 2.480 ± 0.156 2.307 2.704 1.68 ± 0.16
pnpr@HEAD 1.490 ± 0.112 1.361 1.706 1.01 ± 0.11
pnpr@main 1.473 ± 0.106 1.331 1.682 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.4269850883,
      "stddev": 0.12560761571424414,
      "median": 2.3664701108,
      "user": 1.53640316,
      "system": 1.9339123400000002,
      "min": 2.3090593493,
      "max": 2.6512115243
    },
    {
      "command": "pacquet@main",
      "mean": 2.4795954331,
      "stddev": 0.1558523345142985,
      "median": 2.4310751628,
      "user": 1.5602906600000002,
      "system": 1.9566449399999999,
      "min": 2.3072950373,
      "max": 2.7038743123
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.4903899009,
      "stddev": 0.11233300022335029,
      "median": 1.4538216608,
      "user": 1.4521648599999997,
      "system": 1.7062006399999998,
      "min": 1.3605939583,
      "max": 1.7056383103
    },
    {
      "command": "pnpr@main",
      "mean": 1.4734560921999997,
      "stddev": 0.10571729773179489,
      "median": 1.4725905553,
      "user": 1.49260476,
      "system": 1.88710734,
      "min": 1.3308964692999998,
      "max": 1.6816349442999998
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 274.7 ± 48.3 236.3 370.2 1.07 ± 0.20
pacquet@main 257.8 ± 13.3 240.6 283.9 1.00
pnpr@HEAD 273.2 ± 18.9 243.7 312.4 1.06 ± 0.09
pnpr@main 298.4 ± 13.4 279.6 326.8 1.16 ± 0.08
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.27472738934000007,
      "stddev": 0.048278185034913566,
      "median": 0.25071392264000003,
      "user": 0.30297421999999996,
      "system": 0.60236682,
      "min": 0.23632162464,
      "max": 0.37016024064
    },
    {
      "command": "pacquet@main",
      "mean": 0.25777286854000003,
      "stddev": 0.013260077587201234,
      "median": 0.25427878964000006,
      "user": 0.31040071999999996,
      "system": 0.6086896199999999,
      "min": 0.24063715964000001,
      "max": 0.28385937064000005
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.2732127966400001,
      "stddev": 0.018854964036639773,
      "median": 0.26865143664,
      "user": 0.29145432,
      "system": 0.5890473199999999,
      "min": 0.24373382064000002,
      "max": 0.31239664164000003
    },
    {
      "command": "pnpr@main",
      "mean": 0.29841601534000006,
      "stddev": 0.013388107981548393,
      "median": 0.29812520614000004,
      "user": 0.31934902,
      "system": 0.6293552200000001,
      "min": 0.27963288264,
      "max": 0.32675726064000005
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 6.7 ± 0.5 5.8 9.3 1.00
pacquet@main 7.4 ± 0.9 5.9 11.6 1.10 ± 0.16
pnpr@HEAD 7.2 ± 0.7 5.9 9.9 1.08 ± 0.13
pnpr@main 9.6 ± 2.7 6.3 21.4 1.43 ± 0.41
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.006717903189923274,
      "stddev": 0.0005245483070565361,
      "median": 0.00659979986,
      "user": 0.003937708184143225,
      "system": 0.0031839497698209723,
      "min": 0.00584650886,
      "max": 0.009321929860000001
    },
    {
      "command": "pacquet@main",
      "mean": 0.007407540688282838,
      "stddev": 0.0008942343360825809,
      "median": 0.00727399336,
      "user": 0.0045298595959596,
      "system": 0.0033187257575757584,
      "min": 0.00589625986,
      "max": 0.011602841860000001
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.0072245994558549215,
      "stddev": 0.0006533672108038941,
      "median": 0.007174091360000001,
      "user": 0.0045763792746114,
      "system": 0.0030784601036269424,
      "min": 0.00593688586,
      "max": 0.009949325860000002
    },
    {
      "command": "pnpr@main",
      "mean": 0.009617985149398281,
      "stddev": 0.002668838285542204,
      "median": 0.00923577086,
      "user": 0.005816894269340979,
      "system": 0.004318106647564468,
      "min": 0.0062572348600000004,
      "max": 0.021435486860000002
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 14.9 ± 2.4 10.4 26.5 1.15 ± 0.22
pacquet@main 13.3 ± 1.8 9.3 18.7 1.03 ± 0.17
pnpr@HEAD 12.9 ± 1.4 9.2 16.2 1.00
pnpr@main 13.8 ± 1.1 10.8 16.0 1.06 ± 0.14
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.014884275119560437,
      "stddev": 0.002396838333445459,
      "median": 0.01454897718,
      "user": 0.007872480549450552,
      "system": 0.008123571428571428,
      "min": 0.01035887018,
      "max": 0.02649523518
    },
    {
      "command": "pacquet@main",
      "mean": 0.01331076097640718,
      "stddev": 0.0017631821051772138,
      "median": 0.01334107518,
      "user": 0.007811761796407186,
      "system": 0.006473704910179644,
      "min": 0.009322703180000001,
      "max": 0.01871537518
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.01292851557240507,
      "stddev": 0.001367315377644807,
      "median": 0.01306424068,
      "user": 0.007197704303797471,
      "system": 0.006648574430379747,
      "min": 0.00922104218,
      "max": 0.01624022918
    },
    {
      "command": "pnpr@main",
      "mean": 0.013759080150238088,
      "stddev": 0.0011337458239608117,
      "median": 0.01393884368,
      "user": 0.007709564761904759,
      "system": 0.007093401428571429,
      "min": 0.01075609018,
      "max": 0.01603174918
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.746 ± 0.088 2.563 2.840 1.57 ± 0.15
pacquet@main 3.109 ± 0.334 2.698 3.650 1.78 ± 0.25
pnpr@HEAD 1.790 ± 0.186 1.562 2.254 1.03 ± 0.14
pnpr@main 1.744 ± 0.159 1.562 2.088 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.74569545678,
      "stddev": 0.08803509919216913,
      "median": 2.7680236868800003,
      "user": 2.58982582,
      "system": 2.14181988,
      "min": 2.56320084788,
      "max": 2.84017395188
    },
    {
      "command": "pacquet@main",
      "mean": 3.1091219263800007,
      "stddev": 0.33371477766773655,
      "median": 2.96260050938,
      "user": 3.24117702,
      "system": 2.69410638,
      "min": 2.6984812698800003,
      "max": 3.65038678688
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.7900802865799998,
      "stddev": 0.1860506954510675,
      "median": 1.74537451838,
      "user": 1.9609900199999994,
      "system": 2.19049648,
      "min": 1.5619779198800001,
      "max": 2.25444247788
    },
    {
      "command": "pnpr@main",
      "mean": 1.74355289348,
      "stddev": 0.15885382795169334,
      "median": 1.69820340138,
      "user": 1.6595996199999998,
      "system": 1.8447484800000002,
      "min": 1.56222856588,
      "max": 2.08845199388
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 642.7 ± 56.2 566.1 736.9 1.60 ± 0.19
pacquet@main 590.0 ± 68.8 490.7 704.5 1.47 ± 0.21
pnpr@HEAD 402.0 ± 33.3 334.3 448.7 1.00
pnpr@main 433.0 ± 46.4 371.1 524.1 1.08 ± 0.15
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.64268974204,
      "stddev": 0.056224261225694246,
      "median": 0.63497620894,
      "user": 1.04136738,
      "system": 1.2269748399999996,
      "min": 0.56610391944,
      "max": 0.73689437944
    },
    {
      "command": "pacquet@main",
      "mean": 0.5899551166399999,
      "stddev": 0.06880804187964958,
      "median": 0.6029259624400001,
      "user": 0.94801328,
      "system": 1.1077205399999999,
      "min": 0.49068312544000003,
      "max": 0.70452311044
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.40204960854000005,
      "stddev": 0.033342793597501474,
      "median": 0.40598291594,
      "user": 0.35095538,
      "system": 0.70137004,
      "min": 0.33431187844000004,
      "max": 0.4487354384400001
    },
    {
      "command": "pnpr@main",
      "mean": 0.4329912438400001,
      "stddev": 0.04639128556951271,
      "median": 0.42444754594,
      "user": 0.39662428,
      "system": 0.7579097399999999,
      "min": 0.37107734944000004,
      "max": 0.52411259044
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.729 ± 0.030 1.683 1.771 4.54 ± 0.23
pacquet@main 1.741 ± 0.038 1.705 1.821 4.57 ± 0.24
pnpr@HEAD 0.381 ± 0.018 0.359 0.417 1.00
pnpr@main 0.386 ± 0.027 0.356 0.449 1.01 ± 0.09
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.7286389609199997,
      "stddev": 0.029585805144207528,
      "median": 1.72369910562,
      "user": 1.2670604,
      "system": 1.4069958599999999,
      "min": 1.68337832312,
      "max": 1.77139028612
    },
    {
      "command": "pacquet@main",
      "mean": 1.7405407326200002,
      "stddev": 0.03832896627782884,
      "median": 1.72057168662,
      "user": 1.2278158,
      "system": 1.4455310599999998,
      "min": 1.70538636212,
      "max": 1.82069500812
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.38070191922,
      "stddev": 0.01788625612818138,
      "median": 0.37758614462000006,
      "user": 0.34405209999999997,
      "system": 0.80242936,
      "min": 0.35898223312000005,
      "max": 0.41726359812
    },
    {
      "command": "pnpr@main",
      "mean": 0.38613189632,
      "stddev": 0.026983290811362838,
      "median": 0.38363395662,
      "user": 0.34876389999999996,
      "system": 0.78429366,
      "min": 0.35568017612,
      "max": 0.44865473412
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 220.4 ± 13.2 201.7 240.2 2.31 ± 0.21
pacquet@main 226.3 ± 41.8 190.3 340.8 2.37 ± 0.46
pnpr@HEAD 95.6 ± 6.3 87.0 111.8 1.00
pnpr@main 98.5 ± 6.7 90.2 113.3 1.03 ± 0.10
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.2204188313033334,
      "stddev": 0.013235290164254709,
      "median": 0.21898173072000002,
      "user": 0.23374848666666667,
      "system": 0.07209709999999998,
      "min": 0.20166923322000002,
      "max": 0.24017148322
    },
    {
      "command": "pacquet@main",
      "mean": 0.22627233260461535,
      "stddev": 0.04177780616345495,
      "median": 0.21055578922,
      "user": 0.2353197430769231,
      "system": 0.08398883076923078,
      "min": 0.19028387822,
      "max": 0.34078789922
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.09558387605870969,
      "stddev": 0.00632194605219178,
      "median": 0.09461023222,
      "user": 0.03579646516129032,
      "system": 0.01575196774193548,
      "min": 0.08702562222,
      "max": 0.11183466322
    },
    {
      "command": "pnpr@main",
      "mean": 0.09853786272000001,
      "stddev": 0.006673427569420166,
      "median": 0.09627465722,
      "user": 0.03810682,
      "system": 0.017730499999999996,
      "min": 0.09022924622,
      "max": 0.11327757122000001
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.232 ± 0.197 0.990 1.537 1.00 ± 0.21
pacquet@main 1.226 ± 0.160 0.980 1.476 1.00
pnpm@HEAD 5.154 ± 1.034 4.042 7.120 4.20 ± 1.01
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.2317588461311113,
      "stddev": 0.1969298331866804,
      "median": 1.27841283902,
      "user": 1.2597570422222222,
      "system": 0.2910247355555555,
      "min": 0.98971319702,
      "max": 1.53714914902
    },
    {
      "command": "pacquet@main",
      "mean": 1.2258734129088888,
      "stddev": 0.16013591749353537,
      "median": 1.24058341202,
      "user": 1.2639053755555556,
      "system": 0.28593318,
      "min": 0.9797675180200001,
      "max": 1.4758057740200001
    },
    {
      "command": "pnpm@HEAD",
      "mean": 5.153780831131112,
      "stddev": 1.0338949614536066,
      "median": 4.860663515020001,
      "user": 8.140201931111111,
      "system": 0.4110620688888889,
      "min": 4.04187112802,
      "max": 7.12037571002
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 201.1 ± 32.6 182.1 312.3 1.00
pacquet@main 201.7 ± 7.6 188.8 213.3 1.00 ± 0.17
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.20109034771333334,
      "stddev": 0.03259278513078895,
      "median": 0.19294940238000002,
      "user": 0.15106237333333333,
      "system": 0.10320513333333332,
      "min": 0.18210614138000003,
      "max": 0.31225212838000005
    },
    {
      "command": "pacquet@main",
      "mean": 0.20170519931333336,
      "stddev": 0.007576931636908996,
      "median": 0.20259697438000002,
      "user": 0.16388050666666668,
      "system": 0.09888186666666667,
      "min": 0.18876740338000003,
      "max": 0.21333769538000003
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.549 ± 0.182 4.359 4.880 1.31 ± 0.06
pacquet@main 4.439 ± 0.096 4.368 4.652 1.28 ± 0.04
pnpr@HEAD 3.470 ± 0.093 3.394 3.706 1.00
pnpr@main 3.528 ± 0.107 3.400 3.744 1.02 ± 0.04
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.548988339199999,
      "stddev": 0.1822002675539826,
      "median": 4.501196670400001,
      "user": 1.64794024,
      "system": 1.7836952400000001,
      "min": 4.3589517309,
      "max": 4.8803595809
    },
    {
      "command": "pacquet@main",
      "mean": 4.4385956428,
      "stddev": 0.09565990469322604,
      "median": 4.4011653194,
      "user": 1.7053308400000002,
      "system": 1.7039936399999995,
      "min": 4.3675085609,
      "max": 4.652363368900001
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.4704854273000003,
      "stddev": 0.09302969256590843,
      "median": 3.4581645979,
      "user": 1.5505351399999998,
      "system": 1.5909107399999998,
      "min": 3.3941585449000002,
      "max": 3.7059474629
    },
    {
      "command": "pnpr@main",
      "mean": 3.5276834925000005,
      "stddev": 0.10731211545582534,
      "median": 3.4956754994000003,
      "user": 1.60768274,
      "system": 1.7469309399999997,
      "min": 3.3999037939,
      "max": 3.7443285149000003
    }
  ]
}

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 126.9 ± 11.7 113.8 171.3 1.04 ± 0.13
pacquet@main 122.5 ± 10.0 107.5 155.7 1.00
pnpr@HEAD 133.4 ± 6.8 120.7 145.6 1.09 ± 0.10
pnpr@main 133.9 ± 5.9 124.9 148.1 1.09 ± 0.10
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.12691321261,
      "stddev": 0.011689143412654741,
      "median": 0.12420059286000001,
      "user": 0.15345077000000001,
      "system": 0.14465835,
      "min": 0.11378163636000001,
      "max": 0.17129308536
    },
    {
      "command": "pacquet@main",
      "mean": 0.12246902599636365,
      "stddev": 0.010026369695762,
      "median": 0.12311414286000001,
      "user": 0.15585267454545457,
      "system": 0.12480469090909091,
      "min": 0.10747624036000002,
      "max": 0.15574607535999999
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.13341114762315795,
      "stddev": 0.006762728885331747,
      "median": 0.13394597536,
      "user": 0.16086629894736842,
      "system": 0.13361209999999996,
      "min": 0.12066303836000002,
      "max": 0.14563940336
    },
    {
      "command": "pnpr@main",
      "mean": 0.13385422378105263,
      "stddev": 0.005912761986814248,
      "median": 0.13312866436,
      "user": 0.1655784042105263,
      "system": 0.1263406789473684,
      "min": 0.12494533336000001,
      "max": 0.14805152436
    }
  ]
}

@zkochan
zkochan marked this pull request as ready for review September 21, 2026 23:21
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Exclude stale workspace importers from frozen installs

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

Grey Divider

AI Description

• Roots frozen installs at currently discovered workspace projects.
• Preserves full-lockfile behavior for hoisted installs and manifest-independent fetches.
• Adds regressions for removed projects, missing tarballs, and fetch scope.
Diagram

graph TD
  A["Frozen install"] --> B{"Scope policy"} -->|Workspace| C["Discovered projects"] --> G["Installed closure"] --> H["Current lockfile"]
  B -->|Explicit| D["Requested projects"] --> G
  B -->|Hoisted or fetch| E["Lockfile importers"] --> G
  F["Wanted lockfile"] --> G
Loading
High-Level Assessment

The selected approach is appropriate: it changes materialization roots rather than pruning the wanted lockfile, keeping frozen installs immutable while excluding stale workspace projects from installed state. Command-specific fetch handling or mutating stale lockfile importers would duplicate policy or violate expected lockfile preservation.

Files changed (9) +95 / -18

Bug fix (5) +16 / -9
selection.rsRecord current state from applicable importer roots +7/-6

Record current state from applicable importer roots

• Uses discovered workspace importers as roots for ordinary full installs and reuses the filtered merge path without retaining prior current state. Hoisted and manifest-independent installs continue recording the full lockfile scope.

pnpm/crates/package-manager/src/install/apply_materialization/selection.rs

materialize.rsSelect frozen roots from discovered workspace projects +5/-1

Select frozen roots from discovered workspace projects

• Passes manifest-check policy into frozen scope construction. Normal full installs now root materialization at real workspace importers, while manifest-independent operations retain all lockfile importers.

pnpm/crates/package-manager/src/install/materialize.rs

frozen.rsForward manifest policy into frozen scope selection +1/-0

Forward manifest policy into frozen scope selection

• Supplies the lockfile policy's manifest-check setting when constructing the frozen materialization scope.

pnpm/crates/package-manager/src/install/materialize/frozen.rs

execution.rsPropagate manifest-independent selection policy +2/-2

Propagate manifest-independent selection policy

• Adds the manifest-check policy to selected importer inputs so current-lockfile selection can distinguish ordinary workspace installs from fetch-like operations. Workspace package ownership is transferred directly when constructing apply inputs.

pnpm/crates/package-manager/src/install/run/execution.rs

state_options.rsTrack manifest-check policy with selected importers +1/-0

Track manifest-check policy with selected importers

• Extends selected importer state with the manifest-check flag needed to preserve full-lockfile scope for manifest-independent installs.

pnpm/crates/package-manager/src/install/state_options.rs

Tests (2) +72 / -0
install_stale_importers.rsCover stale workspace importers and fetch scope +71/-0

Cover stale workspace importers and fetch scope

• Adds a frozen-install regression covering removed workspace projects with present and missing local tarballs. Also verifies that manifest-independent fetch continues materializing every importer from the lockfile.

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

main.rsRegister stale importer regression suite +1/-0

Register stale importer regression suite

• Includes the new stale importer test module in the CLI test suite.

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

Documentation (2) +7 / -9
frozen-workspace-importers.mdDocument stale importer fix for pacquet +5/-0

Document stale importer fix for pacquet

• Adds a patch release note explaining that frozen installs no longer process removed workspace projects or fail on their missing local tarballs.

.changeset/frozen-workspace-importers.md

scope.rsClarify full-lockfile materialization exceptions +2/-9

Clarify full-lockfile materialization exceptions

• Updates documentation to state that hoisted and manifest-independent installs materialize from the complete lockfile importer set.

pnpm/crates/package-manager/src/install/materialize/scope.rs

@greptile-apps

greptile-apps Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge, with the changed root-selection behavior matching the intended install modes and covered by focused regressions.

Reviews (1) · Last reviewed commit: "fix(install): exclude stale workspace im..."

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Remediation recommended

1. Release note mixes old and new behavior 📘 Rule violation ⚙ Maintainability
Description
The changeset uses Fixed ... installing dependencies to fold the prior faulty behavior into the
statement of the fix instead of describing only the current behavior. Because this is a bug-fix
release note, readers must infer which clause is historical and which guarantee applies now.
Code

.changeset/frozen-workspace-importers.md[5]

+Fixed `pnpm install --frozen-lockfile` installing dependencies of projects removed from `pnpm-workspace.yaml`. Missing local tarballs used only by those projects no longer fail the install [#15248](https://github.com/pnpm/pnpm/issues/15248).
Relevance

●●● Strong

Recent changeset reviews accepted separating prior behavior from the fix, matching this explicit
repository rule.

PR-#15239
PR-#15190

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Compliance rule 3058498 requires previous buggy behavior, when mentioned, to appear in a separate
past-tense sentence. The added changeset instead embeds that behavior in `Fixed ... installing
dependencies`, leaving the corrected behavior implicit.

Rule 3058498: Describe previous buggy behavior in a separate past-tense sentence
.changeset/frozen-workspace-importers.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 the previous buggy behavior with the corrected behavior instead of describing the current guarantee directly.

## Fix Focus Areas
- .changeset/frozen-workspace-importers.md[5-5]

## Recommended Fix
Rewrite the entry using only current behavior, for example: “`pnpm install --frozen-lockfile` limits dependency installation to projects currently selected by `pnpm-workspace.yaml`. Missing local tarballs referenced only by removed projects do not fail installation.”

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


Grey Divider

Context sources
✅ Compliance rules (platform): 64 rules
✅ Skills: review-code
✅ Cross-repo context — repo relationships
  Explored: repo: pnpm/update (sha: fcaa952e)
  Explored: repo: pnpm/setup (sha: fbda4c85)
Review mode: ⚖️ Balanced: This changes core frozen-install materialization and lockfile selection across several Rust paths and install modes, creating meaningful correctness and regression risk that warrants a complete single-pass review.

Grey Divider

Tip of the day
💡 Did you know, you can add REVIEW.md to your repo root and Qodo follows it on every PR

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.

@zkochan

zkochan commented Sep 21, 2026

Copy link
Copy Markdown
Member Author

Regarding Qodo’s release-note wording finding: the entry follows the documented changeset example in AGENTS.md, which uses “Fixed pnpm install failing when …”. The first sentence names the command and resolved defect; the second states the missing-tarball outcome. The rule about a separate past-tense sentence applies to additional historical explanation. I am keeping the entry as written.


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

@zkochan
zkochan merged commit e45f033 into main Sep 21, 2026
54 checks passed
@zkochan
zkochan deleted the fix-15248 branch September 21, 2026 23:27
u9g pushed a commit to u9g/pnpm that referenced this pull request Sep 25, 2026
Use discovered importer IDs as the default roots of frozen materialization,
while preserving explicit selections and the full-lockfile scope used by
hoisted installs and manifest-independent fetches.

Reuse the current-lockfile merge helper without a previous lockfile for
full installs. This records the installed closure without retaining stale
importers and preserves the existing handling of skipped dependencies.
Verification still covers the complete wanted lockfile.

Add CLI regressions for a removed workspace project with a present or
missing local tarball and for fetch without project manifests.

Closes pnpm#15248.
zkochan added a commit that referenced this pull request Sep 29, 2026
On 12.5.1 a frozen install rooted materialization at every lockfile
importer, so a lockfile copied from the capsule that declared `..`
failed with ERR_PNPM_PACKAGE_MANAGER_UNSAFE_IMPORTER_PATH in capsules
that did not declare it. #15249 rooted it at the declared
projects. Asserting success makes the test fail on the old roots.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
zkochan added a commit that referenced this pull request Sep 29, 2026
…the lockfile dir (#16401)

Bit installs each component capsule with the capsule as the lockfile
dir and, for one capsule per run, also declares the capsules dir above
it, so that capsule's lockfile records a `..` importer. Lockfiles are
copied between capsules, and on 12.5.1 a frozen install in a capsule
that did not declare `..` failed with
ERR_PNPM_PACKAGE_MANAGER_UNSAFE_IMPORTER_PATH: materialization started
from every lockfile importer while only declared projects were trusted.
#15249 starts it from the declared projects.

These tests drive the engine the way the NAPI binding does and pin:

- a declared `..` project installs on the fresh, repeat, frozen, and
  rebuild paths, and from a lockfile copied in before the first install;
- an undeclared `..` importer in a copied lockfile is skipped, and the
  install succeeds (this fails on the pre-15249 roots);
- lockfile-only keys `../other`, `../../etc`, an absolute path, and
  `C:/x` write nothing outside the lockfile dir, even when `..` is
  declared.
zkochan added a commit to teambit/bit that referenced this pull request Sep 30, 2026
## Proposed Changes

Updates `@pnpm/napi` from 12.5.1 to 12.8.1. This fixes the intermittent
`ERR_PNPM_PACKAGE_MANAGER_UNSAFE_IMPORTER_PATH` error that capsule
installs throw for the `..` importer, right after "Already up to date".

What caused it:

- In each run, only the first capsule installed gets the capsules dir as
a project, so only that capsule's lockfile records a `..` importer.
Which capsule goes first changes from run to run.
- The capsule lockfiles are cached and copied back into the capsules on
the next build.
- When a capsule whose cached lockfile has `..` is not first, `..` is
not passed in. The lockfile otherwise matches, so pnpm takes the frozen
path ("Already up to date").
- In 12.5.1 the frozen path installed every importer in the lockfile.
`..` is outside the capsule and was not passed in, so pnpm refused it.

pnpm 12.8.0 (pnpm/pnpm#15249) makes a frozen install use only the
projects the caller passes in. A stale `..` importer is skipped, and the
install succeeds without writing outside the capsule. pnpm/pnpm#16401
adds a test for this scenario. With the 12.5.1 behavior it fails with
the same error.

The lockfile is regenerated. Besides the `@pnpm/napi` bump, the peer
suffixes of many entries change, for example the `[email protected]`
suffix is dropped.

---
Written by an agent (Claude Code, claude-opus-5-5).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression in 12: frozen install installs lockfile importers that pnpm-workspace.yaml no longer lists

2 participants