fix(runtime): preserve entry source in process argv - #8543
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (10)
Included review availability: Your plan provides up to 8 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughCompiled executables now seed ChangesProcess entry path propagation
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This change corrects executable argument handling and cache identity while preserving dylib behavior, with targeted regression coverage and validation included. No actionable merge-blocking risk remains beyond normal checks and review. Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant CompilePipeline
participant EntryCodegen
participant Runtime
participant ProcessArgv
CompilePipeline->>EntryCodegen: Provide entry_source_path
EntryCodegen->>Runtime: Call js_set_process_entry_path
Runtime->>ProcessArgv: Seed argv[1] with the entry source path
ProcessArgv-->>CompilePipeline: Preserve seeded argv[1] and later arguments
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
Summary
Root cause
Perry baked import.meta.url from the source module path, but constructed process.argv[1] by duplicating the executable path. The conventional Node/Bun direct-execution comparison therefore could never succeed in a native Perry executable.
Validation
Summary by CodeRabbit
process.argv[1]correctly identifies the TypeScript entry module.import.meta.urlandprocess.argv[1]now work as expected under Node and Bun.