{"record":{"id":"60f2827de7a4e9a3","repo":"jdx/mise","slug":"brew-cask-only-font-only-casks-without-lifecyc-60f282","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":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/cask/artifacts.rs","lineNumber":106,"sourceCode":"\npub(super) fn 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\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}","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/packages/brew/cask/artifacts.rs#L88-L124","documentation":"On Linux, this implementation only supports brew casks that consist solely of font artifacts and declare no preflight/postflight lifecycle hooks (neither structured steps nor Ruby hooks). validate_platform_support bails for anything else, because installing app bundles or running brew's shell lifecycle scripts is not supported outside macOS.","triggerScenarios":"Calling install_one_with_ancestors or platform_unavailable_state on Linux for a cask that has any non-font install artifact (app, pkg, binary, generic, etc.) or defines preflight/postflight steps or Ruby lifecycle hooks — e.g. linux_supports_font_only_casks / linux_rejects_non_font_casks test cases.","commonSituations":"Trying to install a macOS application cask (browser, editor, CLI wrapped in .app) from a Linux machine using mise's brew backend; casks whose fonts are accompanied by installer scripts; CI on Linux runners attempting macOS cask installs.","solutions":["Install the software via a native Linux channel instead: the brew formula (not cask), apt/dnf package, or a mise-supported backend (aqua:, github:, etc.).","If the cask bundles fonts plus other artifacts, extract just the fonts manually or ask upstream for a fonts-only cask.","Run the installation on a macOS machine; this restriction only applies to target_os = \"linux\".","If it's your own cask, split fonts into a dedicated cask without preflight/postflight hooks so Linux installs succeed."],"exampleFix":"// before: one cask mixing app + font with hooks\ncask \"myfont\" do\n  app \"MyApp.app\"\n  font \"MyFont.ttf\"\n  preflight do\n    system_command \"/usr/bin/touch\", args: [\"/tmp/x\"]\n  end\nend\n// after: fonts-only cask, no hooks\ncask \"myfont\" do\n  font \"MyFont.ttf\"\nend","handlingStrategy":"fallback","validationCode":"import platform\nif platform.system() == \"Linux\" and not cask_is_font_only(cask_token):\n    raise Skip(f\"{cask_token}: non-font cask unsupported on linux\")","typeGuard":null,"tryCatchPattern":"match validate_platform_support(&cask, &artifacts) {\n    Err(e) if e.to_string().contains(\"only font-only casks\") => {\n        eprintln!(\"{}: install via formula/apt/github backend instead\", cask.token);\n        fallback_native_install(&cask.token)?;\n    }\n    other => other?,\n}","preventionTips":["On Linux hosts, restrict brew-cask installs to fonts-only casks.","Route app/software installs to native backends (brew formula, apt, aqua:, github:) on Linux.","Split mixed app+font casks so fonts get a dedicated hook-free cask.","Check platform support with `mise ls` / backend docs before scripting cask installs."],"tags":["linux","brew-cask","platform","fonts","unsupported-platform"],"backgroundTag":"unsupported-platform","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"}