jdx/mise · error

brew-cask:{}: unsupported archive type for {}

Error message

brew-cask:{}: unsupported archive type for {}

What it means

extract_archive (src/system/packages/brew/cask.rs:1077) classifies the downloaded artifact before touching it: DMG images are mounted, 'raw' single binaries are copied executable, and recognized archive formats are extracted. Any artifact whose ExtractionFormat is neither Raw nor an archive is rejected with its filename, so nothing unexamined reaches the staging tree.

Source

Thrown at src/system/packages/brew/cask.rs:1077

    file::remove_all(&extract_dir)?;
    file::create_dir_all(&extract_dir)?;
    let filename = archive
        .file_name()
        .and_then(|f| f.to_str())
        .unwrap_or_default();
    if is_dmg_archive(archive, filename)? {
        file::un_dmg(archive, &extract_dir)?;
    } else {
        let format = cask_extraction_format(archive, filename)?;
        if format == ExtractionFormat::Raw {
            // Raw executable binary — copy it using the original URL filename so
            // find_file_artifact can match against the binary stanza source name (e.g. "claude").
            let url_filename = archive_filename(&cask.url).unwrap_or_else(|| filename.to_string());
            let dest = extract_dir.join(&url_filename);
            file::copy(archive, &dest)?;
            file::make_executable(&dest)?;
        } else if !format.is_archive() {
            bail!(
                "brew-cask:{}: unsupported archive type for {}",
                cask.token,
                filename
            );
        } else {
            file::extract_archive(
                archive,
                &extract_dir,
                format,
                &ExtractOptions {
                    pr,
                    ..Default::default()
                },
            )?;
        }
    }
    Ok(extract_dir)
}

View on GitHub (pinned to 6f52dcdf99)

Solutions

  1. Download the cask URL manually and run `file` on it to confirm the format named in the error
  2. Prefer a cask variant of the app that ships .dmg, .zip, .tar.*, or a raw binary
  3. File an issue against mise with the cask token and artifact format so extraction support can be added
  4. As a stopgap, install that app manually outside mise
Defensive patterns

Strategy: validation

Validate before calling

const SUPPORTED: [&str; 5] = [".zip", ".tar.gz", ".tar.xz", ".dmg", ".bin"];
let ok = SUPPORTED.iter().any(|e| cask.url.contains(e));
if !ok { return Err(anyhow!("unsupported artifact type in {}", cask.url)); }

Prevention

When it happens

Trigger: A cask whose download ships in a container format mise's extractor classifies as neither raw nor archive — e.g. .rar/.7z/.lzh-style or other exotic compression — so cask_extraction_format returns a non-archive, non-raw variant.

Common situations: Niche apps distributed in unusual containers; taps vendoring legacy installers; vendors switching artifact formats faster than mise's extractor learns them.

Related errors


AI-assisted analysis of jdx/mise@6f52dcdf99 (2026-08-22). Data as JSON: /api/errors/fede5dfc12a98b44. Report an issue: GitHub.