From 6bc8644a5abaeae1533401e772d64778b747e6ce Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Wed, 22 Jul 2026 21:29:02 +1200 Subject: [PATCH] fix(windows): ship the right mavsdk_server for each architecture The win32 and win_arm64 wheels have been shipping the x64 mavsdk_server.exe. Verified against the published 3.17.2 wheels: the embedded mavsdk/bin/mavsdk_server.exe is byte-identical across all three (sha256 f678ba02...16c381, 49082880 bytes), and its PE machine field reads 0x8664 (AMD64) in every one. So the win32 wheel ships a 64-bit binary labelled 32-bit, and the win_arm64 wheel ships x64. Two bugs combine to cause it: 1. The Windows job sets the architecture with `set MAVSDK_SERVER_ARCH=...`, which is cmd syntax. The step runs under pwsh, where `set` is an alias for Set-Variable, so the variable never reaches setup.py. The `"MAVSDK_SERVER_ARCH" in os.environ` check is therefore always false on Windows and platform_suffix falls through to its fallback branch, which returns win_x64.exe for every matrix entry. 2. The explicit-arch branch returns "win_x86" / "win_x64" / "win_arm64" without the .exe suffix that the release assets actually carry. Fixing only the first bug would have swapped a silently wrong binary for a hard 404 at build time. Both are fixed here. All three per-arch assets do exist upstream, and the URLs the fixed code builds return 200 for x86, x64 and arm64. --- .github/workflows/main.yml | 2 +- setup.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ce56b94e..209d9218 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -221,7 +221,7 @@ jobs: - name: Create wheel run: | - set MAVSDK_SERVER_ARCH=${{ matrix.arch }} + $env:MAVSDK_SERVER_ARCH = "${{ matrix.arch }}" python3 setup.py bdist_wheel Dir "dist/" | rename-item -NewName {$_.name -replace '-any.whl','-${{ matrix.wheel_arch }}.whl'} diff --git a/setup.py b/setup.py index cb3dfe0d..8b3a2075 100644 --- a/setup.py +++ b/setup.py @@ -79,12 +79,14 @@ def platform_suffix(self): ) elif platform.system() == "Windows" and "MAVSDK_SERVER_ARCH" in os.environ: + # The released Windows assets are named with a .exe suffix, e.g. + # mavsdk_server_win_x86.exe -- without it the download 404s. if os.environ["MAVSDK_SERVER_ARCH"] == "x86": - return "win_x86" + return "win_x86.exe" elif os.environ["MAVSDK_SERVER_ARCH"] == "x64": - return "win_x64" + return "win_x64.exe" elif os.environ["MAVSDK_SERVER_ARCH"] == "arm64": - return "win_arm64" + return "win_arm64.exe" else: raise NotImplementedError( "Error: unknown MAVSDK_SERVER_ARCH: "