{"record":{"id":"c33fa2abb504009d","repo":"jdx/mise","slug":"brew-prune-is-not-supported-on-windows","errorCode":null,"errorMessage":"brew prune is not supported on windows","messagePattern":"brew prune is not supported on windows","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/system/prune.rs","lineNumber":224,"sourceCode":"            .iter()\n            .map(|candidate| format!(\"{}@{}\", candidate.token, candidate.version))\n            .collect::<Vec<_>>();\n        if !self.yes && !Settings::get().yes && console::user_attended_stderr() {\n            let msg = format!(\"brew-cask: prune {}?\", remove.join(\", \"));\n            if !prompt::confirm(msg)?.is_yes() {\n                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","sourceCodeStart":206,"sourceCodeEnd":233,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/system/prune.rs#L206-L233","documentation":"The brew prune path in mise is compiled only for unix targets. On non-unix builds (Windows), `run_brew` is a stub that unconditionally bails, because Homebrew does not exist on Windows and there is no formula-prune implementation to fall back to.","triggerScenarios":"Invoking `mise system prune brew` (run_inner dispatching by manager name) on a Windows build of mise — the `#[cfg(not(unix))]` stub always returns this error regardless of arguments.","commonSituations":"Windows users attempting Homebrew-style package pruning, e.g. after copying unix documentation or scripts; CI matrix accidentally running the brew prune step on a windows runner.","solutions":["Run `mise system prune brew` on macOS or Linux instead of Windows","Skip the brew prune step in Windows CI/scripts (guard on OS)","If you need Windows package cleanup, use a Windows-native manager (e.g. scoop/winget flows) rather than the brew manager"],"exampleFix":"// before (windows runner)\n- run: mise system prune brew\n// after\n- run: mise system prune brew\n  if: runner.os != 'Windows'","handlingStrategy":"fallback","validationCode":"[[ \"$(uname -s)\" != MINGW* && \"$(uname -s)\" != CYGWIN* ]] && mise system prune brew","typeGuard":null,"tryCatchPattern":"mise system prune brew 2>/dev/null || echo 'brew prune unsupported on this platform'","preventionTips":["Guard brew commands with an OS check in cross-platform scripts","Skip Homebrew steps on Windows CI runners","Document platform requirements in team scripts"],"tags":["windows","homebrew","prune","unsupported-platform"],"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"}