jdx/mise · warning

{err}

Error message

{err}

What it means

In src/system/packages/brew/cask/artifacts.rs, platform_unavailable_state calls validate_platform_support(cask, artifacts) and, if it returns Err, wraps the error string into PackageState::unavailable(err.to_string()) (message rendered as `{err}`). This is not a crash: the cask is marked unavailable because its platform is not supported by the cask's declared artifacts.

Solutions

  1. Accept the unavailable state if the cask genuinely doesn't support your platform; choose an alternative package.
  2. Verify the cask's platform/artifact stanzas cover your OS/arch, or update the cask.
  3. Run on a supported platform (correct macOS version/architecture) if the package is required.
Defensive patterns

Strategy: type-guard

Validate before calling

// check the cask supports the current platform before requesting it
let state = package_state(&cask, &artifacts);
if state.is_unavailable() {
    eprintln!("cask {} unavailable: {}", cask.token, state.reason());
}

Type guard

fn cask_supports(cask: &Cask, os: Os, arch: Arch) -> bool {
    cask.artifacts.iter().any(|a| a.supports(os, arch))
}

Prevention

When it happens

Trigger: Resolving package state for a Homebrew cask whose artifacts (e.g. `app`, `binary` stanzas gated on `on_macos`/`on_arm`/`on_intel`) do not cover the current platform, so validate_platform_support fails.

Common situations: Installing a macOS cask on Linux, an Intel-only cask on Apple Silicon, or a cask whose platform stanza excludes the running macOS version/architecture.

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/0cc9ea545fa00e04. Report an issue: GitHub.

Appendix: source

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

            && !has_lifecycle_hook(cask, "postflight");
        if !font_only {
            bail!(
                "brew-cask:{}: only font-only casks without lifecycle hooks are supported on linux",
                cask.token
            );
        }
    }
    #[cfg(not(target_os = "linux"))]
    let _ = (cask, artifacts);
    Ok(())
}

pub(super) fn platform_unavailable_state(
    cask: &Cask,
    artifacts: &CaskArtifacts,
) -> Option<PackageState> {
    validate_platform_support(cask, artifacts)
        .err()
        .map(|err| PackageState::unavailable(err.to_string()))
}

pub(super) fn declared_target(value: &Value) -> Option<String> {
    value
        .as_object()
        .and_then(|o| o.get("target"))
        .and_then(Value::as_str)
        .map(str::to_string)
}

pub(super) fn artifact_target(value: &Value, values: &[Value]) -> Option<String> {
    values
        .get(1)
        .and_then(|v| v.as_object())
        .and_then(|o| o.get("target"))
        .and_then(Value::as_str)
        .map(str::to_string)

View on GitHub (pinned to 533346cc37)