Repository navigation
fix(install): use the running Node.js for a devEngines runtime range - #15256
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
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 (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe runtime resolvers now treat non-download ChangesRuntime resolution
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 Runtime ranges now use the installed Node.js unless pnpm is downloading a runtime, preserving optional dependency installation while retaining provisioning behavior. The covered paths are merge-ready. ✨ 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 |
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? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #15256 +/- ##
=======================================
Coverage 91.52% 91.53%
=======================================
Files 1381 1381
Lines 185841 185847 +6
=======================================
+ Hits 170093 170110 +17
+ Misses 15748 15737 -11 ☔ 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.59937217654,
"stddev": 0.14230631362767054,
"median": 2.61215419214,
"user": 2.1843917799999995,
"system": 2.23470422,
"min": 2.38363491314,
"max": 2.79424965114
},
{
"command": "pacquet@main",
"mean": 2.57881046084,
"stddev": 0.1153894590414045,
"median": 2.60341815514,
"user": 2.10274458,
"system": 2.11690392,
"min": 2.40113311014,
"max": 2.75756862414
},
{
"command": "pnpr@HEAD",
"mean": 1.42298694544,
"stddev": 0.10715517495297001,
"median": 1.44486300864,
"user": 1.63654008,
"system": 1.5175456200000002,
"min": 1.3079272311399999,
"max": 1.66270441914
},
{
"command": "pnpr@main",
"mean": 1.45308540164,
"stddev": 0.13737560590202674,
"median": 1.3865307311400001,
"user": 1.58309888,
"system": 1.53112562,
"min": 1.32970134014,
"max": 1.67520025514
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.30172078920000006,
"stddev": 0.05632765549545661,
"median": 0.2925347414,
"user": 0.34072769999999997,
"system": 0.6583682200000001,
"min": 0.23186528190000003,
"max": 0.4200573009
},
{
"command": "pacquet@main",
"mean": 0.24761242320000001,
"stddev": 0.020180725060522296,
"median": 0.24322744740000002,
"user": 0.27718229999999994,
"system": 0.56661642,
"min": 0.22639814290000002,
"max": 0.2958666909
},
{
"command": "pnpr@HEAD",
"mean": 0.2475692378,
"stddev": 0.011838795309553219,
"median": 0.24760598240000004,
"user": 0.262852,
"system": 0.56404672,
"min": 0.2285501369,
"max": 0.2708776119
},
{
"command": "pnpr@main",
"mean": 0.24528569970000005,
"stddev": 0.009447999874868915,
"median": 0.24541523040000002,
"user": 0.24979419999999997,
"system": 0.5650534199999999,
"min": 0.2267631569,
"max": 0.2617986209
}
]
}Scenario: Isolated linker: repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.009543988417368417,
"stddev": 0.0029717372320421354,
"median": 0.00891196372,
"user": 0.005746728421052628,
"system": 0.004362063552631576,
"min": 0.005846942220000001,
"max": 0.02579683722
},
{
"command": "pacquet@main",
"mean": 0.006599611687018472,
"stddev": 0.0005916619865627292,
"median": 0.00652547522,
"user": 0.004006071081794189,
"system": 0.0030536561477572557,
"min": 0.00555111722,
"max": 0.00974017722
},
{
"command": "pnpr@HEAD",
"mean": 0.006265732830978526,
"stddev": 0.00043995891482374134,
"median": 0.00616787622,
"user": 0.00394133971360382,
"system": 0.0027218693078758954,
"min": 0.005449707220000001,
"max": 0.00798260422
},
{
"command": "pnpr@main",
"mean": 0.00652384809347932,
"stddev": 0.0005849682916132673,
"median": 0.006402977220000001,
"user": 0.00414521279805353,
"system": 0.0028194871046228693,
"min": 0.005454385220000001,
"max": 0.009407679220000001
}
]
}Scenario: Isolated linker: repeat install, cold cache + hot store
Confirmation (reversed target order)
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.008784300846796123,
"stddev": 0.0014907570198968286,
"median": 0.00841136974,
"user": 0.005444631553398061,
"system": 0.0038357019417475735,
"min": 0.006874771240000001,
"max": 0.01737501424
},
{
"command": "pacquet@main",
"mean": 0.01624316291320261,
"stddev": 0.0016560350272711453,
"median": 0.01623518624,
"user": 0.009270103660130721,
"system": 0.00786534326797385,
"min": 0.010466641240000001,
"max": 0.02178975924
},
{
"command": "pnpr@HEAD",
"mean": 0.014140422028079472,
"stddev": 0.0025616767208190036,
"median": 0.01415404024,
"user": 0.008484686225165568,
"system": 0.006389131920529799,
"min": 0.007542468240000001,
"max": 0.019892028239999998
},
{
"command": "pnpr@main",
"mean": 0.008548550999656651,
"stddev": 0.0006564339630793903,
"median": 0.00846732224,
"user": 0.005388304034334766,
"system": 0.003697761716738195,
"min": 0.007110430240000001,
"max": 0.01049828424
}
],
"confirmation": {
"results": [
{
"command": "pnpr@main",
"mean": 0.008214240574976309,
"stddev": 0.0008514347530914823,
"median": 0.00796392312,
"user": 0.005260669952606635,
"system": 0.003417108436018956,
"min": 0.00706861412,
"max": 0.01131799812
},
{
"command": "pnpr@HEAD",
"mean": 0.008168942740129869,
"stddev": 0.0007010698519349547,
"median": 0.008073113619999999,
"user": 0.004631035974025975,
"system": 0.003999164285714286,
"min": 0.00669802812,
"max": 0.01200402512
},
{
"command": "pacquet@main",
"mean": 0.00828245184727273,
"stddev": 0.0006868076378715335,
"median": 0.00817304612,
"user": 0.004611273833992094,
"system": 0.004133901976284583,
"min": 0.006926617120000001,
"max": 0.01047842212
},
{
"command": "pacquet@HEAD",
"mean": 0.00805632801735099,
"stddev": 0.0005997179350770566,
"median": 0.00789162362,
"user": 0.0047728758940397365,
"system": 0.003720917350993377,
"min": 0.006811481120000001,
"max": 0.01016439412
}
]
}
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.5614965362600004,
"stddev": 0.08417133311539197,
"median": 2.54949080346,
"user": 2.05616604,
"system": 1.70534434,
"min": 2.4628897854600003,
"max": 2.7182288904600003
},
{
"command": "pacquet@main",
"mean": 2.53673187526,
"stddev": 0.05476245065074239,
"median": 2.5182822709600003,
"user": 1.95992514,
"system": 1.72552904,
"min": 2.48077460046,
"max": 2.63729013946
},
{
"command": "pnpr@HEAD",
"mean": 1.4855686766600003,
"stddev": 0.0954607719684169,
"median": 1.4517439209599998,
"user": 1.15547414,
"system": 1.31751054,
"min": 1.4002010104599998,
"max": 1.66116521446
},
{
"command": "pnpr@main",
"mean": 1.5025062559599998,
"stddev": 0.11327723156631656,
"median": 1.4821243929599999,
"user": 1.11647814,
"system": 1.29961044,
"min": 1.39794120246,
"max": 1.75334155246
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.52972269404,
"stddev": 0.170589852870819,
"median": 0.47218037934,
"user": 0.8269456799999999,
"system": 1.0254559399999998,
"min": 0.41242164234,
"max": 0.9670435273400001
},
{
"command": "pacquet@main",
"mean": 0.45232752994,
"stddev": 0.12389329744899687,
"median": 0.40741443334000005,
"user": 0.72266038,
"system": 0.92442554,
"min": 0.34804981634000004,
"max": 0.7624282923400001
},
{
"command": "pnpr@HEAD",
"mean": 0.28059201704000003,
"stddev": 0.013048406815275377,
"median": 0.28384232334000004,
"user": 0.22552027999999993,
"system": 0.50621094,
"min": 0.25727101034,
"max": 0.29860820334
},
{
"command": "pnpr@main",
"mean": 0.29180094194,
"stddev": 0.019998776659856877,
"median": 0.28558593484000006,
"user": 0.24330678,
"system": 0.51191634,
"min": 0.26522998534000003,
"max": 0.33517115734
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.63948206474,
"stddev": 0.02981246439662075,
"median": 1.6322157050400001,
"user": 1.04886208,
"system": 1.03540972,
"min": 1.60192881704,
"max": 1.69238122004
},
{
"command": "pacquet@main",
"mean": 1.63954536944,
"stddev": 0.0881707443879549,
"median": 1.61904985504,
"user": 1.0050095799999998,
"system": 1.03763412,
"min": 1.5655601160400001,
"max": 1.8680610260400001
},
{
"command": "pnpr@HEAD",
"mean": 0.29031396394000003,
"stddev": 0.009559350371021066,
"median": 0.29037458154000007,
"user": 0.24828577999999996,
"system": 0.54400682,
"min": 0.27866194704,
"max": 0.30506203904
},
{
"command": "pnpr@main",
"mean": 0.27801914284000007,
"stddev": 0.007668509297777902,
"median": 0.27785372054,
"user": 0.22876508,
"system": 0.50469142,
"min": 0.26516038604000003,
"max": 0.29318707104
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.33977669756000006,
"stddev": 0.05281405204608225,
"median": 0.32876733746,
"user": 0.36879312,
"system": 0.12095428,
"min": 0.26937505646000004,
"max": 0.46236866646
},
{
"command": "pacquet@main",
"mean": 0.3944619964600001,
"stddev": 0.0529312170510229,
"median": 0.38561220496000004,
"user": 0.43091011999999995,
"system": 0.12536848,
"min": 0.32712220946000004,
"max": 0.51526925846
},
{
"command": "pnpr@HEAD",
"mean": 0.13127256466000004,
"stddev": 0.015041595959392246,
"median": 0.13267941946,
"user": 0.06589362,
"system": 0.02310996,
"min": 0.10744083246000001,
"max": 0.15610353746
},
{
"command": "pnpr@main",
"mean": 0.13598885346,
"stddev": 0.011954940993405147,
"median": 0.13664893696000002,
"user": 0.06505030181818182,
"system": 0.028150243636363637,
"min": 0.11467445446,
"max": 0.15668056046
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.6010770915288889,
"stddev": 0.03787054833455979,
"median": 0.59703302764,
"user": 0.6259220688888889,
"system": 0.15696342222222223,
"min": 0.53944270864,
"max": 0.6532481276400001
},
{
"command": "pacquet@main",
"mean": 0.5890333583066667,
"stddev": 0.10943506502853392,
"median": 0.60674369564,
"user": 0.6129609577777777,
"system": 0.13891019999999998,
"min": 0.31062414264,
"max": 0.6673254066400001
},
{
"command": "pnpm@HEAD",
"mean": 3.262793808751111,
"stddev": 0.3166860098804902,
"median": 3.2372292316399998,
"user": 5.114629068888889,
"system": 0.2379382,
"min": 2.90299518164,
"max": 3.8139421426399998
}
]
}Scenario: Isolated linker: linked-workspace resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.1807379277275,
"stddev": 0.007547649861233408,
"median": 0.17861872554000002,
"user": 0.137793685,
"system": 0.08663604249999998,
"min": 0.16870690454000004,
"max": 0.19874067454000002
},
{
"command": "pacquet@main",
"mean": 0.17962651725428574,
"stddev": 0.007769123417748372,
"median": 0.17727490354000003,
"user": 0.14012663142857146,
"system": 0.08018119428571428,
"min": 0.17214610954,
"max": 0.20156669754000003
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.560982515179999,
"stddev": 0.1662466116650188,
"median": 4.5172522526800005,
"user": 1.9224522199999998,
"system": 2.2105297,
"min": 4.40963946668,
"max": 4.93378181068
},
{
"command": "pacquet@main",
"mean": 4.512569065380001,
"stddev": 0.1291926905907172,
"median": 4.46104140618,
"user": 1.68500922,
"system": 2.050771,
"min": 4.37565682368,
"max": 4.72565441468
},
{
"command": "pnpr@HEAD",
"mean": 3.51800766438,
"stddev": 0.11818853632967251,
"median": 3.47517759718,
"user": 1.58479902,
"system": 1.9126930999999998,
"min": 3.4198807926800003,
"max": 3.8326095816800003
},
{
"command": "pnpr@main",
"mean": 3.464396312980001,
"stddev": 0.06568234935096502,
"median": 3.43455767668,
"user": 1.5156292199999999,
"system": 1.8327638,
"min": 3.4139826166800002,
"max": 3.61176968468
}
]
}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.14163041235142856,
"stddev": 0.0164620876496549,
"median": 0.13627078428,
"user": 0.17467694571428574,
"system": 0.14036727428571424,
"min": 0.12266446878000001,
"max": 0.18309334578
},
{
"command": "pacquet@main",
"mean": 0.13161111467473682,
"stddev": 0.008152279522192349,
"median": 0.12964013678,
"user": 0.17018944947368417,
"system": 0.12401119157894738,
"min": 0.11631233978000001,
"max": 0.14713840178
},
{
"command": "pnpr@HEAD",
"mean": 0.14158457378,
"stddev": 0.008031900003591483,
"median": 0.14292718178,
"user": 0.16320787052631577,
"system": 0.14591792842105264,
"min": 0.12419131178000001,
"max": 0.15246142978
},
{
"command": "pnpr@main",
"mean": 0.13738303399052632,
"stddev": 0.011333853056459913,
"median": 0.13333675578,
"user": 0.1583497126315789,
"system": 0.1453663494736842,
"min": 0.12584803378,
"max": 0.16199096878
}
]
} |
409b8ef to
0628635
Compare
Code Review by Qodo
1.
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
1 similar comment
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
`node_version_from_engines_runtime` returned the lower bound of every `devEngines.runtime` and `engines.runtime` range, so a declared range stood in for the Node.js running the install. Optional dependencies whose `engines.node` the running Node.js satisfies were skipped, because their engines were compared against that lower bound. The lower bound is now used only when the entry sets `onFail` to `download`, the case where pnpm provisions the runtime. Otherwise a range means the Node.js already on the system, and only an exact version names one. Refs pnpm#15230.
`getNodeVersionFromEnginesRuntime` set `config.nodeVersion` to the lower bound of every `devEngines.runtime` and `engines.runtime` range. A declared range stood in for the Node.js running the install, `packageIsInstallable` compared each package's `engines.node` against that lower bound, and optional dependencies the running Node.js supported were skipped. The lower bound is now used only when the entry sets `onFail` to `download`, the case where pnpm provisions the runtime. Otherwise a range means the Node.js already on the system, and only an exact version names one. This matches `node_version_from_engines_runtime` on the Rust side. Refs pnpm#15230.
…v11 install test `getNodeVersionFromEnginesRuntime` was called before `runtimeOnFail` was applied to the root and engine pin manifests. When `runtimeOnFail: download` overrides a range entry, `config.nodeVersion` was left undefined instead of taking the range lower bound, and when `runtimeOnFail: ignore` overrides `download`, `config.nodeVersion` kept the lower bound instead of host node. Derive `pnpmConfig.nodeVersion` after applying `runtimeOnFail` to both `rootProjectManifest` and `enginePinManifest`. Also add an install-level regression test in `pnpm/test/install/nodeRuntime.ts` asserting that an optional dependency is installed when a runtime range is declared without download. Refs pnpm#15230.
Guard against malformed non-string runtime version values before trimming in `getNodeVersionFromEnginesRuntime`. Also update the changeset wording to describe the previous behavior in its own past-tense sentence.
9143085 to
02d7409
Compare
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
|
Code review by qodo was updated up to the latest commit 02d7409 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
…npm#15256) `node_version_from_engines_runtime` returned the lower bound of every `devEngines.runtime` and `engines.runtime` range, so a declared range stood in for the Node.js running the install. Optional dependencies whose `engines.node` the running Node.js satisfies were skipped, because their engines were compared against that lower bound. The lower bound is now used only when the entry sets `onFail` to `download`, the case where pnpm provisions the runtime. Otherwise a range means the Node.js already on the system, and only an exact version names one. The v11 `getNodeVersionFromEnginesRuntime` now applies the same rule. It returns the range's lower bound only when the entry sets `onFail` to `download`, an exact version otherwise, and nothing for a range, so `packageIsInstallable` sees the Node.js running the install. `nodeVersion` is derived after `runtimeOnFail` is applied so workspace-level download and ignore policies take effect. Closes pnpm#15230. --------- Co-authored-by: Tung Lam <[email protected]> Co-authored-by: Zoltan Kochan <[email protected]>
Summary
pnpm installskipped optional dependencies whoseengines.nodethe running Node.js satisfies whendevEngines.runtimedeclared a range.node_version_from_engines_runtimereturnedrange.min_version()for every entry, so the lower bound of the declared range stood in for the Node.js running the install, and each package's engines were compared against that lower bound instead of the real runtime.The function now uses the lower bound only when the entry sets
onFailtodownload, which is when pnpm provisions that runtime itself. Otherwise a declared range means the Node.js already on the system, and only an exact version names one.The issue's case is a project on Node.js 24 with
devEngines.runtime: { name: "node", version: ">=22.12.0", onFail: "error" }, where an optional dependency requiringengines.node: ">=24.0.0"was dropped. The CLI test inpnpm/crates/cli/tests/suite/install_runtimes.rsbuilds the same shape from the running Node.js major, so it stays meaningful on whichever Node.js CI uses.pnpm 11 had the same unconditional
semver.minVersioningetNodeVersionFromEnginesRuntime(pnpm11/config/reader/src/index.ts), and that value reachespackageIsInstallablethroughconfig.nodeVersion. It now returns the lower bound only whenonFailisdownload, and an exact version otherwise.pnpmConfig.nodeVersionis derived afterruntimeOnFailis applied torootProjectManifestandenginePinManifest. In addition to reader unit tests, an install regression test was added inpnpm11/pnpm/test/install/nodeRuntime.ts.Closes #15230.
Validation
cargo test -p pnpm-package-manifest --lib: 83 passed.cargo check -p pnpm-package-manifestandcargo clippy -p pnpm-package-manifest --all-targets -- --deny warnings: clean.node pnpm/scripts/rustfmt.mjs --all -- --check: clean.typos pnpm pnpr: clean.pnpm --filter @pnpm/config.reader test: 17 suites, 548 passed.pnpm --filter pnpm test test/install/nodeRuntime.ts: 4 passed (including the new regression test).Squash Commit Body
Checklist
pnpm changeset) if this PR changes any published package. Keep it short and written for pnpm users — it becomes a release note.Written by an agent (Antigravity, Gemini 3.8 Flash).
Summary by CodeRabbit
Bug Fixes
onFail: "download".devEngines.runtimeandengines.runtimeare both present.Tests