From f55a2aab2d8387db030862ad5d18d5729ef1dfd2 Mon Sep 17 00:00:00 2001 From: can1357 Date: Fri, 8 May 2026 11:32:36 +0200 Subject: [PATCH] fix(brush-core-vendored): correct windows_sys import paths and tokio child handle accessor - DuplicateHandle and DUPLICATE_SAME_ACCESS live in Win32::Foundation, not Win32::System::Threading; split the use group accordingly. - tokio::process::Child exposes raw_handle() (returning Option), not as_raw_handle(); chain via and_then(duplicate_handle). Caught by Windows CI on commit 2c8f115b6. --- crates/brush-core-vendored/src/processes.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/brush-core-vendored/src/processes.rs b/crates/brush-core-vendored/src/processes.rs index 23fb1b9c3..5fd643ec4 100644 --- a/crates/brush-core-vendored/src/processes.rs +++ b/crates/brush-core-vendored/src/processes.rs @@ -47,7 +47,7 @@ impl ChildProcess { pgid: Option, ) -> Self { #[cfg(windows)] - let kill_handle = duplicate_handle(child.as_raw_handle()); + let kill_handle = child.raw_handle().and_then(duplicate_handle); Self { exec_future: Box::pin(child.wait_with_output()), @@ -201,8 +201,9 @@ impl Drop for ChildProcess { #[cfg(windows)] fn duplicate_handle(handle: RawHandle) -> Option { - use windows_sys::Win32::System::Threading::{ - DUPLICATE_SAME_ACCESS, DuplicateHandle, GetCurrentProcess, + use windows_sys::Win32::{ + Foundation::{DUPLICATE_SAME_ACCESS, DuplicateHandle}, + System::Threading::GetCurrentProcess, }; // SAFETY: GetCurrentProcess returns a pseudo-handle for the current process