oraios/serena · error · RuntimeError

Unsupported Windows architecture: {machine}

Error message

Unsupported Windows architecture: {machine}

What it means

Raised during lua-language-server download when running on Windows with a CPU architecture other than amd64/x86_64; only a win32-x64 zip asset is provided. Windows ARM devices therefore cannot use the prebuilt download path.

Source

Thrown at src/solidlsp/language_servers/lua_ls.py:145

        if system == "Linux":
            if machine in ["x86_64", "amd64"]:
                download_name = f"lua-language-server-{lua_ls_version}-linux-x64.tar.gz"
            elif machine in ["aarch64", "arm64"]:
                download_name = f"lua-language-server-{lua_ls_version}-linux-arm64.tar.gz"
            else:
                raise RuntimeError(f"Unsupported Linux architecture: {machine}")
        elif system == "Darwin":
            if machine in ["x86_64", "amd64"]:
                download_name = f"lua-language-server-{lua_ls_version}-darwin-x64.tar.gz"
            elif machine in ["arm64", "aarch64"]:
                download_name = f"lua-language-server-{lua_ls_version}-darwin-arm64.tar.gz"
            else:
                raise RuntimeError(f"Unsupported macOS architecture: {machine}")
        elif system == "Windows":
            if machine in ["amd64", "x86_64"]:
                download_name = f"lua-language-server-{lua_ls_version}-win32-x64.zip"
            else:
                raise RuntimeError(f"Unsupported Windows architecture: {machine}")
        else:
            raise RuntimeError(f"Unsupported operating system: {system}")

        download_url = f"https://github.com/LuaLS/lua-language-server/releases/download/{lua_ls_version}/{download_name}"

        install_dir = _lua_ls_install_dir(LuaLanguageServer.ls_resources_dir(solidlsp_settings), lua_ls_version)
        install_dir.mkdir(parents=True, exist_ok=True)

        log.info("Downloading lua-language-server from %s", download_url)
        archive_type = "gztar" if download_name.endswith(".tar.gz") else "zip"
        FileUtils.download_and_extract_archive_verified(
            download_url,
            str(install_dir),
            archive_type,
            expected_sha256=_lua_ls_sha(lua_ls_version, download_name),
            allowed_hosts=LUA_LS_ALLOWED_HOSTS,
        )

View on GitHub (pinned to 7fcbca7e62)

Solutions

  1. Run Python under x86_64 emulation so platform.machine() reports AMD64 (use x64 Python installer)
  2. Build lua-language-server from source for Windows ARM and place the exe at install_dir/bin/lua-language-server.exe to skip download
  3. Use an x64 Windows machine or x64 VM/CI runner
  4. Check `python -c "import platform;print(platform.machine())"` to confirm what the library sees

Example fix

// before
winget install Python.Python.3.11  # ARM64 build on Windows ARM
// after
winget install Python.Python.3.11 --architecture x64  # emulated x64 -> amd64 detected
Defensive patterns

Strategy: validation

Validate before calling

import platform
machine = platform.machine().lower()
if platform.system() == "Windows" and machine not in ("amd64", "x86_64"):
    raise SystemExit(f"lua-language-server only ships win32-x64; machine={machine} (use x64 Python under emulation)")

Try / catch

try:
    server = create_lua_server()
except RuntimeError as e:
    if "Unsupported Windows architecture" in str(e):
        reexec_with_x64_python()
    else:
        raise

Prevention

When it happens

Trigger: Calling _download_lua_ls on Windows ARM (platform.machine() == 'arm64' or 'arm'), e.g. Surface Pro X / Snapdragon laptops running Python natively.

Common situations: Windows-on-ARM laptops, ARM-based Azure VMs, running x86 Python under emulation where machine still reports ARM64 in some environments.

Related errors


AI-assisted analysis of oraios/serena@7fcbca7e62 (2026-08-29). Data as JSON: /api/errors/50c7b90ad5f3e37e. Report an issue: GitHub.