jdx/mise · error

brew-cask:{}: unsupported {kind} run command base {}

Error message

brew-cask:{}: unsupported {kind} run command base {}

What it means

A `run` flight step's `command.base` selects what relative paths resolve against. Only "staged_path", "appdir", "homebrew_prefix", or absent (literal) are accepted; any other string base is rejected with this error naming the bad base.

Source

Thrown at src/system/packages/brew/cask/artifacts.rs:911

) -> Result<FlightPath> {
    let object = value.and_then(Value::as_object).ok_or_else(|| {
        eyre!(
            "brew-cask:{}: unsupported {kind} run command metadata format",
            cask.token
        )
    })?;
    reject_unsupported_flight_fields(cask, kind, "run command", object, &["base", "path"])?;
    let path = object.get("path").and_then(Value::as_str).ok_or_else(|| {
        eyre!(
            "brew-cask:{}: unsupported {kind} run command path",
            cask.token
        )
    })?;
    let base = match object.get("base").and_then(Value::as_str) {
        Some("staged_path") => FlightPathBase::StagedPath,
        Some("appdir") => FlightPathBase::AppDir,
        Some("homebrew_prefix") => FlightPathBase::HomebrewPrefix,
        Some(base) => bail!(
            "brew-cask:{}: unsupported {kind} run command base {}",
            cask.token,
            base
        ),
        None => FlightPathBase::Literal,
    };
    let path_value = Path::new(path);
    let invalid_absolute_path = base == FlightPathBase::Literal
        && !path_value.is_absolute()
        && path_value.components().count() > 1;
    let invalid_based_path = matches!(
        base,
        FlightPathBase::StagedPath | FlightPathBase::AppDir | FlightPathBase::HomebrewPrefix
    ) && (path_value.is_absolute()
        || path_value
            .components()
            .any(|component| matches!(component, Component::ParentDir)));
    if invalid_absolute_path || invalid_based_path {

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Use one of the accepted bases: "staged_path", "appdir", or "homebrew_prefix".
  2. Remove `base` entirely if the path is already absolute/literal.
  3. Fix casing — values are lowercase snake_case.

Example fix

// before
[[install.flight_steps]]
type = "run"
command = { base = "pkgdir", path = "tools/setup.sh" }
// after
[[install.flight_steps]]
type = "run"
command = { base = "staged_path", path = "tools/setup.sh" }
Defensive patterns

Strategy: validation

Validate before calling

const VALID_BASES = new Set(['staged_path', 'appdir', 'homebrew_prefix']);
function validateRunBase(cmd) {
  if ('base' in cmd && !VALID_BASES.has(cmd.base)) {
    throw new Error(`unsupported run command base: ${cmd.base}`);
  }
}

Type guard

const isValidBase = (b) => b === undefined || VALID_BASES.has(b);

Prevention

When it happens

Trigger: A cask sets `command = { base = "app", path = "..." }` or `base = "pkgdir"` in a Run step; parse_run_command's `Some(base)` bail arm fires for an unrecognized base string.

Common situations: Copy-pasting Homebrew cask `base`/`staged` DSL values that mise names differently; typos like "stagedpath" or "AppDir" (case-sensitive); inventing bases expecting them to resolve like Homebrew's artifact dirs.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/01a8fabbb10f9873. Report an issue: GitHub.