jdx/mise · error
extract_archive does not support compressed single-file…
Error message
extract_archive does not support compressed single-file format: {format} What it means
extract_archive handles archives (tar.*, zip, 7z) only. If given a compressed single-file format (Gz, Xz, Bz2, Zst, Br, Lz4, Sz), it bails with "extract_archive does not support compressed single-file format" because those payloads contain a single file, not a directory tree to extract.
Solutions
- Detect single-file compression first and call decompress_file (gz/xz/zst/bz2 only) instead
- Check fmt.is_compressed_file() and branch to the decompress + install-single-binary path
- Prefer assets published as tarballs or zips when configuring a tool backend
- For Br/Lz4/Sz, decompress externally — neither function supports them
Example fix
// before
extract_archive(&archive, &dest, fmt, &opts)?; // fmt == Gz
// after
if fmt.is_compressed_file() {
decompress_file(&archive, &dest.join(binary_name), fmt)?;
} else {
extract_archive(&archive, &dest, fmt, &opts)?;
} Defensive patterns
Strategy: validation
Validate before calling
if fmt.is_compressed_file() {
return Err(anyhow!("use decompress_file for {fmt}"));
}
extract_archive(&archive, &dest, fmt, &opts)?; Type guard
fn is_archive_format(f: ExtractionFormat) -> bool { f.is_archive() } Try / catch
match extract_archive(&archive, &dest, fmt, &opts) {
Err(e) if e.to_string().contains("compressed single-file format") => {
decompress_file(&archive, &dest.join("binary"), fmt)?;
}
other => other?,
} Prevention
- Branch on is_compressed_file() before choosing extract vs decompress
- Prefer tarball/zip assets for tools that also publish bare .gz binaries
- Remember Br/Lz4/Sz single files are unsupported in both paths
- Centralize dispatch in one helper instead of calling extract_archive directly
When it happens
Trigger: Calling extract_archive with ExtractionFormat::from_file_name results like .gz/.xz/.bz2/.zst/.br/.lz4/.sz — e.g. a release asset is a single compressed binary, not a tarball.
Common situations: GitHub release assets that ship a lone gzipped binary (e.g. binary.gz); backend assumes every download is an archive and calls extract_archive unconditionally.
Understand the failure class
Background: "is not a compatible type" / "cannot merge" errors: when a value's type doesn't match what the library requires — this error's family across 65 libraries.
Related errors
- brew-cask: : unsupported archive type for
- brew-cask: : unsupported archive type for
- unsupported compressed file format
- additional asset ' ' is not an archive
- command failed: #
AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17).
Data as JSON: /api/errors/016affd58bcff38e.
Report an issue: GitHub.
Appendix: source
Thrown at src/file.rs:2126
ExtractionFormat::TarGz
| ExtractionFormat::TarXz
| 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!(View on GitHub (pinned to 533346cc37)