jdx/mise · error

brew-cask prune is not supported on windows

Error message

brew-cask prune is not supported on windows

What it means

`mise system prune --manager brew-cask` was executed on Windows. The brew-cask code paths are compiled only for Unix (cfg(not(unix)) stubs), so the Windows build deliberately bails to make the unsupported platform explicit instead of silently skipping.

Solutions

  1. Run the brew-cask prune on macOS (the only platform where casks meaningfully exist)
  2. Guard the command with an OS check in scripts/CI
  3. Use a Windows-native package manager cleanup instead

Example fix

// before
mise system prune brew-cask  # on Windows
// after (script guard)
if [[ "$(uname -s)" == Darwin* ]]; then mise system prune brew-cask; fi
Defensive patterns

Strategy: fallback

Validate before calling

[[ "$(uname -s)" == Darwin* ]] && mise system prune brew-cask

Try / catch

mise system prune brew-cask 2>/dev/null || echo 'cask prune requires macOS'

Prevention

When it happens

Trigger: Invoking `mise system prune brew-cask` on a Windows build of mise — the `#[cfg(not(unix))]` stub always returns this error.

Common situations: Windows developers following macOS-oriented docs; windows-latest CI runners executing a prune script intended for macos runners.

Understand the failure class

Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/65d86da34df3cd30. Report an issue: GitHub.

Appendix: source

Thrown at src/cli/system/prune.rs:230

                info!("brew-cask: skipped");
                return Ok(());
            }
        }
        let removed = brew::apply_cask_prune_plan(&plan, false)?;
        info!("brew-cask: pruned {removed} casks");
        Ok(())
    }

    #[cfg(not(unix))]
    async fn run_brew(self) -> Result<()> {
        let _ = self.manager;
        bail!("brew prune is not supported on windows")
    }

    #[cfg(not(unix))]
    async fn run_brew_cask(self) -> Result<()> {
        let _ = self.manager;
        bail!("brew-cask prune is not supported on windows")
    }
}

View on GitHub (pinned to 533346cc37)