jdx/mise · error · eyre::Report

brew-cask prune is not supported on windows

Error message

brew-cask prune is not supported on windows

What it means

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.

Source

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

                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")
    }
}

static AFTER_LONG_HELP: &str = color_print::cstr!(
    r#"<bold><underline>Examples:</underline></bold>

    $ <bold>mise bootstrap packages prune --manager brew</bold>
    $ <bold>mise bootstrap packages prune --manager brew --dry-run</bold>
    $ <bold>mise bootstrap packages prune --manager brew --yes</bold>
    $ <bold>mise bootstrap packages prune --manager brew-cask --dry-run</bold>
"#
);

View on GitHub (pinned to 9dcfcaa0dc)

Solutions

  1. Guard the invocation with an OS check and skip brew-cask prune on Windows
  2. Run the brew-cask workflow inside WSL
  3. Use winget/choco/scoop for Windows package management

Example fix

# before
$ mise bootstrap packages prune --manager brew-cask   # Windows
# error: brew-cask prune is not supported on windows

# after
# only on unix
case "$(uname)" in Darwin|Linux) mise bootstrap packages prune --manager brew-cask;; esac
Defensive patterns

Strategy: validation

Validate before calling

case "$(uname)" in
  Darwin) mise bootstrap packages prune --manager brew-cask ;;
  *) echo 'skip: brew-cask prune unsupported here' >&2 ;;
esac

Try / catch

mise bootstrap packages prune --manager brew-cask 2>/dev/null || echo 'skipped brew-cask prune (unsupported platform)' >&2

Prevention

When it happens

Trigger: Running `mise bootstrap packages prune --manager brew-cask` on any Windows host.

Common situations: Cross-platform bootstrap scripts that iterate all tracked managers (brew, brew-cask) hitting the Windows stub; Windows CI running a macOS-oriented pipeline.

Related errors


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