From 55b9e01ed5243fb696f34de06a58e2a5e5365283 Mon Sep 17 00:00:00 2001 From: Jeffrey Aven Date: Mon, 16 Mar 2026 19:59:41 +1100 Subject: [PATCH 1/2] download and server fixes for mac and windows --- .github/workflows/ci.yml | 3 --- .github/workflows/release.yml | 3 --- src/utils/download.rs | 2 +- src/utils/server.rs | 47 ++++++++++++++--------------------- 4 files changed, 19 insertions(+), 36 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a20c16b..b4761d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -189,9 +189,6 @@ jobs: - os: macos-latest artifact-name: stackql-deploy-macos-arm64 archive: tar.gz - - os: macos-13 - artifact-name: stackql-deploy-macos-x86_64 - archive: tar.gz runs-on: ${{ matrix.os }} steps: - uses: actions/download-artifact@v8 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0b10bb3..f47e351 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -149,9 +149,6 @@ jobs: - os: macos-latest artifact-name: stackql-deploy-macos-arm64 archive: tar.gz - - os: macos-13 - artifact-name: stackql-deploy-macos-x86_64 - archive: tar.gz runs-on: ${{ matrix.os }} steps: - uses: actions/download-artifact@v8 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") From 488e986e8ccc769cfe6f57bd623702128746b840 Mon Sep 17 00:00:00 2001 From: Jeffrey Aven Date: Mon, 16 Mar 2026 20:02:07 +1100 Subject: [PATCH 2/2] added runner os for tests --- .github/workflows/ci.yml | 6 ++++++ .github/workflows/release.yml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b4761d8..6ff6a8c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -183,12 +183,18 @@ 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-26-intel + artifact-name: stackql-deploy-macos-x86_64 + archive: tar.gz runs-on: ${{ matrix.os }} steps: - uses: actions/download-artifact@v8 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f47e351..5f94b71 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -143,12 +143,18 @@ 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-26-intel + artifact-name: stackql-deploy-macos-x86_64 + archive: tar.gz runs-on: ${{ matrix.os }} steps: - uses: actions/download-artifact@v8