{"record":{"id":"65d86da34df3cd30","repo":"jdx/mise","slug":"brew-cask-prune-is-not-supported-on-windows","errorCode":null,"errorMessage":"brew-cask prune is not supported on windows","messagePattern":"brew-cask prune is not supported on windows","errorType":"validation","errorClass":"eyre::Report","httpStatus":null,"severity":"error","filePath":"src/cli/system/prune.rs","lineNumber":152,"sourceCode":"                info!(\"brew-cask: skipped\");\n                return Ok(());\n            }\n        }\n        let removed = brew::apply_cask_prune_plan(&plan, false)?;\n        info!(\"brew-cask: pruned {removed} casks\");\n        Ok(())\n    }\n\n    #[cfg(not(unix))]\n    async fn run_brew(self) -> Result<()> {\n        let _ = self.manager;\n        bail!(\"brew prune is not supported on windows\")\n    }\n\n    #[cfg(not(unix))]\n    async fn run_brew_cask(self) -> Result<()> {\n        let _ = self.manager;\n        bail!(\"brew-cask prune is not supported on windows\")\n    }\n}\n\nstatic AFTER_LONG_HELP: &str = color_print::cstr!(\n    r#\"<bold><underline>Examples:</underline></bold>\n\n    $ <bold>mise bootstrap packages prune --manager brew</bold>\n    $ <bold>mise bootstrap packages prune --manager brew --dry-run</bold>\n    $ <bold>mise bootstrap packages prune --manager brew --yes</bold>\n    $ <bold>mise bootstrap packages prune --manager brew-cask --dry-run</bold>\n\"#\n);\n","sourceCodeStart":134,"sourceCodeEnd":165,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/cli/system/prune.rs#L134-L165","documentation":"The Windows build of mise compiles run_brew_cask as a stub (cfg(not(unix))) that always bails — cask pruning is unix/macOS-only. `mise bootstrap packages prune --manager brew-cask` on Windows fails before any availability check.","triggerScenarios":"Running `mise bootstrap packages prune --manager brew-cask` on any Windows host.","commonSituations":"Cross-platform bootstrap scripts that iterate all tracked managers (brew, brew-cask) hitting the Windows stub; Windows CI running a macOS-oriented pipeline.","solutions":["Guard the invocation with an OS check and skip brew-cask prune on Windows","Run the brew-cask workflow inside WSL","Use winget/choco/scoop for Windows package management"],"exampleFix":"# before\n$ mise bootstrap packages prune --manager brew-cask   # Windows\n# error: brew-cask prune is not supported on windows\n\n# after\n# only on unix\ncase \"$(uname)\" in Darwin|Linux) mise bootstrap packages prune --manager brew-cask;; esac","handlingStrategy":"validation","validationCode":"case \"$(uname)\" in\n  Darwin) mise bootstrap packages prune --manager brew-cask ;;\n  *) echo 'skip: brew-cask prune unsupported here' >&2 ;;\nesac","typeGuard":null,"tryCatchPattern":"mise bootstrap packages prune --manager brew-cask 2>/dev/null || echo 'skipped brew-cask prune (unsupported platform)' >&2","preventionTips":["Split package config by OS so Windows pipelines never see cask managers","Centralize platform gating in one helper used by all package scripts"],"tags":["mise","windows","brew-cask","prune","platform-support","system-packages"],"backgroundTag":"platform-not-supported","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}