From 5c4fab2bd258e9ed9df58c73a5f47bc6dda4b096 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Flor=C3=AAncio?= Date: Sun, 28 Jun 2026 18:04:24 +0100 Subject: [PATCH] fix: handle windows desktop runtime helper mode (#1519) --- scripts/release-desktop.test.sh | 18 ++++++++++++++++++ scripts/release/verify-desktop-runtime.sh | 7 ++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/scripts/release-desktop.test.sh b/scripts/release-desktop.test.sh index ab74b14e35..f2c855b0fb 100644 --- a/scripts/release-desktop.test.sh +++ b/scripts/release-desktop.test.sh @@ -58,6 +58,24 @@ fi grep -q "Missing agentctl linux/amd64 helper" "$ERR_FILE" || fail "verify-desktop-runtime did not explain missing helper" pass "verify-desktop-runtime requires helper for linux-x64 runtime" +nonexec_helper_runtime_dir="$TMP_DIR/nonexec-helper-runtime" +write_runtime "$nonexec_helper_runtime_dir" +chmod +x "$nonexec_helper_runtime_dir/bin/kandev" "$nonexec_helper_runtime_dir/bin/agentctl" +if env -u OS "$ROOT_DIR/scripts/release/verify-desktop-runtime.sh" --platform linux-x64 "$nonexec_helper_runtime_dir" >"$OUT_FILE" 2>"$ERR_FILE"; then + fail "verify-desktop-runtime should require executable helper on POSIX hosts" +fi +grep -q "agentctl linux/amd64 helper is not executable" "$ERR_FILE" || fail "verify-desktop-runtime did not explain non-executable helper" +pass "verify-desktop-runtime requires executable helper on POSIX hosts" + +windows_runtime_dir="$TMP_DIR/windows-runtime" +mkdir -p "$windows_runtime_dir/bin" +printf 'stub\n' > "$windows_runtime_dir/bin/kandev.exe" +printf 'stub\n' > "$windows_runtime_dir/bin/agentctl.exe" +printf 'stub\n' > "$windows_runtime_dir/bin/agentctl-linux-amd64" +OS=Windows_NT "$ROOT_DIR/scripts/release/verify-desktop-runtime.sh" --platform windows-x64 "$windows_runtime_dir" >"$OUT_FILE" +grep -q "verified for windows-x64" "$OUT_FILE" || fail "verify-desktop-runtime did not accept Windows-host runtime" +pass "verify-desktop-runtime accepts Windows-host helper without POSIX mode bits" + linux_output_dir="$TMP_DIR/linux-output" "$ROOT_DIR/scripts/release/prepare-desktop-runtime.sh" \ --bundle-dir "$runtime_dir" \ diff --git a/scripts/release/verify-desktop-runtime.sh b/scripts/release/verify-desktop-runtime.sh index 83086ee469..7ceba7ac09 100755 --- a/scripts/release/verify-desktop-runtime.sh +++ b/scripts/release/verify-desktop-runtime.sh @@ -59,7 +59,12 @@ is_executable_file() { return 0 fi # MSYS/Git Bash can report Windows executables differently from Unix mode bits. - [ "${OS:-}" = "Windows_NT" ] && [[ "$path" == *.exe ]] + if [ "${OS:-}" = "Windows_NT" ]; then + case "$(basename "$path")" in + *.exe|agentctl-linux-amd64) return 0 ;; + esac + fi + return 1 } require_one() {