gitbutlerapp/gitbutler · error
unsupported OS or architecture: {os} {arch}
Error message
unsupported OS or architecture: {os} {arch} What it means
InstallerConfig::new_with_version() maps (std::env::consts::OS, std::env::consts::ARCH) onto a release platform key (darwin-aarch64, darwin-x86_64, linux-aarch64, linux-x86_64). The bail fires when the compiled target is anything else, because the GitButler releases API has no artifact key for it. The crate is additionally gated with #![cfg(unix)], so Windows builds fail before this point.
Source
Thrown at crates/but-installer/src/config.rs:160
let version_request = VersionRequest::from_string(version_string)?;
Self::new_with_version(version_request)
}
/// Create a new installer config with an explicit version request
pub(crate) fn new_with_version(version_request: VersionRequest) -> Result<Self> {
let home_dir =
dirs::home_dir().ok_or_else(|| anyhow!("Failed to determine home directory"))?;
// Detect platform
let os = env::consts::OS;
let arch = env::consts::ARCH;
let platform = match (os, arch) {
("macos", "aarch64") => "darwin-aarch64",
("macos", "x86_64") => "darwin-x86_64",
("linux", "aarch64") => "linux-aarch64",
("linux", "x86_64") => "linux-x86_64",
(os, arch) => bail!("unsupported OS or architecture: {os} {arch}"),
};
Ok(Self {
version_request,
home_dir,
platform: platform.to_string(),
})
}
pub fn releases_url(&self) -> String {
match &self.version_request {
VersionRequest::Nightly => "https://app.gitbutler.com/releases/nightly".to_string(),
VersionRequest::Specific(version) => {
format!(
"https://app.gitbutler.com/releases/version/{}",
version.as_str()
)
}View on GitHub (pinned to caf1f223d3)
Solutions
- Run the installer on a supported target: macOS or Linux on x86_64 or aarch64
- On unsupported hardware, build the but CLI from source with cargo instead of using the installer
- On Windows, use the GitButler desktop installer or install inside WSL (linux-x86_64)
Defensive patterns
Strategy: validation
Validate before calling
let supported = matches!(
(std::env::consts::OS, std::env::consts::ARCH),
("macos" | "linux", "x86_64" | "aarch64")
);
if !supported {
eprintln!(
"but-installer supports macOS/Linux on x86_64/aarch64, not {} {}",
std::env::consts::OS,
std::env::consts::ARCH
);
std::process::exit(1);
}
but_installer::run_installation_with_version(request, interactive)?; Type guard
const fn is_supported_platform(os: &str, arch: &str) -> bool {
matches!((os, arch),
("macos", "aarch64") | ("macos", "x86_64") |
("linux", "aarch64") | ("linux", "x86_64"))
} Try / catch
match but_installer::run_installation_with_version(request, false) {
Err(e) if e.to_string().starts_with("unsupported OS or architecture") => {
// route to a source build or the platform-appropriate installer
fallback_install_path()?;
}
result => result,
} Prevention
- Check std::env::consts::OS/ARCH before invoking the installer
- Gate installer automation steps on supported platform triples in CI
- Offer a source-build fallback for unsupported targets
When it happens
Trigger: Running the installer binary on an unsupported target: windows/*, linux armv7 (32-bit ARM boards like older Raspberry Pis), riscv64, freebsd, netbsd, or any architecture other than x86_64/aarch64 on macOS or Linux.
Common situations: Trying to install on a Raspberry Pi with 32-bit Raspberry Pi OS; BSD systems; assuming a Windows build exists because the desktop app has one; cross-compiling the crate to an exotic target.
Related errors
- Too many arguments. Usage: but-installer [version|nightly] o
- Invalid version: empty string. Usage: but-installer [version
- Invalid version: {version}. Usage: but-installer [version|ni
- Invalid version format: {version}. Version must contain only
- Invalid version format: {version}. Version must contain at l
AI-assisted analysis of gitbutlerapp/gitbutler@caf1f223d3 (2026-08-20).
Data as JSON: /api/errors/7ca3c852f3987167.
Report an issue: GitHub.