diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a20c16b..6ff6a8c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -183,13 +183,16 @@ jobs: - os: ubuntu-latest artifact-name: stackql-deploy-linux-x86_64 archive: tar.gz + - os: ubuntu-24.04-arm + artifact-name: stackql-deploy-linux-arm64 + archive: tar.gz - os: windows-latest artifact-name: stackql-deploy-windows-x86_64 archive: zip - os: macos-latest artifact-name: stackql-deploy-macos-arm64 archive: tar.gz - - os: macos-13 + - os: macos-26-intel artifact-name: stackql-deploy-macos-x86_64 archive: tar.gz runs-on: ${{ matrix.os }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0b10bb3..5f94b71 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -143,13 +143,16 @@ jobs: - os: ubuntu-latest artifact-name: stackql-deploy-linux-x86_64 archive: tar.gz + - os: ubuntu-24.04-arm + artifact-name: stackql-deploy-linux-arm64 + archive: tar.gz - os: windows-latest artifact-name: stackql-deploy-windows-x86_64 archive: zip - os: macos-latest artifact-name: stackql-deploy-macos-arm64 archive: tar.gz - - os: macos-13 + - os: macos-26-intel artifact-name: stackql-deploy-macos-x86_64 archive: tar.gz runs-on: ${{ matrix.os }} diff --git a/src/utils/download.rs b/src/utils/download.rs index 64f7807..78c859c 100644 --- a/src/utils/download.rs +++ b/src/utils/download.rs @@ -152,11 +152,11 @@ fn extract_binary( match get_platform() { Platform::MacOS => { // For macOS, we need to use pkgutil + // pkgutil --expand-full requires the destination directory to NOT exist let unpacked_dir = dest_dir.join("stackql_unpacked"); if unpacked_dir.exists() { fs::remove_dir_all(&unpacked_dir).map_err(AppError::IoError)?; } - fs::create_dir_all(&unpacked_dir).map_err(AppError::IoError)?; let output = Command::new("pkgutil") .arg("--expand-full") diff --git a/src/utils/server.rs b/src/utils/server.rs index 602c7e6..e2a31e0 100644 --- a/src/utils/server.rs +++ b/src/utils/server.rs @@ -93,48 +93,37 @@ pub fn find_all_running_servers() -> Vec { let mut running_servers = Vec::new(); if cfg!(target_os = "windows") { - // Use WMIC to get stackql processes with their command lines and PIDs - let output = ProcessCommand::new("wmic") + // Use PowerShell Get-CimInstance to get stackql processes with command lines + let output = ProcessCommand::new("powershell") .args([ - "process", - "where", - "name='stackql.exe'", - "get", - "ProcessId,CommandLine", - "/format:list", + "-NoProfile", + "-Command", + "Get-CimInstance Win32_Process -Filter \"Name='stackql.exe'\" | ForEach-Object { \"PID=$($_.ProcessId) CMD=$($_.CommandLine)\" }", ]) .output(); if let Ok(output) = output { let output_str = String::from_utf8_lossy(&output.stdout); - let mut current_cmdline = String::new(); - let mut current_pid: Option = None; - for line in output_str.lines() { let line = line.trim(); - if let Some(cmdline) = line.strip_prefix("CommandLine=") { - current_cmdline = cmdline.to_string(); - } else if let Some(pid_str) = line.strip_prefix("ProcessId=") { - current_pid = pid_str.trim().parse().ok(); - } - - // When we have both values, emit a server entry - if let Some(pid) = current_pid { - if !current_cmdline.is_empty() { - if let Some(port) = extract_port_from_cmdline(¤t_cmdline) { - debug!( - "find_all_running_servers (Windows): PID {} -> port {} (cmdline: {})", - pid, port, current_cmdline - ); - running_servers.push(RunningServer { pid, port }); + if let Some(rest) = line.strip_prefix("PID=") { + if let Some(space_pos) = rest.find(" CMD=") { + let pid_str = &rest[..space_pos]; + let cmdline = &rest[space_pos + 5..]; + if let Ok(pid) = pid_str.parse::() { + if let Some(port) = extract_port_from_cmdline(cmdline) { + debug!( + "find_all_running_servers (Windows): PID {} -> port {}", + pid, port + ); + running_servers.push(RunningServer { pid, port }); + } } - current_cmdline.clear(); - current_pid = None; } } } } else { - debug!("find_all_running_servers: wmic command failed, falling back to tasklist"); + debug!("find_all_running_servers: PowerShell command failed"); } } else { let output = ProcessCommand::new("pgrep")