jdx/mise · error

rar format not supported

Error message

rar format not supported

What it means

extract_archive explicitly rejects RAR archives with "rar format not supported". Despite Rar being a parseable ExtractionFormat enum variant, no rar extraction backend (e.g. unrar/7z library) is integrated.

Solutions

  1. Use a .zip, .7z, or tar.* asset for the tool instead
  2. Convert the rar to a supported format when mirroring/proxying the asset
  3. Extract the rar with an external tool (unrar x / 7z x) in a pre-step, then install from the extracted dir
  4. File/upstream an issue requesting rar support if no alternative asset exists

Example fix

// before
asset = "tool-v1.2.rar" // extract_archive -> error
// after
asset = "tool-v1.2.zip" // or run `unrar x asset dest` before install
Defensive patterns

Strategy: fallback

Validate before calling

if fmt == ExtractionFormat::Rar {
    // pick a zip/tar asset or run external `unrar x`
}

Try / catch

match extract_archive(&archive, &dest, fmt, &opts) {
    Err(e) if e.to_string().contains("rar format not supported") => {
        // fallback: `unrar x archive dest` via std::process::Command
    }
    other => other?,
}

Prevention

When it happens

Trigger: Calling extract_archive (or untar/open_tar) with ExtractionFormat::Rar, typically from a .rar release asset classified by from_file_name/from_ext.

Common situations: A tool vendor publishes Windows builds only as .rar; registry/backend config points at the rar asset.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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

Appendix: source

Thrown at src/file.rs:2128

        | ExtractionFormat::TarBz2
        | ExtractionFormat::TarZst
        | ExtractionFormat::Tar
        | ExtractionFormat::TarBr
        | ExtractionFormat::TarLz4
        | ExtractionFormat::TarSz
        | ExtractionFormat::Raw => untar(archive, dest, format, opts),
        ExtractionFormat::Zip => unzip(archive, dest, opts),
        ExtractionFormat::SevenZip => un7z(archive, dest, opts),
        ExtractionFormat::Gz
        | ExtractionFormat::Xz
        | ExtractionFormat::Bz2
        | ExtractionFormat::Zst
        | ExtractionFormat::Br
        | ExtractionFormat::Lz4
        | ExtractionFormat::Sz => {
            bail!("extract_archive does not support compressed single-file format: {format}")
        }
        ExtractionFormat::Rar => bail!("rar format not supported"),
    }
}

pub(crate) fn untar(
    archive: &Path,
    dest: &Path,
    format: ExtractionFormat,
    opts: &ExtractOptions,
) -> Result<()> {
    if !format.is_tar_archive() && format != ExtractionFormat::Raw {
        bail!("untar only supports tar formats, got {}", format);
    }

    debug!("tar -xf {} -C {}", archive.display(), dest.display());
    if let Some(pr) = &opts.pr {
        pr.set_message(format!(
            "extract {}",
            archive.file_name().unwrap().to_string_lossy()

View on GitHub (pinned to 533346cc37)