jdx/mise · error · eyre::Report

strip-components > 1 is not supported

Error message

strip-components > 1 is not supported

What it means

strip_archive_path_components implements strip-components post-extraction (for formats that cannot strip while unpacking), and its rename-and-move algorithm only handles removing exactly one leading directory. strip_components of 2 or more has no implementation, so it fails fast instead of producing a wrong layout.

Source

Thrown at src/file.rs:2029

}

fn reset_dir_mtime_to_now(dir: &Path) -> Result<()> {
    let now = FileTime::now();
    for entry in WalkDir::new(dir) {
        let entry = entry?;
        if entry.file_type().is_file() {
            set_file_times(entry.path(), now, now)?;
        }
    }
    Ok(())
}

fn strip_archive_path_components(dir: &Path, strip_depth: usize) -> Result<()> {
    if strip_depth == 0 {
        return Ok(());
    }
    if strip_depth > 1 {
        bail!("strip-components > 1 is not supported");
    }

    let top_level_paths = ls(dir)?;

    for path in top_level_paths {
        if !path.symlink_metadata()?.is_dir() {
            continue;
        }

        // rename the directory to a temp name to avoid conflicts when moving files
        let temp_path = path.with_file_name(format!(
            "{}_tmp_strip",
            path.file_name().unwrap().to_string_lossy()
        ));
        do_rename(&path, &temp_path)?;

        for entry in ls(&temp_path)? {
            if let Some(file_name) = entry.file_name() {

View on GitHub (pinned to 9dcfcaa0dc)

Solutions

  1. Set strip_components to 0 or 1
  2. Choose or produce an archive with a single top-level directory so depth 1 is sufficient
  3. If deeper stripping is genuinely required, extract manually with the tar CLI (tar -xf a.tar.gz --strip-components=N -C dest) in a custom task

Example fix

# before (mise.toml / aqua entry)
strip_components = 2

# after
strip_components = 1
Defensive patterns

Strategy: validation

Validate before calling

let opts = ExtractOptions { strip_components: opts.strip_components.min(1), ..opts };

Prevention

When it happens

Trigger: Extracting with ExtractOptions { strip_components: 2 (or more), .. } on a code path that calls strip_archive_path_components after extraction.

Common situations: Tool config (strip_components = 2 in mise.toml, or strip_components: 2 in an aqua-registry entry) written for a tarball nested two directories deep; config copied from another project whose archive layout differs.

Related errors


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