{"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/533346cc374382b41ec5ff70536252b2e96e725c/src/backend/cargo.rs#L264-L300","documentation":"Same contract as the 'disabled' case but for BinstallStatus::Unavailable: cargo-binstall is not available at all in this environment (binary not found / feature unavailable), yet cargo.binstall_only forbids the source-build fallback. mise bails because there is no binstall to use and no permitted alternative.","triggerScenarios":"`mise install cargo:<crate>@<version>` with cargo.binstall_only = true while cargo-binstall cannot be located or is otherwise unavailable (catch-all arm `_ if binstall_only =>`).","commonSituations":"Fresh container/CI image where cargo-binstall was never installed but settings from the developer's machine enable binstall_only; binstall binary not on PATH inside a slim Docker image; mise running where the embedded binstall support is unavailable.","solutions":["Install cargo-binstall (`cargo install cargo-binstall` or the official installer) so binstall_only can be satisfied.","Remove cargo.binstall_only = true from settings to permit `cargo install` source builds.","Switch the tool entry to a backend that ships prebuilt binaries (e.g. aqua: or github:)."],"exampleFix":"# before (settings.toml)\n[cargo]\nbinstall_only = true\n\n# after — allow source fallback\n[cargo]\nbinstall_only = false","handlingStrategy":"fallback","validationCode":"# check availability before enforcing binstall_only\ncommand -v cargo-binstall >/dev/null || echo 'cargo-binstall missing; binstall_only will fail'","typeGuard":null,"tryCatchPattern":"# shell\nif ! mise install cargo:mycrate@1.2 2>err.log; then\n  grep -q 'binstall_only' err.log && mise settings set cargo.binstall_only false && mise install cargo:mycrate@1.2\nfi","preventionTips":["Install cargo-binstall in all environments (CI images, containers) where binstall_only is set","Or simply don't set binstall_only and let mise fall back to cargo install","Prefer aqua:/github: backends for tools with prebuilt releases"],"tags":["cargo","binstall","missing-binary","settings"],"backgroundTag":"missing-dependency","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}