gitbutlerapp/gitbutler · error
unsupported OS or architecture
Error message
unsupported OS or architecture: {os} {arch} What it means
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.
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.
Example fix
// before
let config = Config::new_with_version("windows", "x86_64", ...)?;
// after
if !(cfg!(target_os = "macos") || cfg!(target_os = "linux")) {
eprintln!("but installer supports only macOS and Linux");
std::process::exit(1);
}
let arch = if cfg!(target_arch = "aarch64") { "aarch64" } else { "x86_64" };
let os = if cfg!(target_os = "macos") { "macos" } else { "linux" };
let config = Config::new_with_version(os, arch, ...)?; Defensive patterns
Strategy: validation
Validate before calling
const SUPPORTED: [(&str, &str); 4] = [("macos","aarch64"),("macos","x86_64"),("linux","aarch64"),("linux","x86_64")];
fn is_supported(os: &str, arch: &str) -> bool {
SUPPORTED.contains(&(os, arch))
}
if !is_supported(os, arch) { eprintln!("unsupported: {os} {arch}"); std::process::exit(1); } Type guard
fn normalize_platform(os: &str, arch: &str) -> Option<(&str, &str)> {
let os = match os { "darwin" | "macos" => "macos", "linux" => "linux", _ => return None };
let arch = match arch { "arm64" | "aarch64" => "aarch64", "amd64" | "x86_64" => "x86_64", _ => return None };
Some((os, arch))
} Prevention
- 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.
When it happens
Trigger: 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").
Common situations: 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.
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
- A 'but' binary already exists at
- Attempting to restore backup
- Automatic CLI installation is not supported on Windows. To…
- Cannot write to ( )
- Could not detect your shell configuration file
AI-assisted analysis of gitbutlerapp/gitbutler@58e5313667 (2026-09-18).
Data as JSON: /api/errors/7ca3c852f3987167.
Report an issue: GitHub.
Appendix: 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 58e5313667)