{"record":{"id":"e4c2a4f5f817c532","repo":"jdx/mise","slug":"only-available-on-macos","errorCode":null,"errorMessage":"only available on macos","messagePattern":"only available on macos","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/mas.rs","lineNumber":29,"sourceCode":"use crate::backend::configured_toolset_or_path_which;\nuse crate::config::Config;\nuse crate::result::Result;\n\n/// Mac App Store apps via the `mas` CLI.\npub(crate) struct MasManager {\n    bin: OnceCell<PathBuf>,\n}\n\nimpl MasManager {\n    pub(crate) fn new() -> Self {\n        Self {\n            bin: OnceCell::new(),\n        }\n    }\n\n    async fn bin(&self) -> Result<&PathBuf> {\n        if !cfg!(target_os = \"macos\") {\n            bail!(\"only available on macos\");\n        }\n        self.bin\n            .get_or_try_init(|| async {\n                let config = Config::get().await?;\n                configured_toolset_or_path_which(&config, [\"mas\".to_string()], \"mas\")\n                    .await?\n                    .ok_or_else(|| eyre!(\"mas not found\"))\n            })\n            .await\n    }\n}\n\n#[derive(Debug, Clone, PartialEq, Eq)]\nstruct InstalledApp {\n    adam_id: Option<String>,\n    bundle_id: Option<String>,\n    version: String,\n}","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/packages/mas.rs#L11-L47","documentation":"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.","triggerScenarios":"Thrown at src/system/packages/mas.rs:29 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use the mas manager only on macOS hosts","On other platforms, pick a package manager available for that OS","Exclude mas entries from configs applied to non-macOS machines"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}