jdx/mise · error

No executable files found in archive

Error message

No executable files found in archive

What it means

During stub generation mise downloads and extracts the archive, then scans it for executable files to pick the binary path. If find_executables returns nothing (no file with an executable bit), generation stops because the stub needs a `bin` path to run. Note this is checked before auto-selection, so it fires even before find_exact_binary_match runs.

Source

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

        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 9dcfcaa0dc)

Solutions

  1. Point --url at a release archive that actually contains a runnable binary with its executable bit set
  2. Pre-download the archive, mark the binary executable (chmod +x), repack, and regenerate
  3. Skip analysis with --skip-download and supply the binary path explicitly via --bin (and/or --platform-bin)

Example fix

# before
mise generate tool-stub ./ctl --url https://example.com/ctl-1.0.0-src.tar.gz
# after
mise generate tool-stub ./ctl --url https://example.com/ctl-1.0.0-linux-x64.tar.gz --skip-download --bin bin/ctl
Defensive patterns

Strategy: fallback

Validate before calling

#!/usr/bin/env bash
# verify the archive actually contains an executable before generating
curl -fsSL "$url" -o /tmp/a.tar.gz
tar -tzf /tmp/a.tar.gz | grep -qE '(^|/)[^/]+$' || { echo 'archive has no candidate files' >&2; exit 2; }
mise generate tool-stub ./out --url "$url"

Try / catch

if ! mise generate tool-stub ./out --url "$url" 2>err.log; then grep -q 'No executable files found' err.log && mise generate tool-stub ./out --url "$url" --skip-download --bin "${BIN_PATH:?set BIN_PATH}"; fi

Prevention

When it happens

Trigger: Archives containing only non-executable files (README, LICENSE, .so libraries); archives where the executable bit was lost (e.g. re-packed on Windows, or zips where permissions are not stored); archives that contain only a directory of sources.

Common situations: Windows-built zip artifacts where no exec bit survives; users testing the generator against source tarballs instead of release binaries.

Related errors


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