jdx/mise · error · eyre::Report

native cargo binary path is empty

Error message

native cargo binary path is empty

What it means

validate_native_bin_relative_path() checks the relative path a binstall template resolved to for a binary inside the extracted artifact. A path with zero components means the templated name/bin_dir rendered to an empty string, which would install nothing — mise rejects it during path validation before copying.

Source

Thrown at src/backend/cargo/native_binstall.rs:1021

        format!("{}-{}-{}", vars.name, vars.version, vars.target),
        format!("{}-v{}-{}", vars.name, vars.version, vars.target),
        format!("{}-{}", vars.name, vars.target),
        format!("{}-{}", vars.name, vars.version),
        format!("{}-v{}", vars.name, vars.version),
        vars.name.to_string(),
    ];
    for candidate in candidates {
        if extract_dir.join(&candidate).is_dir() {
            return format!("{candidate}/{{ bin }}{{ binary-ext }}");
        }
    }
    "{ bin }{ binary-ext }".to_string()
}

fn validate_native_bin_relative_path(path: &str) -> Result<PathBuf> {
    let path = PathBuf::from(path);
    if path.components().next().is_none() {
        bail!("native cargo binary path is empty");
    }
    if path.components().any(|component| {
        matches!(
            component,
            Component::ParentDir | Component::Prefix(_) | Component::RootDir
        )
    }) {
        bail!(
            "native cargo binary path must stay inside the artifact: {}",
            path.display()
        );
    }
    Ok(path)
}

fn validate_native_bin_sources(pending: &[(PathBuf, PathBuf)]) -> Result<()> {
    let mut sources = BTreeSet::new();
    for (src, _) in pending {

View on GitHub (pinned to 6f52dcdf99)

Solutions

  1. Remove or fix any custom bin-dir/name template override in your mise config for this tool
  2. Install from source by disabling binstall for this crate
  3. Report the empty-template metadata bug to the crate maintainer
Defensive patterns

Strategy: validation

Validate before calling

# if you override bin-dir templates, assert they render non-empty for your target
[[ -n "$BIN_DIR_TEMPLATE" ]] || echo 'bin-dir template renders empty'

Prevention

When it happens

Trigger: A crate's binstall `bin-dir` template or bin name expands to an empty string on your platform (e.g. a template like `{ bin-dir }` where a variable is undefined, or an empty bin name in metadata), so the resolved relative path has no components.

Common situations: Broken or platform-conditional binstall metadata where a template variable is empty for a target; crates with metadata written for a different binstall version using variables mise does not populate; hand-crafted binstall overrides in mise config.

Related errors


AI-assisted analysis of jdx/mise@6f52dcdf99 (2026-08-22). Data as JSON: /api/errors/5ac96d3bd479e99d. Report an issue: GitHub.