Repository navigation
fix(install): validate every workspace importer under --frozen-lockfile - #13028
sensei-woo wants to merge 1 commit into
Conversation
check_lockfile_freshness still carried the pre-workspaces TODO and only ran the manifest specifier check for the root importer, so a stale workspace project package.json passed `pnpm install --frozen-lockfile` with exit 0 while the drifted dependency was silently ignored; the auto-frozen fast path likewise short-circuited to the frozen materialization instead of falling through to a fresh resolve. Loop over the already-built project_manifests list (root plus every workspace project) and run check_importer_satisfies for each importer, mirroring pnpm allProjectsAreUpToDate and the per-project loop in optimistic_repeat_install. A project missing from lockfile.importers now surfaces as NoImporter — fatal under --frozen-lockfile, fall-through in the preferFrozenLockfile path — so the --no-prefer-frozen-lockfile workaround in the lockfile_only test is no longer needed. Fixes pnpm#13025
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
📝 WalkthroughWalkthroughChangesWorkspace lockfile freshness
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant Install
participant FreshnessCheck
participant Lockfile
User->>Install: run install
Install->>FreshnessCheck: validate workspace manifests
FreshnessCheck->>Lockfile: check every importer
Lockfile-->>FreshnessCheck: fresh or stale
FreshnessCheck-->>Install: frozen error or fresh-resolve path
Install-->>User: installation result
Assessment against linked issues
Possibly related PRs
Suggested labels: Suggested reviewers: ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Confidence Score: 5/5Safe to merge. The change is a targeted correctness fix to the freshness gate; single-project installs are unaffected (root-only list), workspace installs get the intended per-importer validation, and all three dispatch paths are updated consistently. The loop in No files require special attention. Reviews (1): Last reviewed commit: "fix(install): validate every workspace i..." | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
pnpm/crates/cli/tests/workspace_install.rs (1)
398-407: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueExtract
pacquet_atto a shared test utility.This exact
pacquet_athelper is duplicated across test files (e.g., it is defined identically inpnpm/crates/cli/tests/lockfile_only.rs). As per path instructions, focus on missed reuse or duplication across the monorepo. Consider extracting this helper into a shared testing module (such as the one providingCommandTempCwd) to eliminate the duplication.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/tests/workspace_install.rs` around lines 398 - 407, Extract the duplicated pacquet_at helper into the shared CLI test utility module alongside CommandTempCwd, then update workspace_install.rs and lockfile_only.rs (and any other identical definitions) to import and reuse it. Preserve its existing command construction and current-directory behavior.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.changeset/frozen-lockfile-workspace-importers.md:
- Line 2: Remove the "pnpm": patch entry from the changeset so it only records
the pacquet Rust-only fix; leave the rest of the changeset unchanged.
In `@pnpm/crates/package-manager/src/install.rs`:
- Around line 1803-1820: Update the frozen-lockfile validation around the
per-project loop in install.rs to build the current workspace importer-ID set
and compare it with lockfile.importers keys before calling
check_importer_satisfies. Reject any lockfile importer absent from the current
projects, while preserving the existing per-project validation and error
behavior for mismatches.
---
Nitpick comments:
In `@pnpm/crates/cli/tests/workspace_install.rs`:
- Around line 398-407: Extract the duplicated pacquet_at helper into the shared
CLI test utility module alongside CommandTempCwd, then update
workspace_install.rs and lockfile_only.rs (and any other identical definitions)
to import and reuse it. Preserve its existing command construction and
current-directory behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 60c87c3f-3282-495b-b47d-2cbb54047364
📒 Files selected for processing (4)
.changeset/frozen-lockfile-workspace-importers.mdpnpm/crates/cli/tests/lockfile_only.rspnpm/crates/cli/tests/workspace_install.rspnpm/crates/package-manager/src/install.rs
| @@ -0,0 +1,6 @@ | |||
| --- | |||
| "pnpm": patch | |||
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Remove pnpm from the Rust-only changeset.
Based on learnings, in changesets, pnpm always refers to the TypeScript CLI package. You should not add "pnpm": patch to a changeset for a Rust-only bug fix unless that same bug also affects the TypeScript CLI. The PR summary explicitly states this PR restores parity with pnpm's per-project freshness validation, which implies the TypeScript CLI already has this correct behavior and this is a pacquet-only fix.
🐛 Proposed fix
- "pnpm": patch📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "pnpm": patch |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.changeset/frozen-lockfile-workspace-importers.md at line 2, Remove the
"pnpm": patch entry from the changeset so it only records the pacquet Rust-only
fix; leave the rest of the changeset unchanged.
Source: Learnings
| // Every importer must satisfy the lockfile, not just the root: a | ||
| // stale workspace project manifest would otherwise pass the frozen | ||
| // gate silently (exit 0) with the drifted dependency ignored. | ||
| // Mirrors pnpm's `allProjectsAreUpToDate` and the per-project loop | ||
| // in [`crate::optimistic_repeat_install`]. A project absent from | ||
| // `lockfile.importers` surfaces as `NoImporter` — fatal under | ||
| // `--frozen-lockfile`, fall-through to fresh-resolve in state 2. | ||
| for (project_dir, project_manifest) in project_manifests { | ||
| let importer_id = pacquet_workspace::importer_id_from_root_dir(workspace_root, project_dir); | ||
| check_importer_satisfies( | ||
| lockfile, | ||
| project_manifest, | ||
| &importer_id, | ||
| config, | ||
| parsed_overrides_opt.as_deref(), | ||
| )?; | ||
| } | ||
| Ok(()) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Find the variants of StalenessReason
ast-grep outline pnpm/crates --match StalenessReason --type enum
rg 'enum StalenessReason' -A 10Repository: pnpm/pnpm
Length of output: 207
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo '--- install.rs outline ---'
ast-grep outline pnpm/crates/package-manager/src/install.rs --view expanded | sed -n '1,220p'
echo
echo '--- freshness.rs outline ---'
ast-grep outline pnpm/crates/lockfile/src/freshness.rs --view expanded | sed -n '1,220p'
echo
echo '--- relevant install.rs slice ---'
sed -n '1760,1855p' pnpm/crates/package-manager/src/install.rs
echo
echo '--- freshness.rs slice ---'
sed -n '1,260p' pnpm/crates/lockfile/src/freshness.rsRepository: pnpm/pnpm
Length of output: 22589
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo '--- StalenessReason enum ---'
sed -n '1,240p' pnpm/crates/lockfile/src/freshness.rs | nl -ba | sed -n '1,240p'
echo
echo '--- usages of StalenessReason ---'
rg -n "StalenessReason" pnpm/crates -A 4 -B 4
echo
echo '--- importer/project count comparisons ---'
rg -n "importers\.len\(|project_manifests\.len\(|NoImporter|allProjectsAreUpToDate|freshness" pnpm/crates/package-manager/src pnpm/crates/lockfile/src -A 4 -B 4Repository: pnpm/pnpm
Length of output: 216
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo '--- symbols around freshness in install.rs ---'
rg -n "fresh|stale|lockfile\.importers|project_manifests|check_importer_satisfies|allProjectsAreUpToDate|NoImporter" pnpm/crates/package-manager/src/install.rs -A 8 -B 8
echo
echo '--- freshness module details ---'
rg -n "enum StalenessReason|struct .*Fresh|fn .*fresh|NoImporter|allProjectsAreUpToDate" pnpm/crates/lockfile/src/freshness.rs -A 40 -B 10
echo
echo '--- lockfile importers len comparisons elsewhere ---'
rg -n "importers\.len\(\).*project|project.*importers\.len\(\)|len\(\).*importers" pnpm/crates -A 4 -B 4Repository: pnpm/pnpm
Length of output: 50365
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Show the exact freshness logic and any explicit handling for extra/missing importers.
sed -n '1,260p' pnpm/crates/lockfile/src/freshness.rs | nl -ba | sed -n '1,260p'
echo
rg -n "importers\.len\(|project_manifests\.len\(|NoImporter|StalenessReason" pnpm/crates -A 3 -B 3Repository: pnpm/pnpm
Length of output: 187
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo '--- install.rs freshness helpers ---'
sed -n '1880,1985p' pnpm/crates/package-manager/src/install.rs
echo
echo '--- project manifest list builder ---'
sed -n '2470,2525p' pnpm/crates/package-manager/src/install.rs
echo
echo '--- optimistic repeat install gate ---'
sed -n '2390,2470p' pnpm/crates/package-manager/src/install.rs
echo
echo '--- any exact importer-set comparison in package-manager ---'
rg -n "importers.*==|==.*importers|importers\.len\(|project_manifests\.len\(|NoImporter|Stale" pnpm/crates/package-manager/src -A 3 -B 3Repository: pnpm/pnpm
Length of output: 33800
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo '--- allProjectsAreUpToDate / workspace importer checks in TypeScript ---'
rg -n "allProjectsAreUpToDate|importers.*length|workspace projects|NoImporter|outdated lockfile|frozen-lockfile" . -g '!pnpm/crates/**' -g '!target/**' -g '!node_modules/**' -A 3 -B 3
echo
echo '--- lockfile importer handling in TypeScript install flow ---'
rg -n "lockfile\.importers|importers\[|projectManifests|workspaceProjects|package.json" . -g 'pnpm/**' -g '!pnpm/crates/**' -A 3 -B 3Repository: pnpm/pnpm
Length of output: 50368
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo '--- allProjectsAreUpToDate references ---'
rg -n "allProjectsAreUpToDate" pnpm11/pnpm -A 30 -B 10
echo
echo '--- workspace project freshness checks ---'
rg -n "project.*lockfile.*importers|lockfile.*project.*importers|importers.*workspace.*project|upToDate" pnpm11/pnpm/packages pnpm11/pnpm/src pnpm11/pnpm/test -A 6 -B 6 | head -n 300Repository: pnpm/pnpm
Length of output: 189
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo '--- allProjectsAreUpToDate ---'
rg -n --max-count 20 "allProjectsAreUpToDate" pnpm11/pnpm -A 20 -B 10
echo
echo '--- length comparison in workspace install freshness ---'
rg -n --max-count 20 "importers\.length|projects\.length|workspace projects|partial install|fully resolved" pnpm11/pnpm/packages pnpm11/pnpm/src -A 10 -B 10Repository: pnpm/pnpm
Length of output: 178
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo '--- workspace project removal / subset lockfile freshness ---'
rg -n --max-count 50 "subset of workspace projects|removed from workspace|shared-workspace-lockfile|fully resolved \(non-partial\) lockfile|NoImporter|allProjectsAreUpToDate" pnpm11/pnpm pnpm11/exec -A 8 -B 8Repository: pnpm/pnpm
Length of output: 29294
🏁 Script executed:
#!/bin/bash
set -euo pipefail
rg -n "allProjectsAreUpToDate" pnpm11/pnpm | head -n 20Repository: pnpm/pnpm
Length of output: 147
🏁 Script executed:
#!/bin/bash
set -euo pipefail
rg -n "state\.projects\.length|importers\.length|allProjectsAreUpToDate|NoImporter" pnpm11/pnpm -g '*.ts' -g '*.tsx' -g '*.js' -g '*.mjs' -A 6 -B 6Repository: pnpm/pnpm
Length of output: 147
Reject orphaned workspace importers in frozen installs pnpm/crates/package-manager/src/install.rs:1803-1820 This loop only checks current projects, so a removed workspace project can leave extra lockfile.importers entries and still pass --frozen-lockfile. Compare the current importer-id set against lockfile.importers keys before the per-project checks.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@pnpm/crates/package-manager/src/install.rs` around lines 1803 - 1820, Update
the frozen-lockfile validation around the per-project loop in install.rs to
build the current workspace importer-ID set and compare it with
lockfile.importers keys before calling check_importer_satisfies. Reject any
lockfile importer absent from the current projects, while preserving the
existing per-project validation and error behavior for mismatches.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #13028 +/- ##
==========================================
- Coverage 85.53% 85.53% -0.01%
==========================================
Files 496 496
Lines 79405 79418 +13
==========================================
+ Hits 67917 67928 +11
- Misses 11488 11490 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Integrated-Benchmark Report (Linux)Commit: Each scenario reports direct installs and pnpr installs. Bencher consumes pacquet@HEAD and pnpr@HEAD. Scenario: Isolated linker: fresh restore, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 3.8666931053199995,
"stddev": 0.22279035391298846,
"median": 3.75081142462,
"user": 3.60510004,
"system": 3.42009414,
"min": 3.65118695112,
"max": 4.2500395181199995,
"times": [
4.2500395181199995,
4.06119520312,
3.9229036341200003,
3.73211901712,
3.69563168012,
3.68342280312,
3.71820286512,
3.65118695112,
4.18272554912,
3.7695038321200003
]
},
{
"command": "pacquet@main",
"mean": 3.84360756522,
"stddev": 0.1824295003653519,
"median": 3.74611388762,
"user": 3.6229917400000007,
"system": 3.4176795399999995,
"min": 3.6186741751200002,
"max": 4.09260100512,
"times": [
3.6186741751200002,
3.75566154912,
4.09260100512,
3.70501941312,
3.7365662261200003,
3.71099202112,
4.00833435512,
4.0649631051199995,
3.7084722941200003,
4.03479150812
]
},
{
"command": "pnpr@HEAD",
"mean": 2.1442003894200004,
"stddev": 0.13553980726737253,
"median": 2.1598524666200003,
"user": 2.6568641399999997,
"system": 3.01159514,
"min": 1.94904553712,
"max": 2.32633713912,
"times": [
2.32633713912,
2.00132420512,
2.2491503121200003,
2.24703720712,
2.09936212712,
2.28370442112,
2.22034280612,
2.03068891912,
1.94904553712,
2.03501122012
]
},
{
"command": "pnpr@main",
"mean": 2.16730681802,
"stddev": 0.16040545132969217,
"median": 2.11841332312,
"user": 2.69764034,
"system": 3.04957604,
"min": 2.0160590961200002,
"max": 2.51915670712,
"times": [
2.02469585712,
2.11074392012,
2.12608272612,
2.13696429612,
2.09406479512,
2.04200293612,
2.0160590961200002,
2.27357259512,
2.51915670712,
2.32972525112
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.67198044764,
"stddev": 0.01160940544387097,
"median": 0.6737676382400001,
"user": 0.3935942799999999,
"system": 1.34693456,
"min": 0.6558673197400001,
"max": 0.68915358274,
"times": [
0.6856006107400001,
0.6718396387400001,
0.6796843227400001,
0.6756956377400001,
0.68915358274,
0.65971000974,
0.6558673197400001,
0.6648180027400001,
0.6593203737400001,
0.6781149777400001
]
},
{
"command": "pacquet@main",
"mean": 0.66344479344,
"stddev": 0.03165786125199333,
"median": 0.6516748342400001,
"user": 0.39160947999999995,
"system": 1.3290504600000002,
"min": 0.6296157397400001,
"max": 0.7283962237400001,
"times": [
0.6296157397400001,
0.6403013887400001,
0.6441584627400001,
0.6549069317400001,
0.68457233374,
0.64537920674,
0.6511038307400001,
0.6522458377400001,
0.7283962237400001,
0.7037679787400001
]
},
{
"command": "pnpr@HEAD",
"mean": 0.7387811509400001,
"stddev": 0.04444563701692832,
"median": 0.7245160722400001,
"user": 0.40897868,
"system": 1.37153206,
"min": 0.7104405127400001,
"max": 0.8614224467400001,
"times": [
0.7498209577400001,
0.7129177467400001,
0.7252554567400001,
0.7219072997400001,
0.7231407217400001,
0.7250173007400001,
0.7104405127400001,
0.8614224467400001,
0.7338742227400001,
0.7240148437400001
]
},
{
"command": "pnpr@main",
"mean": 0.74583130494,
"stddev": 0.015451480642614123,
"median": 0.7497555842400001,
"user": 0.40845718,
"system": 1.39995366,
"min": 0.7258502177400001,
"max": 0.7674027567400001,
"times": [
0.7262204347400001,
0.7529193927400001,
0.7484341507400001,
0.7258502177400001,
0.7408730047400001,
0.7510770177400001,
0.7674027567400001,
0.72603052574,
0.7620736757400001,
0.7574318727400001
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.28347436046,
"stddev": 0.025978175388537136,
"median": 4.27666155106,
"user": 3.8074609200000005,
"system": 3.4151877000000006,
"min": 4.24672662756,
"max": 4.33147941556,
"times": [
4.27074323156,
4.29606460356,
4.24672662756,
4.27920634456,
4.27411675756,
4.31345841656,
4.29735629656,
4.33147941556,
4.25802164956,
4.2675702615599995
]
},
{
"command": "pacquet@main",
"mean": 4.3081742709599995,
"stddev": 0.049926618723161655,
"median": 4.30574827456,
"user": 3.8035578200000004,
"system": 3.4273556999999997,
"min": 4.21367936256,
"max": 4.39813555256,
"times": [
4.31542079256,
4.27095106456,
4.29694403456,
4.29946421256,
4.31203233656,
4.21367936256,
4.28413826356,
4.35952952956,
4.33144756056,
4.39813555256
]
},
{
"command": "pnpr@HEAD",
"mean": 2.25366300506,
"stddev": 0.1174969821140158,
"median": 2.25743727906,
"user": 2.53548642,
"system": 2.9263006000000003,
"min": 2.08600780656,
"max": 2.41500948956,
"times": [
2.16593088056,
2.27590878956,
2.26817018556,
2.12445938256,
2.41499602056,
2.41500948956,
2.08600780656,
2.17375135856,
2.3656917645599997,
2.24670437256
]
},
{
"command": "pnpr@main",
"mean": 2.2603513576600003,
"stddev": 0.1573009117262275,
"median": 2.27616314356,
"user": 2.54982112,
"system": 2.9712145,
"min": 2.01325049156,
"max": 2.46766650656,
"times": [
2.41817065556,
2.31775502556,
2.20184618656,
2.40081764356,
2.2345712615599997,
2.01325049156,
2.01687780856,
2.20593091756,
2.3266270795599997,
2.46766650656
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.4099911345999998,
"stddev": 0.021180304395543536,
"median": 1.4075886037,
"user": 1.3683560799999999,
"system": 1.7310557800000002,
"min": 1.3819520861999999,
"max": 1.4508145972,
"times": [
1.4179376402,
1.4336113332,
1.4508145972,
1.4054040882,
1.4097731192,
1.3819520861999999,
1.4162810842,
1.3844892852,
1.4046151052,
1.3950330072
]
},
{
"command": "pacquet@main",
"mean": 1.4128960193,
"stddev": 0.021933845997771092,
"median": 1.4067772587,
"user": 1.3654565799999998,
"system": 1.7241664799999998,
"min": 1.3860630482,
"max": 1.4525358972,
"times": [
1.4525358972,
1.4050994401999999,
1.4014842271999999,
1.4501539622,
1.3860630482,
1.4084550772,
1.4169342012,
1.4114480922,
1.3989179362,
1.3978683111999999
]
},
{
"command": "pnpr@HEAD",
"mean": 0.6827487563,
"stddev": 0.018310396530804275,
"median": 0.6814082867000001,
"user": 0.35005337999999997,
"system": 1.28278748,
"min": 0.6640423712000001,
"max": 0.7298275462000001,
"times": [
0.6872908492,
0.6722064482000001,
0.6827901962,
0.7298275462000001,
0.6818070022000001,
0.6690688462000001,
0.6723077852000001,
0.6640423712000001,
0.6810095712,
0.6871369472000001
]
},
{
"command": "pnpr@main",
"mean": 0.6722037200000001,
"stddev": 0.0067627538682494635,
"median": 0.6712253057000002,
"user": 0.34823787999999994,
"system": 1.28712248,
"min": 0.6615827012000001,
"max": 0.6837597692,
"times": [
0.6725332862000001,
0.6696097042000001,
0.6709297262000001,
0.6831955722,
0.6665313432000001,
0.6719854512000001,
0.6837597692,
0.6715208852000001,
0.6703887612000001,
0.6615827012000001
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 3.13229358344,
"stddev": 0.06027889088743227,
"median": 3.12939492944,
"user": 1.84866924,
"system": 2.0175607199999996,
"min": 3.06376083194,
"max": 3.27987682794,
"times": [
3.27987682794,
3.06376083194,
3.10355476694,
3.14862131394,
3.08240184294,
3.08747876094,
3.15374964994,
3.12814070794,
3.13064915094,
3.14470198094
]
},
{
"command": "pacquet@main",
"mean": 3.11744603484,
"stddev": 0.06207107276350513,
"median": 3.10347834644,
"user": 1.8145577400000001,
"system": 1.9902744199999998,
"min": 3.03500988994,
"max": 3.2563681289399997,
"times": [
3.14549937294,
3.16706806594,
3.12573500794,
3.06380881094,
3.03500988994,
3.08704982694,
3.09505044794,
3.11190624494,
3.2563681289399997,
3.08696455194
]
},
{
"command": "pnpr@HEAD",
"mean": 0.6776771883399999,
"stddev": 0.005331067228384714,
"median": 0.67723541594,
"user": 0.35572564,
"system": 1.2897429200000001,
"min": 0.67086509094,
"max": 0.68754217094,
"times": [
0.68222186094,
0.67838596194,
0.68754217094,
0.6760848699399999,
0.68056969894,
0.67137780594,
0.68110179094,
0.67258894394,
0.67603368894,
0.67086509094
]
},
{
"command": "pnpr@main",
"mean": 0.6809179298400002,
"stddev": 0.006530024738246969,
"median": 0.6818764609400001,
"user": 0.34806854,
"system": 1.29652572,
"min": 0.66794376394,
"max": 0.69092839094,
"times": [
0.68154715194,
0.67569534594,
0.67677198394,
0.69092839094,
0.6879746329399999,
0.66794376394,
0.68220576994,
0.6789199849399999,
0.68413445094,
0.68305782294
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.6605931182200001,
"stddev": 0.007516390966497185,
"median": 0.65928016502,
"user": 0.6300747,
"system": 0.14985808,
"min": 0.64694320402,
"max": 0.6716810360200001,
"times": [
0.65698855002,
0.64694320402,
0.65844352602,
0.6709055030200001,
0.65475825002,
0.6648491870200001,
0.6640030760200001,
0.6716810360200001,
0.6601168040200001,
0.65724204602
]
},
{
"command": "pacquet@main",
"mean": 0.66310413702,
"stddev": 0.005434833450721759,
"median": 0.6618128535200001,
"user": 0.6314841999999999,
"system": 0.15229968,
"min": 0.65741152102,
"max": 0.67679758802,
"times": [
0.66394421902,
0.66176641302,
0.66052831802,
0.65741152102,
0.66176545202,
0.66185929402,
0.67679758802,
0.66580511602,
0.65799058202,
0.66317286702
]
},
{
"command": "pnpr@HEAD",
"mean": 0.10854755306,
"stddev": 0.0013206093714494232,
"median": 0.10813429202000001,
"user": 0.029664479999999997,
"system": 0.01943798,
"min": 0.10701324002,
"max": 0.11176623302000001,
"times": [
0.10714855902,
0.10806258402,
0.10765488402000001,
0.10833527602,
0.10803872902,
0.10785308302,
0.10707936002,
0.10879757502000001,
0.10736816202,
0.11044745502,
0.10701324002,
0.10853926702,
0.10923123802,
0.11117588402,
0.10811855202000001,
0.10840346302000001,
0.10875178002000001,
0.11150425002,
0.10829074402,
0.11176623302000001,
0.10788067802000001,
0.10813429202000001,
0.10767212002,
0.10844423002,
0.10797718802
]
},
{
"command": "pnpr@main",
"mean": 0.10815952042000002,
"stddev": 0.001379205006328495,
"median": 0.10795250202000001,
"user": 0.02842292,
"system": 0.019930299999999998,
"min": 0.10652693302,
"max": 0.11242412202,
"times": [
0.10809966002,
0.10753250602,
0.10803033802,
0.10673703802000001,
0.10825670002,
0.10822708202,
0.10742975802,
0.10865721702,
0.10786931002,
0.10723846102000001,
0.10710256102,
0.10795250202000001,
0.10830048802,
0.10699741102,
0.10839512802000001,
0.10719448902,
0.10884055902,
0.11242412202,
0.10652693302,
0.10846375602,
0.10975684902,
0.11161015502,
0.10683150202,
0.10784917002,
0.10766431502
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 6.679278493139999,
"stddev": 0.15800729277388903,
"median": 6.64091923574,
"user": 3.8229721999999997,
"system": 3.70542358,
"min": 6.49097904174,
"max": 6.94095900974,
"times": [
6.79464596874,
6.568902229740001,
6.62664841774,
6.91682247674,
6.512143386740001,
6.59343345374,
6.69306089274,
6.94095900974,
6.49097904174,
6.65519005374
]
},
{
"command": "pacquet@main",
"mean": 6.636146458840001,
"stddev": 0.14082753448839633,
"median": 6.606888893740001,
"user": 3.8453504999999994,
"system": 3.72883808,
"min": 6.44343201574,
"max": 6.977331413740001,
"times": [
6.567227878740001,
6.5856804787400005,
6.68346645074,
6.53516689274,
6.44343201574,
6.977331413740001,
6.603087680740001,
6.68086107774,
6.610690106740001,
6.67452059274
]
},
{
"command": "pnpr@HEAD",
"mean": 4.970423104940001,
"stddev": 0.08677921849241083,
"median": 4.94954406374,
"user": 2.8206416000000005,
"system": 3.23750218,
"min": 4.86133116674,
"max": 5.11729239774,
"times": [
5.11729239774,
4.9428535487400005,
4.95623457874,
4.86133116674,
4.983406046740001,
5.09639261674,
5.0202755767400005,
4.86220228174,
4.941468377740001,
4.92277445774
]
},
{
"command": "pnpr@main",
"mean": 5.023553614240001,
"stddev": 0.07291875472057589,
"median": 5.02051539074,
"user": 2.8234076000000004,
"system": 3.2949230799999993,
"min": 4.926424426740001,
"max": 5.16811131674,
"times": [
4.926424426740001,
5.005318899740001,
5.04824984774,
5.00222804974,
5.03571188174,
4.93090335074,
5.04911846474,
4.977767394740001,
5.09170250974,
5.16811131674
]
}
]
} |
|
| Branch | pr/13028 |
| Testbed | pnpr |
⚠️ 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-thresholdsflag.
Click to view all benchmark results
| Benchmark | Latency | milliseconds (ms) |
|---|---|---|
| isolated-linker.fresh-install.cold-cache.cold-store | 📈 view plot | 2,253.66 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 677.68 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 682.75 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 108.55 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 2,144.20 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 4,970.42 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 738.78 ms |
|
Thanks for this, and sorry it sat long enough to be overtaken. This is fixed on Your test scenarios are covered too — So I'm closing this as superseded rather than for any problem with it. One loose end you spotted that #13081 did not: the stale Sorry for the duplicated effort here, and thank you for the report and the fix. Written by an agent (Claude Code, claude-opus-4-8). |
Fixes #13025.
Problem
check_lockfile_freshnessstill carried its pre-workspaces TODO ("once workspaces land this becomes a per-project loop overlockfile.importers") and only rancheck_importer_satisfiesfor the root importer. Consequences:package.json(dependency added/removed without regenerating the lockfile) passedpnpm install --frozen-lockfilewith exit 0, and the drifted dependency was silently ignored — defeating the CI/Docker integrity gate.preferFrozenLockfile) short-circuited to frozen materialization in both situations instead of falling through to a fresh resolve.Root-manifest drift was already correctly rejected with
ERR_PNPM_OUTDATED_LOCKFILE.Fix
Loop over the already-built
project_manifestslist (root + every workspace project) and runcheck_importer_satisfiesper importer, deriving each importer id with the existingpacquet_workspace::importer_id_from_root_dir. This mirrors JS pnpm'sallProjectsAreUpToDateand the per-project loopoptimistic_repeat_installalready does. All threecheck_lockfile_freshnesscall sites (explicit frozen, auto-frozen dispatch, synthesized-lockfile) get the behavior.A project absent from
lockfile.importerssurfaces as the existingNoImportererror — fatal under--frozen-lockfile, fall-through to fresh resolve in the auto-frozen state. The--no-prefer-frozen-lockfileworkaround (and its bug-documenting comment) in thelockfile_onlytest is removed accordingly.Tests
New integration coverage in
workspace_install.rs:frozen_install_rejects_a_stale_workspace_project_manifest— sibling drift fails frozen with the outdated-lockfile error.frozen_install_rejects_a_workspace_project_missing_from_the_lockfile— new project with noimportersentry fails frozen, naming the importer.auto_frozen_path_falls_through_on_a_stale_workspace_project_manifest— default install resolves fresh, installs the drifted dep, and updates the lockfile.cargo test -p pacquet-package-manager(717 passed),-p pacquet-cli --test workspace_install --test lockfile_only(13 passed),cargo fmt --checkclean.Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Summary by CodeRabbit
Bug Fixes
pnpm install --frozen-lockfilenow validates every workspace project against the lockfile.Tests