fix(ecc2): resolve duplicate kill_process definition that breaks the Windows build#2195
Conversation
On Windows both cfg(windows) and cfg(not(unix)) evaluate true, so the sync taskkill kill_process and the async taskkill kill_process both compiled in and collided (E0428). Call sites are synchronous and never await it (passed as a fn pointer to enforce_session_heartbeats_with, and called as kill_process(pid)? in stop_session_recorded), so remove the stray async cfg(not(unix)) definition. The sync cfg(windows) version already handles termination via taskkill /T /F.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThis PR removes an unused async process-termination function. The ChangesProcess Termination Cleanup
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
|
🤖 Bezalel Engine — Automated Code Review 1. SummaryPR #2195 intends to unblock the Windows build by removing the redundant 2. IssuesNo bugs or security issues are introduced. However, the PR is incomplete:
|
Problem
cargo buildfails on Windows with a duplicate-definition error:ecc2/src/session/manager.rsdefines three cfg-gatedkill_processvariants:#[cfg(unix)]— sync, libc signals#[cfg(windows)]— sync,taskkill#[cfg(not(unix))]— async,taskkillOn Windows, both
cfg(windows)andcfg(not(unix))evaluate true, so the sync and async versions both compile in and collide. This affects every Windows target — the overlap is independent of toolchain, sox86_64-pc-windows-msvchits the identical collision asx86_64-pc-windows-gnu. Unix builds are unaffected because onlycfg(unix)matches there — which is why Linux/macOS CI never caught it.Fix
Delete the stray
#[cfg(not(unix))]async definition. It was unusable regardless of the collision — both call sites are synchronous and never.awaitit:enforce_session_heartbeats_with<F>is boundwhere F: Fn(u32) -> Result<()>(a sync fn) and receiveskill_processas a plain fn-pointer, invoked asterminate_pid(pid)with no await;stop_session_recordedcallskill_process(pid)?synchronously.The surviving
#[cfg(windows)]sync version is also strictly better than the deleted async one: it passes/Ttotaskkill(terminates the whole child process tree, so spawned agent subprocesses aren't orphaned) and surfaces the actual exit status on failure. The async version had neither.One file, 18-line deletion. Verified on Windows (
x86_64-pc-windows-gnu): builds clean,cargo checkpasses, and no othercfg(windows)/cfg(not(unix))overlaps exist in the crate.Summary by cubic
Fix Windows build by removing a duplicate
kill_processdefinition. The async#[cfg(not(unix))]version is deleted so only the Windows synctaskkillimplementation remains.#[cfg(not(unix))]asynckill_processthat collided with#[cfg(windows)](E0428).taskkill /T /Fimplementation.Written for commit 545fcf4. Summary will update on new commits.
Summary by CodeRabbit