fix(process): complete Node.js 26.5.0 parity#6854
Conversation
📝 WalkthroughWalkthroughThe changes add lowering for internal process methods, route eval-style child process launches through Node, and track ChangesProcess method lowering
Child process eval execution
Builtin module feature gating
Estimated code review effort: 3 (Moderate) | ~30 minutes Sequence Diagram(s)sequenceDiagram
participant Source
participant HIRFeatureDetection
participant CompilationContext
participant OptimizedLibraries
Source->>HIRFeatureDetection: scan getBuiltinModule usage
HIRFeatureDetection->>CompilationContext: set uses_get_builtin_module
CompilationContext->>OptimizedLibraries: evaluate HTTP/2 constants requirement
OptimizedLibraries-->>CompilationContext: update cache key and cross-features
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
crates/perry-runtime/src/child_process/options.rs (1)
327-343: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winQuote the shell-invoked command string.
cp_build_command()joinsprogramandargsinto one command string before passing it to the shell; ifprogramcomes from a configuredPERRY_FORK_EXECPATHlikeC:\Program Files\nodejs\node.exe, that path is split by the shell and the self-eval launch fails. Preserve a single-token representation for the selected interpreter and build the shell command with platform-appropriate escaping/quoting.🤖 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 `@crates/perry-runtime/src/child_process/options.rs` around lines 327 - 343, Update cp_build_command so the shell-invoked command preserves program and argument boundaries, especially interpreter paths containing spaces such as PERRY_FORK_EXECPATH. Quote or escape the selected program and each argument using platform-appropriate shell rules before joining them into the command string, while retaining the existing shell selection behavior.
🧹 Nitpick comments (1)
crates/perry-hir/src/lower/expr_call/native_module.rs (1)
1876-1883: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winCover the lowering result, not only the predicate.
This test would pass even if the new
NativeMethodCallarm were removed. Add a focused lowering/compile assertion for both calls, or rename the test so it does not imply native-dispatch coverage.🤖 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 `@crates/perry-hir/src/lower/expr_call/native_module.rs` around lines 1876 - 1883, Expand process_active_array_helpers_use_native_dispatch beyond predicate checks by exercising lowering or compilation for both _getActiveHandles and _getActiveRequests and asserting each produces the NativeMethodCall path. Alternatively, rename the test to describe only is_process_active_array_helper predicate behavior, without implying lowering coverage.
🤖 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 `@crates/perry-runtime/src/child_process/options.rs`:
- Around line 297-305: Update cp_should_use_node_interpreter to recognize -p,
--print, and the --print= form alongside the existing eval flags, so
self-launches using Node print mode select the Node interpreter. Extend the
existing eval-mode tests to cover all print aliases.
---
Outside diff comments:
In `@crates/perry-runtime/src/child_process/options.rs`:
- Around line 327-343: Update cp_build_command so the shell-invoked command
preserves program and argument boundaries, especially interpreter paths
containing spaces such as PERRY_FORK_EXECPATH. Quote or escape the selected
program and each argument using platform-appropriate shell rules before joining
them into the command string, while retaining the existing shell selection
behavior.
---
Nitpick comments:
In `@crates/perry-hir/src/lower/expr_call/native_module.rs`:
- Around line 1876-1883: Expand process_active_array_helpers_use_native_dispatch
beyond predicate checks by exercising lowering or compilation for both
_getActiveHandles and _getActiveRequests and asserting each produces the
NativeMethodCall path. Alternatively, rename the test to describe only
is_process_active_array_helper predicate behavior, without implying lowering
coverage.
🪄 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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 5f646265-b66d-4048-8a30-96b876a6475c
📒 Files selected for processing (7)
crates/perry-hir/src/lower/expr_call/native_module.rscrates/perry-runtime/src/child_process/options.rscrates/perry/src/commands/compile/collect_modules/feature_detect.rscrates/perry/src/commands/compile/optimized_libs/freshness.rscrates/perry/src/commands/compile/optimized_libs/tests.rscrates/perry/src/commands/compile/types.rscrates/perry/tests/createrequire_builtin_modules.rs
Summary
Completes the Node.js 26.5.0
node:processparity suite and preventsprocess.execPath -efrom recursively relaunching Perry's AOT binary.Changes
_getActiveHandlesand_getActiveRequeststhrough native process dispatch.process.getBuiltinModulecalls in optimized builds.process.execPatheval invocations through the configurable Node interpreter.Related issue
Closes #6781
Test plan
cargo build --releasecleancargo test --workspace#[test]coverage in the affected cratescargo check -p perry -p perry-hir -p perry-runtimecargo test -p perry-runtime --lib self_exec_node_cli_eval_modes_use_node_interpretercargo test -p perry --bin perry get_builtin_module_gate_detects_direct_and_extracted_callscargo test -p perry-hir --lib process_active_array_helpers_use_native_dispatch./run_parity_tests.sh --suite node-suite --module processFinal process parity: 103 passed, 0 failed, 0 compile failures, 0 crashes, 0 Node failures, 0 skipped.
Screenshots / output
Checklist
feat:/fix:/docs:/chore:prefix convention used in the logCo-Authored-Bytrailers or attribution addedSummary by CodeRabbit
process._getActiveHandles()andprocess._getActiveRequests().process.getBuiltinModulefor loading built-in modules.http2exports remain available when triggered viaprocess.getBuiltinModule.http2and verifying key exports.