jdx/mise · error

only available on macos

Error message

only available on macos

What it means

Platform precondition in the mas (Mac App Store) manager's bin(): mas only exists on macOS, so on any other OS the manager bails immediately instead of attempting to locate or run the binary. This is an environment guard, not a data error.

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 afd2eddd3a)

Solutions

  1. Use the mas manager only on macOS hosts
  2. On other platforms, pick a package manager available for that OS
  3. Exclude mas entries from configs applied to non-macOS machines
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at src/system/packages/mas.rs:29 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/e4c2a4f5f817c532. Report an issue: GitHub.