{"record":{"id":"5ac96d3bd479e99d","repo":"jdx/mise","slug":"native-cargo-binary-path-is-empty","errorCode":null,"errorMessage":"native cargo binary path is empty","messagePattern":"native cargo binary path is empty","errorType":"validation","errorClass":"eyre::Report","httpStatus":null,"severity":"error","filePath":"src/backend/cargo/native_binstall.rs","lineNumber":1021,"sourceCode":"        format!(\"{}-{}-{}\", vars.name, vars.version, vars.target),\n        format!(\"{}-v{}-{}\", vars.name, vars.version, vars.target),\n        format!(\"{}-{}\", vars.name, vars.target),\n        format!(\"{}-{}\", vars.name, vars.version),\n        format!(\"{}-v{}\", vars.name, vars.version),\n        vars.name.to_string(),\n    ];\n    for candidate in candidates {\n        if extract_dir.join(&candidate).is_dir() {\n            return format!(\"{candidate}/{{ bin }}{{ binary-ext }}\");\n        }\n    }\n    \"{ bin }{ binary-ext }\".to_string()\n}\n\nfn validate_native_bin_relative_path(path: &str) -> Result<PathBuf> {\n    let path = PathBuf::from(path);\n    if path.components().next().is_none() {\n        bail!(\"native cargo binary path is empty\");\n    }\n    if path.components().any(|component| {\n        matches!(\n            component,\n            Component::ParentDir | Component::Prefix(_) | Component::RootDir\n        )\n    }) {\n        bail!(\n            \"native cargo binary path must stay inside the artifact: {}\",\n            path.display()\n        );\n    }\n    Ok(path)\n}\n\nfn validate_native_bin_sources(pending: &[(PathBuf, PathBuf)]) -> Result<()> {\n    let mut sources = BTreeSet::new();\n    for (src, _) in pending {","sourceCodeStart":1003,"sourceCodeEnd":1039,"githubUrl":"https://github.com/jdx/mise/blob/6f52dcdf99e282ef7a7db68c81301fa4618d0f79/src/backend/cargo/native_binstall.rs#L1003-L1039","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Remove or fix any custom bin-dir/name template override in your mise config for this tool","Install from source by disabling binstall for this crate","Report the empty-template metadata bug to the crate maintainer"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# if you override bin-dir templates, assert they render non-empty for your target\n[[ -n \"$BIN_DIR_TEMPLATE\" ]] || echo 'bin-dir template renders empty'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Avoid custom bin-dir template overrides unless you control the crate's metadata","Test binstall installs per-platform in CI before rolling out"],"tags":["cargo-binstall","path-validation","empty-path"],"backgroundTag":"empty-path","analyzedSha":"6f52dcdf99e282ef7a7db68c81301fa4618d0f79","analyzedAt":"2026-08-22T10:14:23.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}