{"record":{"id":"7ca3c852f3987167","repo":"gitbutlerapp/gitbutler","slug":"unsupported-os-or-architecture-os-arch","errorCode":null,"errorMessage":"unsupported OS or architecture: {os} {arch}","messagePattern":"unsupported OS or architecture: (.+?) (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but-installer/src/config.rs","lineNumber":160,"sourceCode":"        let version_request = VersionRequest::from_string(version_string)?;\n        Self::new_with_version(version_request)\n    }\n\n    /// Create a new installer config with an explicit version request\n    pub(crate) fn new_with_version(version_request: VersionRequest) -> Result<Self> {\n        let home_dir =\n            dirs::home_dir().ok_or_else(|| anyhow!(\"Failed to determine home directory\"))?;\n\n        // Detect platform\n        let os = env::consts::OS;\n        let arch = env::consts::ARCH;\n\n        let platform = match (os, arch) {\n            (\"macos\", \"aarch64\") => \"darwin-aarch64\",\n            (\"macos\", \"x86_64\") => \"darwin-x86_64\",\n            (\"linux\", \"aarch64\") => \"linux-aarch64\",\n            (\"linux\", \"x86_64\") => \"linux-x86_64\",\n            (os, arch) => bail!(\"unsupported OS or architecture: {os} {arch}\"),\n        };\n\n        Ok(Self {\n            version_request,\n            home_dir,\n            platform: platform.to_string(),\n        })\n    }\n\n    pub fn releases_url(&self) -> String {\n        match &self.version_request {\n            VersionRequest::Nightly => \"https://app.gitbutler.com/releases/nightly\".to_string(),\n            VersionRequest::Specific(version) => {\n                format!(\n                    \"https://app.gitbutler.com/releases/version/{}\",\n                    version.as_str()\n                )\n            }","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but-installer/src/config.rs#L142-L178","documentation":"The but-installer only supports four platform combinations (macOS/Linux × aarch64/x86_64). When `Config::new_with_version` is called with an os/arch pair outside that table, construction fails with this message because no download artifact URL can be formed for the platform.","triggerScenarios":"Calling Config::new_with_version with e.g. (\"windows\", \"x86_64\"), (\"freebsd\", \"amd64\"), (\"linux\", \"armv7\"), or any os/arch string that is not exactly one of the four matched literals (note exact spellings: \"x86_64\" not \"x64\", \"macos\" not \"darwin\").","commonSituations":"Running the installer on Windows or a BSD; auto-detected architecture strings like \"arm64\" instead of \"aarch64\"; unusual hardware such as Raspberry Pi 32-bit or musl/Alpine x86 builds; passing a normalized os string that differs from the expected literal.","solutions":["Run on a supported platform: macOS or Linux on aarch64 or x86_64.","Check the spelling of the os/arch values — they must be exactly \"macos\"/\"linux\" and \"aarch64\"/\"x86_64\" (e.g. map \"arm64\"→\"aarch64\", \"darwin\"→\"macos\" before calling).","For unsupported platforms, build the but CLI from source instead of using the installer."],"exampleFix":"// before\nlet config = Config::new_with_version(\"windows\", \"x86_64\", ...)?;\n// after\nif !(cfg!(target_os = \"macos\") || cfg!(target_os = \"linux\")) {\n    eprintln!(\"but installer supports only macOS and Linux\");\n    std::process::exit(1);\n}\nlet arch = if cfg!(target_arch = \"aarch64\") { \"aarch64\" } else { \"x86_64\" };\nlet os = if cfg!(target_os = \"macos\") { \"macos\" } else { \"linux\" };\nlet config = Config::new_with_version(os, arch, ...)?;","handlingStrategy":"validation","validationCode":"const SUPPORTED: [(&str, &str); 4] = [(\"macos\",\"aarch64\"),(\"macos\",\"x86_64\"),(\"linux\",\"aarch64\"),(\"linux\",\"x86_64\")];\nfn is_supported(os: &str, arch: &str) -> bool {\n    SUPPORTED.contains(&(os, arch))\n}\nif !is_supported(os, arch) { eprintln!(\"unsupported: {os} {arch}\"); std::process::exit(1); }","typeGuard":"fn normalize_platform(os: &str, arch: &str) -> Option<(&str, &str)> {\n    let os = match os { \"darwin\" | \"macos\" => \"macos\", \"linux\" => \"linux\", _ => return None };\n    let arch = match arch { \"arm64\" | \"aarch64\" => \"aarch64\", \"amd64\" | \"x86_64\" => \"x86_64\", _ => return None };\n    Some((os, arch))\n}","tryCatchPattern":null,"preventionTips":["Normalize os/arch strings (\"darwin\"→\"macos\", \"arm64\"→\"aarch64\") before constructing the installer Config.","Check cfg!(target_os)/cfg!(target_arch) and exit early with a clear message on unsupported targets.","Document supported platforms in your tool's README so users don't attempt Windows installs."],"tags":["unsupported-platform","installer","architecture"],"backgroundTag":"unsupported-platform","analyzedSha":"58e5313667b857ef39a730e380af31816a7b1768","analyzedAt":"2026-09-18T06:50:32.052Z","contentChangedAt":"2026-09-18T06:50:32.052Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}