Repository navigation
Conversation
The rc block written by `pnpm setup` skipped the prepend whenever `$PNPM_HOME/bin` was anywhere on PATH. A login shell that inherits PATH (the VS Code terminal on macOS) runs path_helper before the rc file, which moves the inherited entry behind the system paths, so another `node` shadowed the global runtime shim. The guard now skips only when the entry is already at the adding position: first for start, last for end. Fish gets the same check via `$PATH[1]` / `$PATH[-1]`. A block that exactly matches what earlier versions rendered is replaced without `--force`, so re-running `pnpm setup` upgrades it. Fixed in both stacks. Closes #16635 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthroughPOSIX shell and fish setup now check whether the configured directory is at the requested end of ChangesPATH setup behavior
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: Medium Assessment against linked issues
Suggested labels: Merge Risk: ⚪ Minimal · up to This change makes pnpm setup keep the pnpm bin directory at the requested position in PATH and replaces older generated shell blocks automatically. No merge-blocking risk was identified. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change restores the requested executable precedence and limits automatic replacement to recognized generated configuration. No introduced security issue was identified in the inspected setup paths. Concurrent configuration edits and broader shell-input handling remain limitations. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
🧰 Additional context used📚 Code guidelines (3)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 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #16636 +/- ##
==========================================
- Coverage 92.35% 92.34% -0.02%
==========================================
Files 1589 1589
Lines 209921 209969 +48
==========================================
+ Hits 193869 193891 +22
- Misses 16052 16078 +26 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Micro-Benchmark ResultsLinux |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
PR Summary by QodoKeep PNPM_HOME/bin first on PATH in login shells
AI Description
Diagram
High-Level Assessment
Files changed (5)
|
Code Review by Qodo
1.
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Same-run regression checkHEAD 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.
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; 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
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.4750703497,
"stddev": 0.15780660830074497,
"median": 2.5024945678,
"user": 1.3141202599999997,
"system": 1.4136236599999998,
"min": 2.2604009863,
"max": 2.6968040943
},
{
"command": "pacquet@main",
"mean": 2.3736228084,
"stddev": 0.1121737004946011,
"median": 2.3450439368,
"user": 1.3408645600000002,
"system": 1.4188204599999998,
"min": 2.2619254483,
"max": 2.6034572863
},
{
"command": "pnpr@HEAD",
"mean": 1.4368778711999999,
"stddev": 0.11497812100229808,
"median": 1.4493661548,
"user": 1.1970800599999998,
"system": 1.3235986599999998,
"min": 1.2914811773000001,
"max": 1.6221245303
},
{
"command": "pnpr@main",
"mean": 1.4360205655000002,
"stddev": 0.10796116998372239,
"median": 1.4318243898,
"user": 1.2060514599999999,
"system": 1.2686894599999998,
"min": 1.3031411933000001,
"max": 1.6329897343000002
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.31067205768,
"stddev": 0.020604842162810607,
"median": 0.30918601068,
"user": 0.36930752,
"system": 0.6996094600000001,
"min": 0.27367230018,
"max": 0.34544966718
},
{
"command": "pacquet@main",
"mean": 0.33225633107999997,
"stddev": 0.06162736931632491,
"median": 0.31678236368,
"user": 0.41001852000000005,
"system": 0.76509926,
"min": 0.27838977918,
"max": 0.44738069618
},
{
"command": "pnpr@HEAD",
"mean": 0.34571289048000003,
"stddev": 0.040029824667357654,
"median": 0.33433476418,
"user": 0.37009981999999997,
"system": 0.73032476,
"min": 0.30806014818,
"max": 0.45196107518
},
{
"command": "pnpr@main",
"mean": 0.38721853278,
"stddev": 0.04166970533045206,
"median": 0.37535445468,
"user": 0.4403322199999999,
"system": 0.7899239599999999,
"min": 0.32927787618,
"max": 0.46008521018000004
}
]
}Scenario: Isolated linker: repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.02136328197,
"stddev": 0.0034638926785608586,
"median": 0.021170269220000003,
"user": 0.010442724583333335,
"system": 0.012738912916666666,
"min": 0.014190453220000001,
"max": 0.02844497522
},
{
"command": "pacquet@main",
"mean": 0.023046025176896554,
"stddev": 0.004994639508047476,
"median": 0.022967339720000004,
"user": 0.011848144482758614,
"system": 0.012740428965517242,
"min": 0.01397579822,
"max": 0.03554923822
},
{
"command": "pnpr@HEAD",
"mean": 0.018710609742522522,
"stddev": 0.0032997020089035704,
"median": 0.01787069022,
"user": 0.009683490630630634,
"system": 0.011002841441441443,
"min": 0.012833854220000001,
"max": 0.027915943220000003
},
{
"command": "pnpr@main",
"mean": 0.01991089917757577,
"stddev": 0.003461603196448378,
"median": 0.01952855322,
"user": 0.010483339636363633,
"system": 0.011390971151515149,
"min": 0.013199745220000001,
"max": 0.028172127220000003
}
]
}Scenario: Isolated linker: repeat install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.010978042610526319,
"stddev": 0.0013789911871144166,
"median": 0.010877218400000003,
"user": 0.006189632894736843,
"system": 0.005815805526315791,
"min": 0.008405468900000001,
"max": 0.0159895619
},
{
"command": "pacquet@main",
"mean": 0.012182767286973182,
"stddev": 0.003997969500410167,
"median": 0.010293406900000001,
"user": 0.007250117241379311,
"system": 0.005935886130268195,
"min": 0.0078550249,
"max": 0.024513560900000002
},
{
"command": "pnpr@HEAD",
"mean": 0.011447414162068964,
"stddev": 0.0027449171054928986,
"median": 0.011047118900000001,
"user": 0.007281993103448275,
"system": 0.0052007508965517205,
"min": 0.0075924299,
"max": 0.0215912309
},
{
"command": "pnpr@main",
"mean": 0.010603655294531248,
"stddev": 0.001467024342254132,
"median": 0.010256639400000002,
"user": 0.0061505078125,
"system": 0.005360461406249998,
"min": 0.0079391109,
"max": 0.014967349900000001
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.5092502182400005,
"stddev": 0.07696533013250638,
"median": 2.4909602906400004,
"user": 1.8348333399999999,
"system": 1.6169574799999995,
"min": 2.4542338801400003,
"max": 2.7249894661400003
},
{
"command": "pacquet@main",
"mean": 2.5281375398400003,
"stddev": 0.05496870953706131,
"median": 2.52236766514,
"user": 1.9469861399999995,
"system": 1.57304828,
"min": 2.46167685114,
"max": 2.63839918014
},
{
"command": "pnpr@HEAD",
"mean": 1.6920851600400002,
"stddev": 0.14848839517864085,
"median": 1.63813426914,
"user": 1.7279502399999997,
"system": 1.73896148,
"min": 1.55450969314,
"max": 2.02172624014
},
{
"command": "pnpr@main",
"mean": 1.80473221914,
"stddev": 0.09634608781782648,
"median": 1.8033199506400002,
"user": 2.15746164,
"system": 2.21446498,
"min": 1.6509898951400002,
"max": 1.9437214551400002
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.59139078292,
"stddev": 0.03363515859391515,
"median": 0.5949047432200001,
"user": 0.8541943599999999,
"system": 1.0209747599999999,
"min": 0.5312101152200001,
"max": 0.64796096122
},
{
"command": "pacquet@main",
"mean": 0.6604088865200001,
"stddev": 0.04003363657528628,
"median": 0.66593998922,
"user": 0.96312216,
"system": 1.1427510599999997,
"min": 0.58810903122,
"max": 0.7174296952200001
},
{
"command": "pnpr@HEAD",
"mean": 0.40389970892000004,
"stddev": 0.010934124830017858,
"median": 0.39944658172,
"user": 0.40291215999999996,
"system": 0.8696964600000001,
"min": 0.39468194522000005,
"max": 0.42894712322000006
},
{
"command": "pnpr@main",
"mean": 0.4135912063200001,
"stddev": 0.016891085053062194,
"median": 0.41206518772000006,
"user": 0.39509866000000005,
"system": 0.8899116599999999,
"min": 0.38604535222,
"max": 0.44229125222000004
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.7681027577000001,
"stddev": 0.05151768641888964,
"median": 1.7705441226,
"user": 1.17231842,
"system": 1.20670388,
"min": 1.6932728631,
"max": 1.8735458881
},
{
"command": "pacquet@main",
"mean": 1.7944353044000003,
"stddev": 0.06588354061594995,
"median": 1.7673270931,
"user": 1.26456452,
"system": 1.27336158,
"min": 1.7431142981,
"max": 1.9576987531
},
{
"command": "pnpr@HEAD",
"mean": 0.36584527160000013,
"stddev": 0.007321166996295408,
"median": 0.3664355021,
"user": 0.34763392,
"system": 0.79157218,
"min": 0.3534502161,
"max": 0.37611737510000004
},
{
"command": "pnpr@main",
"mean": 0.36753110800000005,
"stddev": 0.012120733746210404,
"median": 0.3680755136,
"user": 0.37065172,
"system": 0.7722211799999998,
"min": 0.35160511510000003,
"max": 0.3848239631
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.2626144847033333,
"stddev": 0.024048791844033354,
"median": 0.26033838362000006,
"user": 0.2499519,
"system": 0.11014882,
"min": 0.23391853962000003,
"max": 0.31489332562000005
},
{
"command": "pacquet@main",
"mean": 0.3503986500200001,
"stddev": 0.025312588750961124,
"median": 0.3544918771200001,
"user": 0.3669294,
"system": 0.15230441999999997,
"min": 0.30396034162,
"max": 0.38108668962000003
},
{
"command": "pnpr@HEAD",
"mean": 0.13548972481047616,
"stddev": 0.006197988048354168,
"median": 0.13520627662,
"user": 0.06844230476190478,
"system": 0.02590834380952381,
"min": 0.12169337362,
"max": 0.14613574562000003
},
{
"command": "pnpr@main",
"mean": 0.13989317949500005,
"stddev": 0.02155963812445696,
"median": 0.13478405862000004,
"user": 0.06143135833333333,
"system": 0.03288119500000001,
"min": 0.11419022562,
"max": 0.22319411262000002
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.2486975506777778,
"stddev": 0.01870236713834125,
"median": 0.2526865369,
"user": 0.2586524288888889,
"system": 0.04787640444444444,
"min": 0.22159365690000002,
"max": 0.2801214299
},
{
"command": "pacquet@main",
"mean": 0.2327727046777778,
"stddev": 0.02294272543036303,
"median": 0.23156456890000002,
"user": 0.2341906511111111,
"system": 0.04683940444444444,
"min": 0.20342191790000003,
"max": 0.2743530079
},
{
"command": "pnpm@HEAD",
"mean": 4.154700881677778,
"stddev": 0.3445452580160133,
"median": 4.0071011559,
"user": 6.314500095555555,
"system": 0.45090729333333335,
"min": 3.8155056229,
"max": 4.7747188919
}
]
}Scenario: Isolated linker: linked-workspace resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.23326488624,
"stddev": 0.01383700077234994,
"median": 0.23143653874000003,
"user": 0.19279306666666662,
"system": 0.08477668999999999,
"min": 0.21762851024000002,
"max": 0.26135004124000005
},
{
"command": "pacquet@main",
"mean": 0.24178410660363633,
"stddev": 0.013706884774121325,
"median": 0.24231755424,
"user": 0.1923579,
"system": 0.09625462181818181,
"min": 0.21583111024,
"max": 0.26653524224
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 5.11642651068,
"stddev": 0.2837866838747116,
"median": 5.18026690618,
"user": 2.3788949800000005,
"system": 2.21172168,
"min": 4.6072241601799995,
"max": 5.561163834179999
},
{
"command": "pacquet@main",
"mean": 4.72466424998,
"stddev": 0.1919601886414577,
"median": 4.69285026418,
"user": 2.0008102800000005,
"system": 1.9258864800000002,
"min": 4.4754521151799995,
"max": 5.09659669718
},
{
"command": "pnpr@HEAD",
"mean": 3.8240944758800004,
"stddev": 0.21060848144769154,
"median": 3.7810363896800006,
"user": 2.16053818,
"system": 1.96839468,
"min": 3.5934911031800003,
"max": 4.31148348418
},
{
"command": "pnpr@main",
"mean": 3.77350682848,
"stddev": 0.1825465770599294,
"median": 3.7363296736800002,
"user": 1.9213238799999999,
"system": 1.8287671799999998,
"min": 3.5566483891800003,
"max": 4.1430818261799995
}
]
}Scenario: GVS linker: fresh restore, hot cache + hot storeSame 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.
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.2061226600909091,
"stddev": 0.018617431575449365,
"median": 0.209327381,
"user": 0.25538474181818177,
"system": 0.17168830545454544,
"min": 0.17400052900000001,
"max": 0.23394751200000002
},
{
"command": "pacquet@main",
"mean": 0.21972376050000003,
"stddev": 0.02463927078705682,
"median": 0.21343759550000002,
"user": 0.26374036,
"system": 0.17992835999999998,
"min": 0.19285586600000001,
"max": 0.263594665
},
{
"command": "pnpr@HEAD",
"mean": 0.20704222627272728,
"stddev": 0.020525425774589136,
"median": 0.19669598100000002,
"user": 0.25115365090909086,
"system": 0.16196385090909088,
"min": 0.186312631,
"max": 0.24123918800000002
},
{
"command": "pnpr@main",
"mean": 0.21635635592307698,
"stddev": 0.03162705245115252,
"median": 0.203794426,
"user": 0.2589587138461539,
"system": 0.16922375999999997,
"min": 0.18008246500000002,
"max": 0.280084378
}
]
} |
pnpm v11 wrote the PNPM_HOME value in double quotes, while v12 single- quotes it, so the exact-match migration in v12 missed every block a v11 `pnpm setup` wrote and still demanded --force. Accept both renderings. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
On Qodo's second finding (one changeset targeting both Written by an agent (Claude Code, claude-opus-5-5). |
|
Code review by qodo was updated up to the latest commit 5395920 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Run the generated zsh block under sh, sourced twice, and check that the pnpm bin directory ends up first on PATH. The case from #7799 (the directory already on PATH but behind another entry) is covered, along with the directory already first and the directory missing. The fix itself landed in #16636; the Rust CLI already has the equivalent test. --------- Co-authored-by: Cursor Agent <[email protected]> Co-authored-by: Zoltan Kochan <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
Summary
pnpm setupwrites an rc block that skips thePATHprepend whenever$PNPM_HOME/binis anywhere onPATH. A login shell that inheritsPATH(the VS Code terminal on macOS) runspath_helperbefore.zshrc, which moves the inherited entry behind the system paths. The guard then saw the entry and skipped the prepend, so Homebrew's or the system'snodeshadowed thenodeshim frompnpm runtime set node -g.The guard now skips only when the entry is already first (or last, for the
endposition). Fixed in both the Rust CLI (pnpm/crates/cli/src/cli_args/setup/path_extender/posix.rs) and v11 (@pnpm/os.env.path-extender-posix), for sh-family shells and fish.Closes #16635
Squash Commit Body
Checklist
already linked to it solves it.
are implemented in every affected version.
pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
Verified by sourcing the new block twice in sh, bash, zsh and fish with
PATHset to/usr/bin:$PNPM_HOME/bin:/bin,$PNPM_HOME/bin:/usr/binand/usr/bin.$PNPM_HOME/binended up first in every case. A Rust test runs the rendered block through/bin/sh. The v11 migration tests fail with the outdated-block exception removed. Not tested on macOS itself.Written by an agent (Claude Code, claude-opus-5-5).
🤖 Generated with Claude Code
Summary by CodeRabbit
pnpm setupnow checks the requested end ofPATHwhen adding a directory, matching entries precisely and helping keep$PNPM_HOME/binfirst when configured to prepend it.--overwrite. Other differing blocks still require--overwrite.pnpm setupto update it.