zed-industries/zed · error · anyhow::Error

unsupported os

Error message

unsupported os

What it means

platform::Host::current_platform maps Rust's compile-time env::consts::OS onto the WIT platform::Os enum, which only has Mac, Linux, and Windows. Any other OS string — FreeBSD, OpenBSD, DragonFly, Android, etc. — bails with "unsupported os". Because the value is a build-time constant, the error fires deterministically for every extension that queries the platform on such a build.

Solutions

  1. Run on macOS, Linux, or Windows where the host is supported
  2. If porting the app, patch the match to add an arm (e.g. map freebsd to platform::Os::Linux only if the WIT enum is also extended — otherwise keep extensions disabled)
  3. Report the platform gap upstream so the WIT Os enum grows a variant
Defensive patterns

Strategy: fallback

Validate before calling

// gate extension features before any platform query
if !matches!(std::env::consts::OS, "macos" | "linux" | "windows") {
    // skip current_platform() / disable platform-dependent extension paths
}

Type guard

fn is_supported_os() -> bool {
    matches!(std::env::consts::OS, "macos" | "linux" | "windows")
}

Prevention

When it happens

Trigger: Running the extension host binary on an OS other than macOS, Linux, or Windows (e.g. FreeBSD port, Android/Termux) and having any extension call current_platform().

Common situations: Community builds of the editor for BSD variants, or an embedded use of the extension_host crate on a niche platform; every wasm extension that gates download logic on platform fails immediately.

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


AI-assisted analysis of zed-industries/zed@5a9b9558db (2026-08-20). Data as JSON: /api/errors/f333703e3fe95022. Report an issue: GitHub.

Appendix: source

Thrown at crates/extension_host/src/wasm_host/wit/since_v0_8_0.rs:868

    async fn github_release_by_tag_name(
        &mut self,
        repo: String,
        tag: String,
    ) -> wasmtime::Result<Result<github::GithubRelease, String>> {
        maybe!(async {
            let release = ::http_client::github::get_release_by_tag_name(
                &repo,
                &tag,
                self.host.http_client.clone(),
            )
            .await?;
            Ok(release.into())
        })
        .await
        .to_wasmtime_result()
    }
}

impl platform::Host for WasmState {
    async fn current_platform(
        &mut self,
    ) -> wasmtime::Result<(platform::Os, platform::Architecture)> {
        Ok((
            match env::consts::OS {
                "macos" => platform::Os::Mac,
                "linux" => platform::Os::Linux,
                "windows" => platform::Os::Windows,
                _ => return Err(wasmtime::Error::msg("unsupported os")),
            },
            match env::consts::ARCH {
                "aarch64" => platform::Architecture::Aarch64,
                "x86_64" => platform::Architecture::X8664,
                _ => return Err(wasmtime::Error::msg("unsupported architecture")),
            },
        ))

View on GitHub (pinned to 5a9b9558db)