Repository navigation
Conversation
…inksFromLockfile remap `remap_link_node_id` compared `lockfile_dir` against the link's `directory` verbatim, but a workspace link records that directory relative to the importer that declares it, so the lexical containment check never matched and every internal link was remapped to `link:<modules_dir>/<alias>` — feeding peer resolution a node id that should only stand in for links living outside the workspace. The lockfile then recorded the peer as `link:node_modules/<alias>`, a path relative to the lockfile root rather than to the importer that holds the symlink. Resolve the target against `project_dir` before the containment check, and thread each importer's root into `ResolvePeersOptions::project_dir` in the multi-importer walk (it already threads `modules_dir`). The same check also caught injected (`file:`) workspace dependencies, whose directory is relative to the lockfile dir. Upstream only remaps linked dependencies (`isLocal`, i.e. a non-`file:` directory resolution), so gate the remap on a `link:` id. Closes #13556 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The TypeScript CLI already keeps a workspace-internal `link:` out of the `excludeLinksFromLockfile` remap — its directory resolutions are absolute, so the containment check compares like with like — but nothing pinned that, and the counterpart pacquet check was comparing an importer-relative path with the lockfile root. This is the mirror of the Rust regression test that ships with that fix. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe resolver preserves workspace-internal ChangesWorkspace link resolution
Estimated code review effort: 3 (Moderate) | ~20 minutes Assessment against linked issues
Sequence Diagram(s)sequenceDiagram
participant WorkspacePeerResolver
participant remap_link_node_id
participant Lockfile
WorkspacePeerResolver->>remap_link_node_id: Set importer project_dir and modules_dir
remap_link_node_id->>remap_link_node_id: Resolve link target against project_dir
remap_link_node_id->>Lockfile: Preserve internal link or remap external link
Lockfile-->>WorkspacePeerResolver: Return peer graph identity
Possibly related PRs
Suggested labels: Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
PR Summary by QodoFix excludeLinksFromLockfile remap for workspace-internal link: deps
AI Description
Diagram
High-Level Assessment
Files changed (7)
|
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (4): Last reviewed commit: "test(pacquet): compare the two lockfiles..." | Re-trigger Greptile |
There was a problem hiding this comment.
🟢 Ready to approve
The fix is narrowly scoped, aligns with the stated root cause, and is covered by new unit and end-to-end regression tests plus an appropriate changeset for pacquet.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Pull request overview
Fixes pacquet’s excludeLinksFromLockfile behavior so workspace-internal link: deps (and injected file: workspace deps) are not incorrectly remapped during peer resolution, preventing invalid lockfile link: targets. The PR also adds regression tests on both the Rust (pacquet) and TypeScript sides to pin the shared expectation.
Changes:
- Update pacquet’s link-node-id remap logic to (a) only apply to
link:ids and (b) resolve importer-relative link targets against the current importer root before workspace-containment checks. - Thread each importer’s
root_dirintoResolvePeersOptions::project_dirduring the multi-importer peer-resolution walk. - Add targeted unit + e2e tests (Rust) and a mirrored TS test to prevent regressions; include a patch changeset for
pacquet.
File summaries
| File | Description |
|---|---|
| pnpm11/installing/deps-installer/test/install/excludeLinksFromLockfile.ts | Adds a TS regression test asserting workspace-internal link: deps keep stable lockfile refs under excludeLinksFromLockfile. |
| pnpm/crates/resolving-deps-resolver/src/resolve_peers/tests.rs | Adds a Rust regression test ensuring internal workspace links aren’t remapped during peer resolution in multi-importer mode. |
| pnpm/crates/resolving-deps-resolver/src/resolve_peers/context/tests.rs | Adds focused unit tests for internal vs external link remapping and ensures injected (file:) workspace deps aren’t remapped. |
| pnpm/crates/resolving-deps-resolver/src/resolve_peers/context.rs | Fixes remap_link_node_id to gate on link: ids and resolve importer-relative directories via project_dir before containment checks. |
| pnpm/crates/resolving-deps-resolver/src/resolve_peers.rs | Threads per-importer root_dir into ResolvePeersOptions::project_dir during workspace peer resolution. |
| pnpm/crates/cli/tests/exclude_links_from_lockfile.rs | Adds an end-to-end pacquet test asserting lockfile output is identical (modulo the setting line) for internal links with/without excludeLinksFromLockfile. |
| .changeset/exclude-links-keeps-workspace-internal-links.md | Adds a pacquet patch changeset describing the user-visible fix. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 0
- Review effort level: Lite
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
Code Review by Qodo
Context used✅ Compliance rules (platform):
24 rules 1.
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Micro-Benchmark ResultsLinux |
`append_workspace_yaml_key` asserts the key is absent before appending, so the test fails loudly if the harness template ever grows a `packages:` or `excludeLinksFromLockfile:` key of its own instead of silently writing a duplicate top-level mapping key. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Thanks — responses to the two Qodo findings: 1. Workspace YAML key duplication — fixed in 4f285e4. The e2e test now uses 2. Changeset missing Written by an agent (Claude Code, claude-opus-5[1m]). |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
pnpm/crates/cli/tests/exclude_links_from_lockfile.rs (1)
35-39: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winLog both lockfiles before comparing them with
assert_eq!.
with_setting.replace(...)andwithout_settingare fullpnpm-lock.yamlcontents, which can span many lines. On failure,assert_eq!output for two long multi-line strings is hard to read.Add an
eprintln!of both rendered values before theassert_eq!, matching the established convention for multi-line string assertions in this codebase.🔧 Proposed fix
+ let with_setting_normalized = + with_setting.replace("excludeLinksFromLockfile: true", "excludeLinksFromLockfile: false"); + eprintln!("WITH_SETTING (normalized):\n{with_setting_normalized}\n"); + eprintln!("WITHOUT_SETTING:\n{without_setting}\n"); assert_eq!( - with_setting.replace("excludeLinksFromLockfile: true", "excludeLinksFromLockfile: false"), + with_setting_normalized, without_setting, "only the recorded setting itself may differ", );Based on learnings, when a test uses
assert_eq!to compare string values that could span many lines, log the rendered values before the assertion usingeprintln!so reviewers can see the full multi-line difference in the test output.🤖 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/exclude_links_from_lockfile.rs` around lines 35 - 39, In the test comparing the normalized lockfile contents, add eprintln! statements immediately before the assert_eq! to print both with_setting.replace(...) and without_setting. Preserve the existing assertion and message while logging each full multi-line rendered value for easier failure diagnosis.Source: Learnings
🤖 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.
Nitpick comments:
In `@pnpm/crates/cli/tests/exclude_links_from_lockfile.rs`:
- Around line 35-39: In the test comparing the normalized lockfile contents, add
eprintln! statements immediately before the assert_eq! to print both
with_setting.replace(...) and without_setting. Preserve the existing assertion
and message while logging each full multi-line rendered value for easier failure
diagnosis.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: a37a0f6b-f3fe-40e4-b17e-93a77e400d76
📒 Files selected for processing (7)
.changeset/exclude-links-keeps-workspace-internal-links.mdpnpm/crates/cli/tests/exclude_links_from_lockfile.rspnpm/crates/resolving-deps-resolver/src/resolve_peers.rspnpm/crates/resolving-deps-resolver/src/resolve_peers/context.rspnpm/crates/resolving-deps-resolver/src/resolve_peers/context/tests.rspnpm/crates/resolving-deps-resolver/src/resolve_peers/tests.rspnpm11/installing/deps-installer/test/install/excludeLinksFromLockfile.ts
|
Code review by qodo was updated up to the latest commit 4f285e4 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
CODE_STYLE_GUIDE requires multi-line strings compared with `assert_eq!` to be logged with `eprintln!` first — a raw diff of two whole `pnpm-lock.yaml` files is unreadable in the failure output. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
There was a problem hiding this comment.
🟡 Not ready to approve
The new “external link” unit test currently uses a relative path that still normalizes under lockfile_dir, so it does not actually validate the intended external-link remap behavior and should be corrected.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Review details
Suppressed comments (1)
pnpm/crates/resolving-deps-resolver/src/resolve_peers/context/tests.rs:102
- The “external link” test case uses a relative directory of
../../../outside/lib, which (fromproject_dir = /ws/packages/appandlockfile_dir = /ws) still normalizes under/wsand is therefore workspace-internal. This makes the test assert a remap for a path that is not actually outsidelockfile_dir.
for directory in ["../../../outside/lib", "/outside/lib"] {
let dep = linked_package("lib", "link:../../../outside/lib", directory);
- Files reviewed: 7/7 changed files
- Comments generated: 0 new
- Review effort level: Lite
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
|
@copilot-pull-request-reviewer the "external link" case is correct — From so the joined target normalizes to The test is also self-checking on this point: it asserts the target is remapped ( No change made. Written by an agent (Claude Code, claude-opus-5[1m]). |
|
Code review by qodo was updated up to the latest commit 400bc93 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Parse both `pnpm-lock.yaml` files into `Lockfile` and assert on the snapshot key and the peer's `SnapshotDepRef` instead of substring matching, then flip `settings.excludeLinksFromLockfile` on the parsed value before the equality check. The invariant is that the setting changes nothing else — not that the two files serialize byte-for-byte — so an unrelated formatting or key-ordering change should not fail this test. Logging follows the guide's rule for complex structures (`dbg!`). Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
There was a problem hiding this comment.
🟢 Ready to approve
The fix is narrowly scoped, uses the existing lexical-normalized subdir check correctly, and is covered by targeted unit + end-to-end regression tests (with a mirrored TS expectation).
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 0 new
- Review effort level: Lite
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
|
Responses to the second round of Qodo findings: 1. Brittle lockfile string compare — fixed in 979284d. Both lockfiles are now parsed into 3. Noisy stderr in passing test — not applying.
CodeRabbit raised the opposite nitpick on the same lines. The structural rewrite moves this to 2. Changeset missing Written by an agent (Claude Code, claude-opus-5[1m]). |
|
Code review by qodo was updated up to the latest commit 979284d |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
There was a problem hiding this comment.
🟢 Ready to approve
The remap fix is narrowly scoped, matches the documented root cause, and is backed by targeted unit tests plus an end-to-end regression test (with an appropriate pacquet changeset).
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 0 new
- Review effort level: Lite
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #13563 +/- ##
=======================================
Coverage 87.94% 87.95%
=======================================
Files 556 556
Lines 97218 97225 +7
=======================================
+ Hits 85502 85511 +9
+ Misses 11716 11714 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Integrated-Benchmark Report (Linux)Commit: 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
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.58443673844,
"stddev": 0.13986941051946333,
"median": 2.6357710598399997,
"user": 1.5263607399999999,
"system": 1.30030836,
"min": 2.3691922543399997,
"max": 2.73415510234,
"times": [
2.65442083034,
2.3691922543399997,
2.73067192234,
2.6290178323399997,
2.4784488263399997,
2.44198889134,
2.73054052634,
2.73415510234,
2.64252428734,
2.43340691134
]
},
{
"command": "pacquet@main",
"mean": 2.5438864411399997,
"stddev": 0.14522218612534166,
"median": 2.54561781484,
"user": 1.53084924,
"system": 1.2473683599999998,
"min": 2.3606872593399997,
"max": 2.73771268934,
"times": [
2.42854793134,
2.3606872593399997,
2.41438774034,
2.5246510773399997,
2.7040125913399997,
2.36812188534,
2.5665845523399997,
2.73771268934,
2.6467058093399998,
2.68745287534
]
},
{
"command": "pnpr@HEAD",
"mean": 1.61093884014,
"stddev": 0.15891405881246634,
"median": 1.6635431238400002,
"user": 1.03146764,
"system": 1.1744644599999998,
"min": 1.38092619534,
"max": 1.7823164313400002,
"times": [
1.7823164313400002,
1.62435465734,
1.7027315903400002,
1.42289454434,
1.74686835034,
1.38092619534,
1.75281621534,
1.57298102434,
1.39418702734,
1.72931236534
]
},
{
"command": "pnpr@main",
"mean": 1.5251469397400004,
"stddev": 0.17227604758729959,
"median": 1.48943181134,
"user": 1.0748082399999999,
"system": 1.1096627599999997,
"min": 1.35076044034,
"max": 1.82148077634,
"times": [
1.44902246934,
1.82148077634,
1.76628796134,
1.3930875493400001,
1.52984115334,
1.3633659713400001,
1.35076044034,
1.5844614863400002,
1.3621227283400001,
1.6310388613400002
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.26313557992000003,
"stddev": 0.007050761370687851,
"median": 0.26638120872000004,
"user": 0.21556704,
"system": 0.53050172,
"min": 0.24878245122,
"max": 0.27134678422,
"times": [
0.25766980322,
0.26001042622000003,
0.26701309022,
0.24878245122,
0.26620674622,
0.26655567122,
0.25688480822000004,
0.26726663522,
0.27134678422,
0.26961938322
]
},
{
"command": "pacquet@main",
"mean": 0.25318635342,
"stddev": 0.005690136496642353,
"median": 0.25545201522000005,
"user": 0.20369864,
"system": 0.51732912,
"min": 0.24012540222,
"max": 0.25786154222,
"times": [
0.24649474822,
0.24012540222,
0.25714617922,
0.25216512022000004,
0.25686187722000003,
0.25549425922,
0.25342854122,
0.25786154222,
0.25540977122,
0.25687609322
]
},
{
"command": "pnpr@HEAD",
"mean": 0.27048357162,
"stddev": 0.007184374525446858,
"median": 0.26877788772,
"user": 0.21529133999999997,
"system": 0.5298949199999999,
"min": 0.26165767822,
"max": 0.28636290022,
"times": [
0.26646172422000003,
0.26865020322,
0.27295367122,
0.27727906022000004,
0.26165767822,
0.26574083322000003,
0.26459726622,
0.26890557222,
0.27222680722000003,
0.28636290022
]
},
{
"command": "pnpr@main",
"mean": 0.27425318262000004,
"stddev": 0.005701299491719553,
"median": 0.27273703372,
"user": 0.22173414,
"system": 0.54971232,
"min": 0.26858626322,
"max": 0.28400145722000003,
"times": [
0.28400145722000003,
0.26863852222,
0.27140093622,
0.27844177122,
0.27407313122,
0.28052350822,
0.26875978822,
0.26966063022000003,
0.26858626322,
0.27844581822000003
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.6253005933,
"stddev": 0.022498454957921268,
"median": 2.6267214275999997,
"user": 1.5211347,
"system": 1.29867422,
"min": 2.5923855061,
"max": 2.6564965200999997,
"times": [
2.5982872260999996,
2.6540963041,
2.6232796681,
2.6107004591,
2.6306158071,
2.6301631871,
2.6465270281,
2.6564965200999997,
2.6104542271,
2.5923855061
]
},
{
"command": "pacquet@main",
"mean": 2.6156697129,
"stddev": 0.025066766259403996,
"median": 2.6155696520999996,
"user": 1.5333435999999998,
"system": 1.30242112,
"min": 2.5738630241,
"max": 2.6557442371,
"times": [
2.6297979621,
2.6105719571,
2.6059425501,
2.5916413401,
2.6557442371,
2.5957782541,
2.6205673470999997,
2.6443006800999997,
2.6284897771,
2.5738630241
]
},
{
"command": "pnpr@HEAD",
"mean": 1.6114334018,
"stddev": 0.14516569828063486,
"median": 1.6480558641000003,
"user": 1.0457153,
"system": 1.1423242200000001,
"min": 1.4426625791,
"max": 1.8124997461,
"times": [
1.7184783371,
1.4585139301,
1.6621701591000002,
1.8124997461,
1.4426625791,
1.6884668021,
1.4545056061,
1.6339415691,
1.7828820201,
1.4602132691
]
},
{
"command": "pnpr@main",
"mean": 1.6659912355,
"stddev": 0.14722824872914472,
"median": 1.6857155086,
"user": 1.0448252,
"system": 1.14310752,
"min": 1.4356406511000002,
"max": 1.8357993751,
"times": [
1.7879050271,
1.6888928621000001,
1.6268560110999999,
1.7678546971,
1.6825381551,
1.4356406511000002,
1.8254362851000001,
1.5678792251,
1.8357993751,
1.4411100661
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.40973433408000004,
"stddev": 0.008377966322058486,
"median": 0.4113915690800001,
"user": 0.51428278,
"system": 0.7136506399999998,
"min": 0.39580794958000004,
"max": 0.42268017558000004,
"times": [
0.40387280758000005,
0.40715798358000005,
0.41186645058000004,
0.41965954558,
0.41091668758000005,
0.41356704058000004,
0.41226124058,
0.42268017558000004,
0.39580794958000004,
0.39955345958000005
]
},
{
"command": "pacquet@main",
"mean": 0.40581224298000007,
"stddev": 0.00469084251407146,
"median": 0.4058074810800001,
"user": 0.50228098,
"system": 0.7245004399999999,
"min": 0.39814077758000005,
"max": 0.41459173158000007,
"times": [
0.40750200558000005,
0.40620010258000006,
0.40541485958000006,
0.40039202258000006,
0.40294006558000006,
0.41459173158000007,
0.40515413958,
0.39814077758000005,
0.40986642358,
0.40792030158000003
]
},
{
"command": "pnpr@HEAD",
"mean": 0.30679001508000003,
"stddev": 0.005285184848541561,
"median": 0.30656860408000003,
"user": 0.21196158,
"system": 0.5347809399999999,
"min": 0.29864504858,
"max": 0.31336633458,
"times": [
0.30766140958000004,
0.29944578158,
0.31084384158000006,
0.30520438858000004,
0.30340047258,
0.31336633458,
0.29864504858,
0.31089404558000006,
0.31296302958000005,
0.30547579858
]
},
{
"command": "pnpr@main",
"mean": 0.30521076888000004,
"stddev": 0.006751730223004779,
"median": 0.30518588308000005,
"user": 0.20754067999999998,
"system": 0.5141010399999999,
"min": 0.29525751158,
"max": 0.31507239658,
"times": [
0.31007577958000004,
0.29909893958000006,
0.29714084558000003,
0.29525751158,
0.30224232958,
0.30519713458000003,
0.31047955758,
0.31236856258,
0.31507239658,
0.30517463158
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.7469075889399999,
"stddev": 0.009378942275070475,
"median": 1.7441984967400002,
"user": 0.74852248,
"system": 0.76973608,
"min": 1.73544345624,
"max": 1.76896957424,
"times": [
1.7471512992400002,
1.74226959624,
1.76896957424,
1.74572981024,
1.7435018302400003,
1.74448122724,
1.74391576624,
1.75645243324,
1.73544345624,
1.74116089624
]
},
{
"command": "pacquet@main",
"mean": 1.7342026632400003,
"stddev": 0.01035797492546845,
"median": 1.7299727147400001,
"user": 0.7486567799999999,
"system": 0.73457418,
"min": 1.7241763732400002,
"max": 1.7568563512400002,
"times": [
1.7245785362400001,
1.7293007792400001,
1.74250342624,
1.7306446502400001,
1.7434318582400001,
1.72765624324,
1.7337142112400001,
1.72916420324,
1.7241763732400002,
1.7568563512400002
]
},
{
"command": "pnpr@HEAD",
"mean": 0.31254488014000004,
"stddev": 0.006928108127270687,
"median": 0.31004249974000003,
"user": 0.20940867999999999,
"system": 0.54092548,
"min": 0.30251681224000004,
"max": 0.32349170524000004,
"times": [
0.30802735324,
0.31001417124,
0.31007082824000004,
0.32260714524000006,
0.30880628524000003,
0.31291067724000005,
0.30251681224000004,
0.32349170524000004,
0.31904572124,
0.30795810224000003
]
},
{
"command": "pnpr@main",
"mean": 0.30849236154000004,
"stddev": 0.005816699225586987,
"median": 0.31125146874000004,
"user": 0.20206397999999998,
"system": 0.5426111799999999,
"min": 0.29827935824,
"max": 0.31619706524,
"times": [
0.31194842124000005,
0.30242424724000005,
0.31219680724000004,
0.30210549024000005,
0.31277312924000006,
0.29827935824,
0.31135507824,
0.30649615924,
0.31619706524,
0.31114785924000005
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.18122471955846153,
"stddev": 0.011921067072177367,
"median": 0.17874026702,
"user": 0.16770552307692307,
"system": 0.06353951846153845,
"min": 0.17256104102,
"max": 0.21793549202,
"times": [
0.21793549202,
0.17874026702,
0.17903302502000001,
0.17598310102,
0.18106203302,
0.17256104102,
0.17458580902,
0.17307129702000001,
0.17764432002,
0.18007387002,
0.17492975502,
0.18020219002,
0.19009915402
]
},
{
"command": "pacquet@main",
"mean": 0.18327091764500003,
"stddev": 0.0060802530629187794,
"median": 0.18156772202,
"user": 0.1668259125,
"system": 0.0693911675,
"min": 0.17556842402,
"max": 0.19273135302,
"times": [
0.18031522202,
0.17567151702,
0.17569204602,
0.18142543502,
0.17884987202,
0.17556842402,
0.17899513502,
0.17864956602,
0.18171000902,
0.18656250602,
0.19170007802,
0.19149660602000002,
0.18678794902,
0.19273135302,
0.19013967902,
0.18603928502
]
},
{
"command": "pnpr@HEAD",
"mean": 0.08700558753515153,
"stddev": 0.001360083639773651,
"median": 0.08740495102000001,
"user": 0.01928320606060606,
"system": 0.009150616363636366,
"min": 0.08295692402000002,
"max": 0.08878854702000001,
"times": [
0.08548408602000002,
0.08790164202000002,
0.08776570802000001,
0.08671339302000002,
0.08878854702000001,
0.08794325102000002,
0.08702854502000001,
0.08790272502000002,
0.08615090802000001,
0.08800209102,
0.08691938002,
0.08756290702000001,
0.08303025102000001,
0.08752147002,
0.08740495102000001,
0.08713384202,
0.08295692402000002,
0.08666242702000002,
0.08423276802000002,
0.08631358302000001,
0.08767543802000001,
0.08824812402000001,
0.08677484802000002,
0.08799829402,
0.08751997802000001,
0.08786057602000001,
0.08734985802000002,
0.08843156802000002,
0.08750653102000001,
0.08661767302000001,
0.08783771302000001,
0.08657771802000001,
0.08736667002000001
]
},
{
"command": "pnpr@main",
"mean": 0.08623985695939394,
"stddev": 0.002063824239202962,
"median": 0.08707705602000002,
"user": 0.019288781818181815,
"system": 0.008950223636363637,
"min": 0.08236647602000001,
"max": 0.08852863002000001,
"times": [
0.08648340202000002,
0.08281490802000001,
0.08757458902000001,
0.08787515402000001,
0.08684980002,
0.08775125002,
0.08760619902000001,
0.08806450802000002,
0.08606856302000002,
0.08296366702,
0.08751474602,
0.08253078402000001,
0.08792668002000001,
0.08684748402000002,
0.08265023802000002,
0.08850842102,
0.08686991702,
0.08730785902000002,
0.08762387102000001,
0.08745726002000001,
0.08703004802000001,
0.08761712802000002,
0.08236647602000001,
0.08852863002000001,
0.08638264302000001,
0.08281172202,
0.08728524602000001,
0.08292185802000002,
0.08748796602000002,
0.08707705602000002,
0.08685147202000001,
0.08311367702000001,
0.08715205702
]
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.7133512909088888,
"stddev": 0.44157248843857555,
"median": 1.7660121970200002,
"user": 1.6022429244444443,
"system": 0.2078058022222222,
"min": 0.9090747170200001,
"max": 2.40728241502,
"times": [
0.9090747170200001,
1.40674985102,
2.40728241502,
1.7660121970200002,
1.62384100502,
2.03808595402,
1.37916272402,
1.9786232320200001,
1.91132952302
]
},
{
"command": "pacquet@main",
"mean": 2.0362516226866667,
"stddev": 0.649128888044029,
"median": 1.76189229402,
"user": 1.914259702222222,
"system": 0.23691735777777778,
"min": 1.4216704450200002,
"max": 3.25635674702,
"times": [
1.46137974202,
1.4216704450200002,
1.76189229402,
1.6277597300200002,
2.11591973502,
1.49094376902,
2.55349338902,
2.63684875302,
3.25635674702
]
},
{
"command": "pnpm@HEAD",
"mean": 3.0639517023533336,
"stddev": 0.07948560687509616,
"median": 3.04086051602,
"user": 4.69895748,
"system": 0.25359435777777783,
"min": 2.95977960102,
"max": 3.2314554920200003,
"times": [
3.07431171802,
3.0065254550200002,
3.02694807502,
3.01735340702,
3.04086051602,
2.95977960102,
3.10338664702,
3.2314554920200003,
3.11494441002
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.58127262444,
"stddev": 0.15846586042067837,
"median": 4.49575656634,
"user": 1.6937790200000002,
"system": 1.3722616200000002,
"min": 4.43807913084,
"max": 4.85556153884,
"times": [
4.52085338584,
4.85556153884,
4.73838409584,
4.46194545584,
4.44995154684,
4.67182280184,
4.75940211984,
4.47065974684,
4.43807913084,
4.44606642184
]
},
{
"command": "pacquet@main",
"mean": 4.493258895239999,
"stddev": 0.06411873081689047,
"median": 4.47073047584,
"user": 1.74161182,
"system": 1.34537562,
"min": 4.44038244584,
"max": 4.65814424884,
"times": [
4.46672489284,
4.52390711284,
4.44038244584,
4.4849495068400005,
4.4747360588400005,
4.65814424884,
4.45777079784,
4.51663845084,
4.44524085184,
4.46409458584
]
},
{
"command": "pnpr@HEAD",
"mean": 3.54579071244,
"stddev": 0.08751745544260137,
"median": 3.52782540784,
"user": 1.19320472,
"system": 1.26422582,
"min": 3.44054668384,
"max": 3.70584297984,
"times": [
3.49469198384,
3.52255519684,
3.54268501684,
3.44872882984,
3.67222028884,
3.44054668384,
3.53309561884,
3.50696279384,
3.59057773184,
3.70584297984
]
},
{
"command": "pnpr@main",
"mean": 3.6016930999400003,
"stddev": 0.1505283057763875,
"median": 3.5125838848399997,
"user": 1.17966832,
"system": 1.2394752199999999,
"min": 3.45703369884,
"max": 3.83778882284,
"times": [
3.76181653284,
3.4693807958400003,
3.67752673684,
3.48465286384,
3.51204537384,
3.83778882284,
3.51312239584,
3.45703369884,
3.50385128084,
3.79971249784
]
}
]
} |
|
| Project | pnpm's project |
| Branch | pr/13563 |
| 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 | 1,442.66 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 302.52 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 298.65 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 82.96 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,380.93 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,440.55 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 261.66 ms |
Summary
With
excludeLinksFromLockfileenabled, pacquet remapped workspace-internallink:dependencies, even though the setting exists only to keep the machine-dependent path of an external link out of the lockfile. Closes #13556.remap_link_node_idcomparedlockfile_dirwith the link'sdirectoryverbatim, but a workspace link records that directory relative to the importer that declares it (resolve_from_workspace.rs), andpacquet_fs::is_subdiris purely lexical.is_subdir("/ws", "../lib")isfalse, so the guard never fired and the internal link was remapped tolink:<modules_dir>/<alias>.The user-visible effect is confirmed end-to-end (new
pnpm/crates/cli/tests/exclude_links_from_lockfile.rs): an internal link resolving a peer dependency was written asinstead of
(@pnpm.e2e/peer-a@packages+peer-a)/link:packages/peer-a. The remapped ref is relative to the lockfile root while the symlink lives under the importer, so the recorded target does not exist.Parity. The TypeScript CLI has the same remap (
installing/deps-resolver/src/index.ts), and it is correct there because its directory resolutions for links are absolute (resolveFromLocalPackagekeepslocalPackageDir; the local resolver resolves the target). So this is a pacquet-only fix, and I added the matching TS test so the shared expectation is pinned on both sides.Second bug from the same check. Injected (
file:) workspace deps were remapped too — their directory is relative to the lockfile dir, so the containment check missed them as well. Upstream only remaps linked dependencies (isLocal, i.e. a non-file:directory resolution), so the remap is now gated on alink:id.Squash Commit Body
Checklist
already linked to it solves it.
pnpm/port, or the description notes what still needs porting.pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
Written by an agent (Claude Code, claude-opus-5[1m]).
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
Bug Fixes
link:dependencies retain their original paths and peer suffixes when link entries are excluded.file:dependencies instead of remapping them.Tests