{"record":{"id":"1ba94172c5b7c77e","repo":"jdx/mise","slug":"brew-cask-only-font-only-casks-without-lifecyc","errorCode":null,"errorMessage":"brew-cask:{}: only font-only casks without lifecycle hooks are supported on linux","messagePattern":"brew-cask:(.+?): only font-only casks without lifecycle hooks are supported on linux","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/cask.rs","lineNumber":5047,"sourceCode":"\nfn validate_platform_support(cask: &Cask, artifacts: &CaskArtifacts) -> Result<()> {\n    #[cfg(target_os = \"linux\")]\n    {\n        let font_only = !artifacts.fonts.is_empty()\n            && artifacts.apps.is_empty()\n            && artifacts.binaries.is_empty()\n            && artifacts.command_wrappers.is_empty()\n            && artifacts.pkgs.is_empty()\n            && artifacts.installers.is_empty()\n            && artifacts.generic.is_empty()\n            && artifacts.completions.is_empty()\n            && artifacts.generated_completions.is_empty()\n            && artifacts.preflight_steps.is_empty()\n            && artifacts.postflight_steps.is_empty()\n            && !has_lifecycle_hook(cask, \"preflight\")\n            && !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\nfn platform_unavailable_state(cask: &Cask, artifacts: &CaskArtifacts) -> Option<PackageState> {\n    validate_platform_support(cask, artifacts)\n        .err()\n        .map(|err| PackageState::unavailable(err.to_string()))\n}\n\nfn artifact_target(value: &Value, values: &[Value]) -> Option<String> {\n    values","sourceCodeStart":5029,"sourceCodeEnd":5065,"githubUrl":"https://github.com/jdx/mise/blob/6f52dcdf99e282ef7a7db68c81301fa4618d0f79/src/system/packages/brew/cask.rs#L5029-L5065","documentation":"On Linux, mise's brew-cask support only handles casks that install fonts and nothing else — no apps, binaries, pkgs, installers, generic artifacts, completions, or preflight/postflight lifecycle hooks. validate_platform_support checks exactly that shape under cfg(target_os = \"linux\") and bails with the cask token otherwise, because macOS GUI install machinery (.app bundles, pkgs, launchservices) cannot be reproduced on Linux.","triggerScenarios":"Running `mise use brew-cask:<token>` / `mise install` for a standard macOS app cask on a Linux machine: the artifact inventory contains apps/binaries/pkgs or the cask declares preflight/postflight hooks, failing the font_only conjunction at src/system/packages/brew/cask.rs:5047.","commonSituations":"Shared mise.toml between a Mac and a Linux box pinning a brew-cask; CI on Linux inheriting a teammate's cask entries; font casks that also ship a helper binary (disqualified by the non-empty binaries list).","solutions":["On Linux, remove or gate the brew-cask entry (e.g. move it into a macOS-specific config such as a `[tools]` section scoped by platform, or use mise's per-OS config files).","Install the tool through a native channel on Linux: a brew formula if the CLI exists as one, an aqua/github backend, or the system package manager.","Confirm the cask really is non-font (brew info --cask): if it is fonts-only without hooks it should pass — a failure then worth reporting as a bug."],"exampleFix":"# before — shared mise.toml breaks Linux\n[tools]\n\"brew-cask:visual-studio-code\" = \"latest\"\n\n# after — scope cask to macOS via per-platform config (mise.macos.toml or darwin guard)\n# mise.linux.toml keeps native tools only","handlingStrategy":"validation","validationCode":"# keep macOS-only casks out of Linux configs\nif [ \"$(uname -s)\" != \"Darwin\" ]; then\n  grep -q 'brew-cask:' mise.toml && echo 'move brew-cask entries to a macOS-specific config (e.g. mise.macos.toml)'\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Split tool lists per OS (mise.macos.toml / mise.linux.toml) instead of one shared mise.toml.","On Linux, use native backends (aqua, github, cargo) for tools pinned as brew-casks on macOS.","Treat any brew-cask entry on Linux as suspect unless it is fonts-only."],"tags":["brew-cask","linux","platform-support","mise"],"backgroundTag":"platform-not-supported","analyzedSha":"6f52dcdf99e282ef7a7db68c81301fa4618d0f79","analyzedAt":"2026-08-22T10:14:23.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}