fix: handle windows desktop runtime helper mode (#1519)
This commit is contained in:
@@ -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" \
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user