Repository navigation
fix(build): skip spawn-helper check on Linux to avoid spurious node-pty rebuilds - #7762
Conversation
…ty rebuilds getPatchedNodePtyRebuildReason() unconditionally checked for build/Release/spawn-helper, but spawn-helper is a macOS-only node-pty build target. On Linux, node-gyp never generates it, so missingArtifact was always non-null, causing unnecessary source rebuilds every time. Fixes stablyai#7760
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe pull request makes patched 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
config/scripts/ensure-native-runtime.mjs (1)
279-293: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winAdd a Linux regression for the new artifact check. The current
config/scripts/ensure-native-runtime.test.mjsandconfig/scripts/rebuild-native-deps.test.mjscases always create bothpty.nodeandspawn-helper, so they don’t exercise the darwin-only branch or the Linux case wherepty.nodealone should pass.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 94e635e9-6c5c-492d-a33c-2f6cd0d0f539
📒 Files selected for processing (2)
config/scripts/ensure-native-runtime.mjsconfig/scripts/rebuild-native-deps.mjs
|
@AmethystLiang would you mind reviewing this? The fix wraps the spawn-helper check in |
Co-authored-by: Orca <[email protected]>
Jinwoo-H
left a comment
There was a problem hiding this comment.
Thanks — this is the correct platform-specific fix.
- Confirmed node-pty builds spawn-helper only on macOS.
- Added regression coverage for both native-runtime entry points.
- Verified 11/11 targeted tests on Linux Node 24 Docker and macOS; reverting the guard reproduces the Linux failure.
- Verified the real macOS Node/Electron warm paths skip rebuilding.
- Windows, SSH, and cross-target behavior remain unchanged.
…ty rebuilds (stablyai#7762) * fix(build): skip spawn-helper check on Linux to avoid spurious node-pty rebuilds getPatchedNodePtyRebuildReason() unconditionally checked for build/Release/spawn-helper, but spawn-helper is a macOS-only node-pty build target. On Linux, node-gyp never generates it, so missingArtifact was always non-null, causing unnecessary source rebuilds every time. Fixes stablyai#7760 * test(build): cover platform-specific node-pty artifacts Co-authored-by: Orca <[email protected]> --------- Co-authored-by: Jinwoo-H <[email protected]> Co-authored-by: Orca <[email protected]>
Description
getPatchedNodePtyRebuildReason()unconditionally checks forbuild/Release/spawn-helper, butspawn-helperis a macOS-only node-pty build target defined innode_modules/node-pty/binding.gyp. On Linux,node-gypnever generates this binary.As a result,
missingArtifactwas always non-null on Linux, causing:ensure-native-runtime.mjsalways triggers a source rebuild every time.rebuild-native-deps.mjsalways reports artifacts missing even whenpty.nodeis intact.Fix
Wrap the
spawn-helperexistence check inif (process.platform === 'darwin')in both files.Changes
config/scripts/ensure-native-runtime.mjs—getPatchedNodePtyRebuildReason()config/scripts/rebuild-native-deps.mjs—getPatchedNodePtyRebuildReason()Fixes #7760