Repository navigation
fix(cmd-shim): fall back to PATH for shim helpers - #16379
Conversation
|
💖 Thanks for opening this pull request! 💖 |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: pnpm/pnpm/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (16)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughPOSIX shims and launchers now use ChangesPOSIX helper lookup
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix · Severity of issue fixed: Medium Assessment against linked issues
Suggested labels: Merge Risk: ⚪ Minimal · up to Shims and launchers now fall back to the filtered PATH when the default path lacks a helper, which fixes Nix build sandboxes. No merge-blocking risk was found. Security Architecture ReviewSecurity architecture risk: 🟡 Moderate · up to When a helper is unavailable on the system’s default command path, a shim can run one from the caller’s PATH. The PATH filter blocks obvious unsafe entries, but a verified security issue remains in how it treats symlinked paths. Exposure depends on the environment and control of PATH entries. Retained concerns
Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Some tools did not complete. Review the errors below. 🔧 ESLint
pnpm11/bins/cmd-shim/src/index.tsESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox. pnpm11/bins/cmd-shim/test/e2e.test.jsESLint skipped: the matched ESLint configuration already failed (missing-dependency). pnpm11/engine/pm/commands/src/setup/setup.tsESLint skipped: the matched ESLint configuration already failed (missing-dependency).
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✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #16379 +/- ##
=======================================
Coverage 92.15% 92.15%
=======================================
Files 1513 1513
Lines 203838 203838
=======================================
+ Hits 187843 187848 +5
+ Misses 15995 15990 -5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.49189352278,
"stddev": 0.15459793639768324,
"median": 2.46373855238,
"user": 1.56849662,
"system": 1.5351875599999996,
"min": 2.3124970513800003,
"max": 2.72525259538
},
{
"command": "pacquet@main",
"mean": 2.48313638838,
"stddev": 0.15566340113534965,
"median": 2.40888653888,
"user": 1.63295812,
"system": 1.55834436,
"min": 2.33513338338,
"max": 2.6871191693800003
},
{
"command": "pnpr@HEAD",
"mean": 1.45625443068,
"stddev": 0.12621210973540767,
"median": 1.40670757438,
"user": 1.56465642,
"system": 1.54189726,
"min": 1.3376200033799999,
"max": 1.70872479638
},
{
"command": "pnpr@main",
"mean": 1.5740586939799999,
"stddev": 0.12091523232044747,
"median": 1.6048351463800001,
"user": 1.55413662,
"system": 1.51262956,
"min": 1.3937080953799998,
"max": 1.7339734333799999
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.24509908998,
"stddev": 0.018614653939949783,
"median": 0.24221899888000004,
"user": 0.28530604,
"system": 0.5727742399999999,
"min": 0.22187970138000002,
"max": 0.28576095538
},
{
"command": "pacquet@main",
"mean": 0.25994478198000004,
"stddev": 0.036419092658273824,
"median": 0.24386250938000004,
"user": 0.28248584,
"system": 0.6098521399999999,
"min": 0.21744990938000003,
"max": 0.32352506538
},
{
"command": "pnpr@HEAD",
"mean": 0.29110070608,
"stddev": 0.016154216698962606,
"median": 0.28940586488,
"user": 0.31297674,
"system": 0.6291288399999999,
"min": 0.26792765038,
"max": 0.32495736638
},
{
"command": "pnpr@main",
"mean": 0.28200125618,
"stddev": 0.017957874255832177,
"median": 0.27629328938,
"user": 0.30033304000000005,
"system": 0.64285654,
"min": 0.26432988038,
"max": 0.31754280338
}
]
}Scenario: Isolated linker: repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.014532021547289721,
"stddev": 0.0027590930134578358,
"median": 0.01400338408,
"user": 0.008116320186915885,
"system": 0.0078083719626168184,
"min": 0.009593002580000001,
"max": 0.03005185158
},
{
"command": "pacquet@main",
"mean": 0.010277668255889334,
"stddev": 0.0020684486920715746,
"median": 0.00977334958,
"user": 0.006100851936758896,
"system": 0.0051183466403162065,
"min": 0.00746436858,
"max": 0.019699866580000003
},
{
"command": "pnpr@HEAD",
"mean": 0.01238874064920415,
"stddev": 0.0029033272983251136,
"median": 0.01196725558,
"user": 0.006700311487889272,
"system": 0.006866085813148789,
"min": 0.00804943758,
"max": 0.021111814580000002
},
{
"command": "pnpr@main",
"mean": 0.014317888426153846,
"stddev": 0.0021882053270693034,
"median": 0.01404405508,
"user": 0.007806564615384614,
"system": 0.007902034615384614,
"min": 0.010450750580000001,
"max": 0.02151568258
}
]
}Scenario: Isolated linker: repeat install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.009178255312824433,
"stddev": 0.001081999151918867,
"median": 0.00886698708,
"user": 0.005303034427480913,
"system": 0.004771453893129773,
"min": 0.00800453258,
"max": 0.015582349580000002
},
{
"command": "pacquet@main",
"mean": 0.009294934501933094,
"stddev": 0.001224357161829934,
"median": 0.00885347758,
"user": 0.005207036282527877,
"system": 0.004996443345724907,
"min": 0.00797281558,
"max": 0.014655309580000001
},
{
"command": "pnpr@HEAD",
"mean": 0.009305324906923075,
"stddev": 0.001140075227059171,
"median": 0.00896583258,
"user": 0.005371919999999999,
"system": 0.004840169153846155,
"min": 0.00800780358,
"max": 0.01464491958
},
{
"command": "pnpr@main",
"mean": 0.009198831698773939,
"stddev": 0.0011062747325741246,
"median": 0.00881204158,
"user": 0.0051525479693486625,
"system": 0.004925681226053637,
"min": 0.008039042580000001,
"max": 0.01482733058
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.7805619152800007,
"stddev": 0.12788843565088454,
"median": 2.7618053591800003,
"user": 2.69020936,
"system": 2.1018500199999997,
"min": 2.58166079318,
"max": 2.9789720661800003
},
{
"command": "pacquet@main",
"mean": 2.5580615499800006,
"stddev": 0.06132216325409298,
"median": 2.55002719318,
"user": 2.06631136,
"system": 1.58238742,
"min": 2.4802945591800003,
"max": 2.6841412571800003
},
{
"command": "pnpr@HEAD",
"mean": 1.5386585497799998,
"stddev": 0.10736265269629582,
"median": 1.5412776296800001,
"user": 1.2392167600000001,
"system": 1.28593512,
"min": 1.41360744418,
"max": 1.70273586918
},
{
"command": "pnpr@main",
"mean": 1.50770402578,
"stddev": 0.10645255463220925,
"median": 1.4914106236800002,
"user": 1.1559384599999998,
"system": 1.28823052,
"min": 1.38692378618,
"max": 1.65579639818
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.6010288988400001,
"stddev": 0.03844781744514698,
"median": 0.59249072924,
"user": 0.8478261999999999,
"system": 1.0471500599999999,
"min": 0.5571166857400001,
"max": 0.6741316457400001
},
{
"command": "pacquet@main",
"mean": 0.57953937154,
"stddev": 0.027181918598858705,
"median": 0.57795559374,
"user": 0.7910290999999999,
"system": 1.0525783599999998,
"min": 0.54236206674,
"max": 0.63362781674
},
{
"command": "pnpr@HEAD",
"mean": 0.35705474684,
"stddev": 0.014602745004778896,
"median": 0.35600615974000005,
"user": 0.33043999999999996,
"system": 0.77960916,
"min": 0.34027775874,
"max": 0.38276018374000004
},
{
"command": "pnpr@main",
"mean": 0.35874242194,
"stddev": 0.006840577592967302,
"median": 0.35594814474,
"user": 0.33783090000000005,
"system": 0.7519663600000001,
"min": 0.34830456674,
"max": 0.37072271574000004
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.8040871206999998,
"stddev": 0.045600101390306506,
"median": 1.7875623108,
"user": 1.3151697399999998,
"system": 1.2366797200000001,
"min": 1.7594734823,
"max": 1.9140077163
},
{
"command": "pacquet@main",
"mean": 1.7492195631,
"stddev": 0.02395728963537868,
"median": 1.7524757083,
"user": 1.24117864,
"system": 1.16942132,
"min": 1.7067218913,
"max": 1.7923187393000002
},
{
"command": "pnpr@HEAD",
"mean": 0.3593873585,
"stddev": 0.011879687486888658,
"median": 0.3543857788,
"user": 0.33213174,
"system": 0.6940792200000001,
"min": 0.3481507513,
"max": 0.3869222023
},
{
"command": "pnpr@main",
"mean": 0.356979798,
"stddev": 0.013706167727036082,
"median": 0.3526917848,
"user": 0.32808664000000004,
"system": 0.69123082,
"min": 0.3413687823,
"max": 0.3828329883
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.25048114370999996,
"stddev": 0.012541852753583977,
"median": 0.25408013146,
"user": 0.23267536,
"system": 0.09588706666666665,
"min": 0.22719305296,
"max": 0.26730592196
},
{
"command": "pacquet@main",
"mean": 0.25339737476,
"stddev": 0.01777214756720258,
"median": 0.24920302796000005,
"user": 0.23732485999999997,
"system": 0.089541,
"min": 0.23243225596,
"max": 0.28087115996
},
{
"command": "pnpr@HEAD",
"mean": 0.09568018530482761,
"stddev": 0.003244036130955579,
"median": 0.09547505096,
"user": 0.03433887724137931,
"system": 0.017068951724137926,
"min": 0.09031480496,
"max": 0.10282005096
},
{
"command": "pnpr@main",
"mean": 0.09391657939749999,
"stddev": 0.0025366532211570023,
"median": 0.09356554246000001,
"user": 0.03460029750000001,
"system": 0.01463199375,
"min": 0.08851331996,
"max": 0.10018279596
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.9582401157733335,
"stddev": 0.0937515855189032,
"median": 0.9847147814400001,
"user": 0.9992611266666663,
"system": 0.31460855777777774,
"min": 0.7982543354400001,
"max": 1.09484252144
},
{
"command": "pacquet@main",
"mean": 1.0832301962177777,
"stddev": 0.17546328748147866,
"median": 1.10093216844,
"user": 1.1622307933333333,
"system": 0.32358233555555554,
"min": 0.8677221714400001,
"max": 1.32906954344
},
{
"command": "pnpm@HEAD",
"mean": 3.128861384217777,
"stddev": 0.06334704227457272,
"median": 3.1345438144399997,
"user": 4.640683015555555,
"system": 0.23868589111111113,
"min": 3.01286242644,
"max": 3.21424495644
}
]
}Scenario: Isolated linker: linked-workspace resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.28814950664000005,
"stddev": 0.036519442037934474,
"median": 0.27990211774000007,
"user": 0.24554782,
"system": 0.10060348,
"min": 0.24417121924000001,
"max": 0.35529510424000005
},
{
"command": "pacquet@main",
"mean": 0.30427923954,
"stddev": 0.02502444039275711,
"median": 0.3143295487400001,
"user": 0.24346271999999997,
"system": 0.12555378,
"min": 0.26407614324000006,
"max": 0.33666872624000005
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.505364103019999,
"stddev": 0.16612984136508566,
"median": 4.42274080692,
"user": 1.67077384,
"system": 1.559327,
"min": 4.35025917342,
"max": 4.81920908142
},
{
"command": "pacquet@main",
"mean": 4.4304219286199995,
"stddev": 0.05699660754916484,
"median": 4.407444333919999,
"user": 1.65910674,
"system": 1.6077744999999997,
"min": 4.3725310004199995,
"max": 4.55372140142
},
{
"command": "pnpr@HEAD",
"mean": 3.47396050892,
"stddev": 0.11085409390636872,
"median": 3.43255800792,
"user": 1.44812214,
"system": 1.4477854999999997,
"min": 3.39043533042,
"max": 3.74271321542
},
{
"command": "pnpr@main",
"mean": 3.46373282162,
"stddev": 0.1158868669746853,
"median": 3.40304592792,
"user": 1.4515891399999998,
"system": 1.4458800999999997,
"min": 3.3697268764199997,
"max": 3.70984883142
}
]
}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.34565700046,
"stddev": 0.020493307559215496,
"median": 0.35048517296000004,
"user": 0.37732047999999996,
"system": 0.20132787999999996,
"min": 0.31577086246,
"max": 0.37254559446
},
{
"command": "pacquet@main",
"mean": 0.33629211596,
"stddev": 0.03632660466699935,
"median": 0.32678830046,
"user": 0.36924908,
"system": 0.20647278,
"min": 0.29743521546,
"max": 0.38718525046
},
{
"command": "pnpr@HEAD",
"mean": 0.39745871496,
"stddev": 0.03675148048266508,
"median": 0.39249932196000004,
"user": 0.40750728,
"system": 0.21927828,
"min": 0.34447631946,
"max": 0.45917199846
},
{
"command": "pnpr@main",
"mean": 0.32130944896,
"stddev": 0.052099313136089315,
"median": 0.31044567496000003,
"user": 0.35286797999999997,
"system": 0.19855657999999998,
"min": 0.26379662046,
"max": 0.40876862946000003
}
]
} |
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? |
2f470c3 to
29cbda9
Compare
Code Review by Qodo
1. Shims miss available PATH helpers
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
…PATH The bash 3.2 that macOS ships as sh ignores -p for command -v, so run_helper's probe searched the filtered caller PATH. A caller whose PATH lacked /usr/bin then fell through to a plain `command readlink` that found nothing, although `command -p readlink` would have worked. Take a helper from PATH only when PATH actually has it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Code review by qodo was updated up to the latest commit 768cb89 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
Congrats on merging your first pull request! 🎉🎉🎉 |
|
Review-and-fix summary. The PR was merged at 768cb89 while this pass was wrapping up. Fixed in 768cb89: the bash 3.2 that macOS ships as Validation: Review status: CodeRabbit reported no actionable comments on 768cb89. Copilot could not review because of quota. I declined Qodo's two findings on the head:
Nothing remains within scope. Written by an agent (Claude Code, claude-opus-5-5). |
Shims fall back to the filtered
PATHwhencommand -pfinds no helper, as in a Nix build sandbox.A helper comes from
PATHonly whenPATHhas it, because the bash 3.2 that macOS ships asshanswerscommand -p -vfromPATH.Closes #16377
Helped by an agent (Claude-Code, opus5.5)
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
node_modulesentries.