{"record":{"id":"8fac5331b5905353","repo":"astrid-runtime/astrid","slug":"unsupported-platform-os-arch","errorCode":null,"errorMessage":"Unsupported platform: {os}/{arch}","messagePattern":"Unsupported platform: (.+?)/(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-cli/src/commands/self_update/mod.rs","lineNumber":126,"sourceCode":"    } else {\n        \"\"\n    }\n}\n\nfn platform_target_for(os: &str, arch: &str, target_env: &str) -> anyhow::Result<&'static str> {\n    match (os, arch, target_env) {\n        (\"macos\", \"aarch64\", _) => Ok(\"aarch64-apple-darwin\"),\n        (\"macos\", \"x86_64\", _) => Ok(\"x86_64-apple-darwin\"),\n        (\"linux\", \"x86_64\", \"musl\") => Ok(\"x86_64-unknown-linux-musl\"),\n        (\"linux\", \"aarch64\", \"musl\") => Ok(\"aarch64-unknown-linux-musl\"),\n        (\"linux\", \"x86_64\", \"gnu\") => Ok(\"x86_64-unknown-linux-gnu\"),\n        (\"linux\", \"aarch64\", \"gnu\") => Ok(\"aarch64-unknown-linux-gnu\"),\n        (\"linux\", \"x86_64\" | \"aarch64\", env) => {\n            bail!(\"Unsupported Linux target environment: {env}\")\n        },\n        (\"windows\", \"x86_64\", _) => Ok(\"x86_64-pc-windows-msvc\"),\n        (\"windows\", arch, _) => bail!(\"Unsupported Windows architecture: {arch}\"),\n        _ => bail!(\"Unsupported platform: {os}/{arch}\"),\n    }\n}\n\n/// Resolved path of the currently-running `astrid` binary (symlinks followed) —\n/// what self-update replaces in place.\nfn running_binary() -> anyhow::Result<PathBuf> {\n    let exe = std::env::current_exe().context(\"cannot determine current executable path\")?;\n    Ok(exe.canonicalize().unwrap_or(exe))\n}\n\n/// Whether `exe` is a Homebrew-managed binary. Homebrew symlinks `bin/astrid`\n/// into `…/Cellar/astrid/<version>/bin/astrid`, so the resolved path always\n/// contains a `Cellar` component. Such installs update via `brew upgrade`, not\n/// self-update — we must not shadow them with a second copy.\nfn is_homebrew_managed(exe: &Path) -> bool {\n    exe.components().any(|c| {\n        c.as_os_str()\n            .to_str()","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-cli/src/commands/self_update/mod.rs#L108-L144","documentation":"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.","triggerScenarios":"`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.","commonSituations":"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.","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."],"exampleFix":"// before\n_ => bail!(\"Unsupported platform: {os}/{arch}\"),\n// after\n(\"macos\", \"aarch64\", _) => Ok(\"aarch64-apple-darwin\"),\n_ => bail!(\"Unsupported platform: {os}/{arch}\"),","handlingStrategy":"fallback","validationCode":"case \"$(uname -s):$(uname -m)\" in\n  Linux:x86_64|Linux:aarch64|Darwin:x86_64|MINGW*:x86_64) ;;\n  *) echo \"self-update unsupported on this platform; install manually\" ;;\nesac","typeGuard":"fn supported_platform(os: &str, arch: &str) -> bool {\n    matches!(\n        (os, arch),\n        (\"macos\", \"x86_64\") | (\"linux\", \"x86_64\" | \"aarch64\") | (\"windows\", \"x86_64\")\n    )\n}","tryCatchPattern":"match platform_target() {\n    Ok(t) => download(t),\n    Err(e) if e.to_string().starts_with(\"Unsupported platform\") => {\n        eprintln!(\"use cargo install or a manual download on this OS\");\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["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."],"tags":["platform","self-update","os","rust"],"backgroundTag":"unsupported-platform","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}