jdx/mise · error

only available on macos

Error message

only available on macos

What it means

The mas (Mac App Store) backend only works on macOS because the `mas` CLI itself is macOS-only. `bin()` is the gatekeeper every mas operation passes through to locate the binary, so any mas backend call on Linux or Windows fails immediately with this message before any subprocess is spawned.

Solutions

  1. Run the command on a macOS machine, or restrict mas package entries to macOS-specific config files that are only loaded there.
  2. Use platform-conditional configuration so mas packages are only requested when `cfg!(target_os = "macos")`-equivalent (uname == Darwin) holds.
  3. Replace mas-managed packages with a cross-platform source if you need the same setup on non-Apple machines.

Example fix

// before
backend.install(&mas_pkgs, &opts).await?; // panics into bail on Linux
// after
if cfg!(target_os = "macos") {
    backend.install(&mas_pkgs, &opts).await?;
}
Defensive patterns

Strategy: validation

Validate before calling

if !cfg!(target_os = "macos") { return; } // skip mas operations on other platforms
backend.installed(&pkgs, &opts).await?;

Type guard

fn mas_supported() -> bool { cfg!(target_os = "macos") }

Prevention

When it happens

Trigger: Any operation on the mas package backend (installed/list, install, upgrade) invoked on a non-macOS target, since each path first resolves the mas binary via `bin()` which checks `cfg!(target_os = "macos")`.

Common situations: Shared mise config or toolset files listing mas-managed packages synced to a Linux CI machine or Windows workstation; running a cross-platform dotfiles bootstrap that includes Mac App Store apps.

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@533346cc37 (2026-09-17). Data as JSON: /api/errors/e4c2a4f5f817c532. Report an issue: GitHub.

Appendix: source

Thrown at src/system/packages/mas.rs:29

use crate::backend::configured_toolset_or_path_which;
use crate::config::Config;
use crate::result::Result;

/// Mac App Store apps via the `mas` CLI.
pub(crate) struct MasManager {
    bin: OnceCell<PathBuf>,
}

impl MasManager {
    pub(crate) fn new() -> Self {
        Self {
            bin: OnceCell::new(),
        }
    }

    async fn bin(&self) -> Result<&PathBuf> {
        if !cfg!(target_os = "macos") {
            bail!("only available on macos");
        }
        self.bin
            .get_or_try_init(|| async {
                let config = Config::get().await?;
                configured_toolset_or_path_which(&config, ["mas".to_string()], "mas")
                    .await?
                    .ok_or_else(|| eyre!("mas not found"))
            })
            .await
    }
}

#[derive(Debug, Clone, PartialEq, Eq)]
struct InstalledApp {
    adam_id: Option<String>,
    bundle_id: Option<String>,
    version: String,
}

View on GitHub (pinned to 533346cc37)