jdx/mise · error
native cargo binary artifact maps multiple bins to
Error message
native cargo binary artifact maps multiple bins to {} What it means
validate_native_bin_sources checks that the staged (source, destination) pairs for a native binstall install map each distinct source file to at most one destination. If two declared bins resolve to the same artifact file, installing both would clobber the same destination, so mise fails rather than silently overwriting.
Solutions
- Remove duplicate/overlapping bin entries from the tool options so each bin maps to a distinct file.
- Fix the crate's binstall metadata so each declared bin points to a unique artifact path.
- Install only the single binary you actually need instead of the full bin list.
Example fix
# before (mise.toml)
cargo:mytool = { version = "1.0", bin = ["cli", "cli"] }
# after
cargo:mytool = { version = "1.0", bin = ["cli", "cli-helper"] } Defensive patterns
Strategy: validation
Validate before calling
# dedupe bin list before install echo "$bins" | tr ' ' '\n' | sort -u
Type guard
fn unique_bins(bins: &[String]) -> Vec<String> {
let mut seen = std::collections::BTreeSet::new();
bins.iter().filter(|b| seen.insert(b.to_lowercase())).cloned().collect()
} Prevention
- Deduplicate bin lists in tool options
- Remember case-insensitive filesystems can collide bin names
- Ensure bin_dir templates include {{ bin }} so each bin maps to a distinct file
When it happens
Trigger: install() with a crate declaring multiple [[bin]] names (or repeated bin tool options) whose resolved find_native_bin paths collapse to the same file — e.g. two bin entries with identical names or templates that ignore the bin name.
Common situations: Duplicate `bin = "x"` entries in tool options; crate metadata listing the same bin twice or with case variants that normalize to one file on a case-insensitive filesystem; templated bin_dir where {{ bin }} was omitted.
Understand the failure class
Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.
Related errors
- native cargo binary path is empty
- brew-cask: duplicate app target
- cargo-binstall cannot honor cargo install-only tool…
- cargo-binstall is disabled, but cargo.binstall_only is set
- cargo-binstall is not available, but cargo.binstall_only is…
AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17).
Data as JSON: /api/errors/1f36185b6408adaa.
Report an issue: GitHub.
Appendix: source
Thrown at src/backend/cargo/native_binstall.rs:1014
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 {
if !sources.insert(src) {
bail!(
"native cargo binary artifact maps multiple bins to {}",
file::display_path(src)
);
}
}
Ok(())
}
#[cfg(test)]
mod tests {
use super::*;
use crate::platform::Platform;
#[test]
fn native_binstall_metadata_merges_target_overrides() {
let manifest = toml::Value::Table(toml::toml! {
[package.metadata.binstall]
pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }.{ archive-format }"View on GitHub (pinned to 533346cc37)