{"record":{"id":"0cc9ea545fa00e04","repo":"jdx/mise","slug":"err-artifacts","errorCode":null,"errorMessage":"{err}","messagePattern":"\\{err\\}","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/system/packages/brew/cask/artifacts.rs","lineNumber":122,"sourceCode":"            && !has_lifecycle_hook(cask, \"postflight\");\n        if !font_only {\n            bail!(\n                \"brew-cask:{}: only font-only casks without lifecycle hooks are supported on linux\",\n                cask.token\n            );\n        }\n    }\n    #[cfg(not(target_os = \"linux\"))]\n    let _ = (cask, artifacts);\n    Ok(())\n}\n\npub(super) fn platform_unavailable_state(\n    cask: &Cask,\n    artifacts: &CaskArtifacts,\n) -> Option<PackageState> {\n    validate_platform_support(cask, artifacts)\n        .err()\n        .map(|err| PackageState::unavailable(err.to_string()))\n}\n\npub(super) fn declared_target(value: &Value) -> Option<String> {\n    value\n        .as_object()\n        .and_then(|o| o.get(\"target\"))\n        .and_then(Value::as_str)\n        .map(str::to_string)\n}\n\npub(super) fn artifact_target(value: &Value, values: &[Value]) -> Option<String> {\n    values\n        .get(1)\n        .and_then(|v| v.as_object())\n        .and_then(|o| o.get(\"target\"))\n        .and_then(Value::as_str)\n        .map(str::to_string)","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/packages/brew/cask/artifacts.rs#L104-L140","documentation":"In src/system/packages/brew/cask/artifacts.rs, platform_unavailable_state calls validate_platform_support(cask, artifacts) and, if it returns Err, wraps the error string into PackageState::unavailable(err.to_string()) (message rendered as `{err}`). This is not a crash: the cask is marked unavailable because its platform is not supported by the cask's declared artifacts.","triggerScenarios":"Resolving package state for a Homebrew cask whose artifacts (e.g. `app`, `binary` stanzas gated on `on_macos`/`on_arm`/`on_intel`) do not cover the current platform, so validate_platform_support fails.","commonSituations":"Installing a macOS cask on Linux, an Intel-only cask on Apple Silicon, or a cask whose platform stanza excludes the running macOS version/architecture.","solutions":["Accept the unavailable state if the cask genuinely doesn't support your platform; choose an alternative package.","Verify the cask's platform/artifact stanzas cover your OS/arch, or update the cask.","Run on a supported platform (correct macOS version/architecture) if the package is required."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"// check the cask supports the current platform before requesting it\nlet state = package_state(&cask, &artifacts);\nif state.is_unavailable() {\n    eprintln!(\"cask {} unavailable: {}\", cask.token, state.reason());\n}","typeGuard":"fn cask_supports(cask: &Cask, os: Os, arch: Arch) -> bool {\n    cask.artifacts.iter().any(|a| a.supports(os, arch))\n}","tryCatchPattern":null,"preventionTips":["Check cask platform stanzas (on_macos/on_arm/on_intel) before adding the package to config.","Provide Linux/alternative-source equivalents for macOS-only casks.","Gate macOS-only packages in CI with OS conditions."],"tags":["homebrew","cask","platform","compatibility"],"backgroundTag":"unsupported-platform","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}