astrid-runtime/astrid · error
Unsupported platform: {os}/{arch}
Error message
Unsupported platform: {os}/{arch} What it means
The final catch-all arm of `platform_target_for` bails for any (os, arch) combination not explicitly handled: macOS (x86_64), Linux (x86_64/aarch64), and Windows x86_64 are the only supported targets. Anything else — FreeBSD, other macOS archs, unknown OS strings — produces this message.
Source
Thrown at crates/astrid-cli/src/commands/self_update/mod.rs:126
} 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()
.to_str()View on GitHub (pinned to affd8760f4)
Solutions
- Install/upgrade the CLI manually (cargo install or release download) instead of self-update on unsupported platforms.
- Verify the detected os/arch via `rustc -vV` to confirm the platform is genuinely unsupported.
- If your platform should be supported, add a match arm publishing the corresponding target triple.
- Use a supported platform or container (linux/macos/windows) to run self-update.
Example fix
// before
_ => bail!("Unsupported platform: {os}/{arch}"),
// after
("macos", "aarch64", _) => Ok("aarch64-apple-darwin"),
_ => bail!("Unsupported platform: {os}/{arch}"), Defensive patterns
Strategy: fallback
Validate before calling
case "$(uname -s):$(uname -m)" in Linux:x86_64|Linux:aarch64|Darwin:x86_64|MINGW*:x86_64) ;; *) echo "self-update unsupported on this platform; install manually" ;; esac
Type guard
fn supported_platform(os: &str, arch: &str) -> bool {
matches!(
(os, arch),
("macos", "x86_64") | ("linux", "x86_64" | "aarch64") | ("windows", "x86_64")
)
} Try / catch
match platform_target() {
Ok(t) => download(t),
Err(e) if e.to_string().starts_with("Unsupported platform") => {
eprintln!("use cargo install or a manual download on this OS");
}
Err(e) => return Err(e),
} Prevention
- Only rely on self-update on linux/macos/windows; use cargo install elsewhere.
- Verify the detected platform with `rustc -vV` if unsure.
- Document supported platforms in the README so users don't hit the bail.
- Add explicit match arms as you publish artifacts for new platforms.
When it happens
Trigger: `astrid self update` on an OS other than macos/linux/windows (e.g. FreeBSD, OpenBSD) or a macOS host with a non-x86_64 detected arch, or when OS detection yields an unrecognized string.
Common situations: Running the CLI on BSD variants or other Unixes; broken/patched builds that misreport cfg!(target_os); macOS aarch64 if only x86_64 mac artifacts exist and detection labels it oddly.
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 Windows architecture: {arch}
- {label} download failed: HTTP {status}
- cannot remove capsule authority while an install transaction
- an incomplete capsule authority update exists at {}; remove
AI-assisted analysis of astrid-runtime/astrid@affd8760f4 (2026-09-09).
Data as JSON: /api/errors/8fac5331b5905353.
Report an issue: GitHub.