jdx/mise · error

Unsupported OS '{}'. Supported: linux, macos, windows, andro

Error message

Unsupported OS '{}'. Supported: linux, macos, windows, android

What it means

After parsing, Platform::validate rejects OS values outside {linux, macos, windows, android}. The canonical trap is Apple platforms: mise says macos where Rust/Go toolchains and `uname` say darwin or osx, and win/win32 for Windows also fail. It fires while parsing `mise lock -p` values or the lockfile_platforms setting.

Source

Thrown at src/platform.rs:79

    }

    pub(crate) fn libc(&self) -> Option<&str> {
        self.qualifier
            .as_deref()?
            .split('-')
            .find_map(|part| match part {
                "gnu" | "glibc" => Some("gnu"),
                "musl" => Some("musl"),
                _ => None,
            })
    }

    /// Validate that this platform is supported
    pub(crate) fn validate(&self) -> Result<()> {
        // Validate OS
        match self.os.as_str() {
            "linux" | "macos" | "windows" | "android" => {}
            _ => bail!(
                "Unsupported OS '{}'. Supported: linux, macos, windows, android",
                self.os
            ),
        }

        // Validate architecture
        match self.arch.as_str() {
            "x64" | "arm64" | "x86" | "loongarch64" | "riscv64" => {}
            _ => bail!(
                "Unsupported architecture '{}'. Supported: x64, arm64, x86, loongarch64, riscv64",
                self.arch
            ),
        }

        // Validate qualifier if present
        if let Some(qualifier) = &self.qualifier {
            match qualifier.as_str() {
                "gnu" | "glibc" | "musl" | "msvc" | "baseline" | "musl-baseline" => {}

View on GitHub (pinned to 6f52dcdf99)

Solutions

  1. Use macos for Apple platforms (darwin and osx both map to macos).
  2. Use windows in full (not win or win32).
  3. Drop OSes outside linux/macos/windows/android from the platform list — they are not lockfile dimensions mise supports.

Example fix

# before
mise lock -p darwin-arm64 -p win-x64

# after
mise lock -p macos-arm64 -p windows-x64
Defensive patterns

Strategy: validation

Validate before calling

os="${PLATFORM%%-*}"
case "$os" in
  linux|macos|windows|android) ;;
  *) echo "unsupported OS: $os (mise uses macos, not darwin/osx)"; exit 2;;
esac

Type guard

fn supported_os(s: &str) -> bool {
    matches!(s, "linux" | "macos" | "windows" | "android")
}

Prevention

When it happens

Trigger: `mise lock -p darwin-arm64`, `-p osx-x64`, `-p win-x64`, or `-p freebsd-x64` — the first hyphen-separated segment is not in the allowlist.

Common situations: Porting GOOS/Rust target names into lockfile config; CI matrices generating "osx" from GitHub Actions runner labels; assuming freebsd/ios are supported.

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 jdx/mise@6f52dcdf99 (2026-08-22). Data as JSON: /api/errors/ec7eaec22d674e66. Report an issue: GitHub.