jdx/mise · error

No executable files found in archive

Error message

No executable files found in archive

What it means

This error is thrown by `extract_and_find_binary` after downloading and extracting an archive: the extractor found no files it recognizes as executables in the extracted directory. It guards against proceeding with an archive that contains only docs, data files, or platform binaries for other OSes.

Solutions

  1. Point the stub URL at a prebuilt release archive containing executables rather than a source tarball
  2. Use --bin to explicitly name the binary path inside the archive (also check the archive contents manually: tar -tf or unzip -l)
  3. Verify the archive matches your platform (a linux-only archive viewed from mac may show no usable executables)

Example fix

// before
url = "https://github.com/org/tool/archive/refs/tags/v1.0.tar.gz"
// after
url = "https://github.com/org/tool/releases/download/v1.0/tool-linux-amd64.tar.gz"
Defensive patterns

Strategy: validation

Validate before calling

# Inspect the archive before wiring it into a stub
if [[ "$URL" == *.tar.gz ]]; then
  curl -fsSL "$URL" | tar -tz | head
elif [[ "$URL" == *.zip ]]; then
  curl -fsSL "$URL" -o a.zip && unzip -l a.zip
fi

Try / catch

# On failure, fall back to explicit --bin once the archive layout is known
mise generate tool-stub mytool --url "$URL" || \
  mise generate tool-stub mytool --url "$URL" --bin bin/mytool

Prevention

When it happens

Trigger: Downloading a URL that points to an archive whose contents contain no executable-bit files (e.g. a source tarball, a docs zip, or a `.deb`/`.pkg` installer archive the extractor can't scan for exec bits).

Common situations: Pointing the stub at a source-code tarball instead of a prebuilt release; macOS users grabbing a .pkg installer instead of the darwin tarball; archives whose executables are nested without executable permissions preserved.

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


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

Appendix: source

Thrown at src/cli/generate/tool_stub.rs:649

        file::extract_archive(
            archive_path,
            &extracted_dir,
            format,
            &file::ExtractOptions {
                pr: Some(pr),
                ..Default::default()
            },
        )?;

        // Check if strip_components would be applied during actual installation
        let format =
            ExtractionFormat::from_file_name(&archive_path.file_name().unwrap().to_string_lossy());
        let will_strip = file::should_strip_components(archive_path, format)?;

        // Find executable files
        let executables = self.find_executables(&extracted_dir)?;
        if executables.is_empty() {
            bail!("No executable files found in archive");
        }

        // Look for exact filename match only
        let tool_name = self.get_tool_name();
        let selected_exe = self.find_exact_binary_match(&executables, &tool_name)?;

        // If strip_components will be applied, remove the first path component
        if will_strip {
            let path = std::path::Path::new(&selected_exe);
            if let Ok(stripped) = path.strip_prefix(path.components().next().unwrap()) {
                let stripped_str = stripped.to_string_lossy().to_string();
                // Don't return empty string if stripping removed everything
                if !stripped_str.is_empty() {
                    return Ok(stripped_str);
                }
            }
        }

View on GitHub (pinned to 533346cc37)