astrid-runtime/astrid · error
Unsupported Windows architecture: {arch}
Error message
Unsupported Windows architecture: {arch} What it means
`platform_target_for` supports only x86_64 on Windows (x86_64-pc-windows-msvc). Any other Windows architecture (e.g. aarch64) has no published artifact, so the update path bails with this message rather than downloading a binary that cannot run.
Source
Thrown at crates/astrid-cli/src/commands/self_update/mod.rs:125
"musl"
} else {
""
}
}
fn platform_target_for(os: &str, arch: &str, target_env: &str) -> anyhow::Result<&'static str> {
match (os, arch, target_env) {
("macos", "aarch64", _) => Ok("aarch64-apple-darwin"),
("macos", "x86_64", _) => Ok("x86_64-apple-darwin"),
("linux", "x86_64", "musl") => Ok("x86_64-unknown-linux-musl"),
("linux", "aarch64", "musl") => Ok("aarch64-unknown-linux-musl"),
("linux", "x86_64", "gnu") => Ok("x86_64-unknown-linux-gnu"),
("linux", "aarch64", "gnu") => Ok("aarch64-unknown-linux-gnu"),
("linux", "x86_64" | "aarch64", env) => {
bail!("Unsupported Linux target environment: {env}")
},
("windows", "x86_64", _) => Ok("x86_64-pc-windows-msvc"),
("windows", arch, _) => bail!("Unsupported Windows architecture: {arch}"),
_ => bail!("Unsupported platform: {os}/{arch}"),
}
}
/// Resolved path of the currently-running `astrid` binary (symlinks followed) —
/// what self-update replaces in place.
fn running_binary() -> anyhow::Result<PathBuf> {
let exe = std::env::current_exe().context("cannot determine current executable path")?;
Ok(exe.canonicalize().unwrap_or(exe))
}
/// Whether `exe` is a Homebrew-managed binary. Homebrew symlinks `bin/astrid`
/// into `…/Cellar/astrid/<version>/bin/astrid`, so the resolved path always
/// contains a `Cellar` component. Such installs update via `brew upgrade`, not
/// self-update — we must not shadow them with a second copy.
fn is_homebrew_managed(exe: &Path) -> bool {
exe.components().any(|c| {
c.as_os_str()View on GitHub (pinned to affd8760f4)
Solutions
- Download the x86_64-pc-windows-msvc build manually and keep running it under emulation; skip self-update.
- Check `rustc -vV` to confirm the host arch.
- Publish aarch64-pc-windows-msvc artifacts and add a match arm to enable native Windows ARM updates.
- Pin the CLI version and update via package manager instead of self-update.
Example fix
// before
("windows", arch, _) => bail!("Unsupported Windows architecture: {arch}"),
// after
("windows", "aarch64", _) => Ok("aarch64-pc-windows-msvc"),
("windows", arch, _) => bail!("Unsupported Windows architecture: {arch}"), Defensive patterns
Strategy: fallback
Validate before calling
if [ "$(uname -s)" = Windows_NT ] && [ "$(uname -m)" != x86_64 ]; then echo "self-update unsupported; install x86_64 build manually" fi
Type guard
fn supported_windows_target(arch: &str) -> bool { arch == "x86_64" } Try / catch
match platform_target() {
Ok(t) => download(t),
Err(e) if e.to_string().contains("Unsupported Windows architecture") => {
eprintln!("run the x86_64-pc-windows-msvc build under emulation, or update via package manager");
}
Err(e) => return Err(e),
} Prevention
- On Windows ARM, prefer the package-manager install path over self-update.
- Skip self-update in CI matrices that include arm64 Windows runners.
- Publish aarch64-pc-windows-msvc artifacts to enable native support.
When it happens
Trigger: `astrid self update` on Windows running on ARM64 (or any non-x86_64 arch), where the ("windows", arch, _) arm of the match is reached with arch != "x86_64".
Common situations: Windows on ARM (Surface Pro X, Snapdragon laptops) running the x64 CLI under emulation, then attempting self-update; CI matrix accidentally running the updater on an arm64 Windows runner.
Understand the failure class
Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.
Related errors
- Unsupported Linux target environment: {env}
- Unsupported platform: {os}/{arch}
- MCP gateway attach is only supported on Unix hosts
- MCP gateway is only supported on Unix hosts
- {label} download failed: HTTP {status}
AI-assisted analysis of astrid-runtime/astrid@affd8760f4 (2026-09-09).
Data as JSON: /api/errors/e089201a69a62f86.
Report an issue: GitHub.