{"record":{"id":"052ed943b8852ea4","repo":"jdx/mise","slug":"cargo-binstall-is-not-available-but-cargo-binstal","errorCode":null,"errorMessage":"cargo-binstall is not available, but cargo.binstall_only is set","messagePattern":"cargo-binstall is not available, but cargo\\.binstall_only is set","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/backend/cargo.rs","lineNumber":282,"sourceCode":"                    if result.as_ref().is_ok() {\n                        self.write_install_state_best_effort(&tv);\n                        return Ok(tv.clone());\n                    }\n                    if Settings::get().cargo.binstall_only\n                        || !result.as_ref().is_err_and(|err| {\n                            Error::get_exit_status(err)\n                                == Some(CARGO_BINSTALL_NO_FALLBACK_EXIT_CODE)\n                        })\n                    {\n                        result?;\n                    }\n                    info!(\"cargo-binstall found no prebuilt binary; falling back to cargo install\");\n                }\n                BinstallStatus::Disabled if Settings::get().cargo.binstall_only => {\n                    bail!(\"cargo-binstall is disabled, but cargo.binstall_only is set\");\n                }\n                _ if Settings::get().cargo.binstall_only => {\n                    bail!(\"cargo-binstall is not available, but cargo.binstall_only is set\");\n                }\n                BinstallStatus::Unavailable => match Settings::get().cargo.binstall_native {\n                    Some(true)\n                        if self\n                            .native_binstall(ctx, &tv, NativeBinstallAction::Install)\n                            .await? =>\n                    {\n                        self.write_install_state_best_effort(&tv);\n                        return Ok(tv.clone());\n                    }\n                    Some(_) => {}\n                    None if native_binstall::rollout_warning_active() => {\n                        self.native_binstall(ctx, &tv, NativeBinstallAction::WarnOnly)\n                            .await?;\n                    }\n                    None => {}\n                },\n                _ => {}","sourceCodeStart":264,"sourceCodeEnd":300,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/backend/cargo.rs#L264-L300","documentation":"BinstallStatus can be Unavailable (binary not present / cannot run). When the user set `cargo.binstall_only = true`, source builds via `cargo install` are forbidden, so if binstall is not available at all the install cannot proceed and mise bails with this error.","triggerScenarios":"`mise install cargo:<crate>` with `cargo.binstall_only = true` while cargo-binstall is not installed on PATH, is an incompatible version, or fails its availability probe (the `_ if Settings::get().cargo.binstall_only` catch-all arm in install_version_).","commonSituations":"CI image or fresh machine without cargo-binstall; binstall probe failing due to old cargo version; user enabling binstall_only globally but hitting crates with no prebuilt artifacts.","solutions":["Install cargo-binstall (`cargo install cargo-binstall` or via the binstall install script).","Remove `cargo.binstall_only = true` to allow fallback to `cargo install`.","Check `cargo binstall --version` works in the environment mise uses (PATH, cargo toolchain)."],"exampleFix":"// before\nmise use cargo:ripgrep  # with cargo.binstall_only = true, no cargo-binstall installed\n\n// after\ncargo install cargo-binstall\nmise use cargo:ripgrep","handlingStrategy":"validation","validationCode":"command -v cargo-binstall >/dev/null || echo 'cargo-binstall missing; do not set cargo.binstall_only'\ncargo binstall --version || echo 'binstall probe will fail'","typeGuard":null,"tryCatchPattern":"if ! mise install \"$pkg\"; then\n  cargo install cargo-binstall || true\n  mise install \"$pkg\"   # or drop binstall_only to allow source build\nfi","preventionTips":["Install cargo-binstall before enabling cargo.binstall_only.","Keep cargo and cargo-binstall versions compatible.","Probe `cargo binstall --version` in CI before enabling binstall_only.","Scope binstall_only to tools known to have prebuilt artifacts."],"tags":["cargo","binstall","missing-dependency","settings"],"backgroundTag":"missing-dependency","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}