From 0ce14a423c84a5645645884714e91db3a738008c Mon Sep 17 00:00:00 2001 From: mohameddsh3ban <60802643+mohameddsh3ban@users.noreply.github.com> Date: Mon, 15 Jun 2026 20:48:42 +0300 Subject: [PATCH] fix(ecc2): resolve kill_process duplicate definition on Windows (#2195) 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. --- ecc2/src/session/manager.rs | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/ecc2/src/session/manager.rs b/ecc2/src/session/manager.rs index 8de49c8e..51523576 100644 --- a/ecc2/src/session/manager.rs +++ b/ecc2/src/session/manager.rs @@ -3634,24 +3634,6 @@ fn send_signal(pid: u32, signal: i32) -> Result<()> { Err(error).with_context(|| format!("Failed to kill process {pid}")) } -#[cfg(not(unix))] -async fn kill_process(pid: u32) -> Result<()> { - let status = Command::new("taskkill") - .args(["/F", "/PID", &pid.to_string()]) - .stdin(Stdio::null()) - .stdout(Stdio::null()) - .stderr(Stdio::null()) - .status() - .await - .with_context(|| format!("Failed to invoke taskkill for process {pid}"))?; - - if status.success() { - Ok(()) - } else { - anyhow::bail!("taskkill failed for process {pid}"); - } -} - pub struct SessionStatus { harness: SessionHarnessInfo, profile: Option,