jdx/mise · error

cargo-binstall is disabled, but cargo.binstall_only is set

Error message

cargo-binstall is disabled, but cargo.binstall_only is set

What it means

mise's cargo backend resolves whether cargo-binstall is usable (BinstallStatus::Disabled means binstall exists but is disabled via settings). When the user has set cargo.binstall_only = true (forbidding source builds via `cargo install`) but binstall is disabled, no installation path remains that satisfies the setting, so mise fails immediately instead of falling back.

Solutions

  1. Re-enable cargo-binstall (remove the setting disabling it) so binstall_only can be honored.
  2. Set cargo.binstall_only = false (or remove it) to allow falling back to `cargo install` from source.
  3. Prefer a non-cargo backend (aqua:/github:) for the tool if a prebuilt release exists.

Example fix

# before (settings.toml)
[cargo]
binstall = false
binstall_only = true

# after
[cargo]
binstall = true
binstall_only = true
Defensive patterns

Strategy: validation

Validate before calling

# shell
grep -n 'binstall' ~/.config/mise/settings.toml  # binstall and binstall_only must not conflict

Try / catch

// rust
if settings.cargo.binstall_only && !settings.cargo.binstall_enabled() {
    eprintln!("binstall_only requires cargo-binstall to be enabled");
}

Prevention

When it happens

Trigger: Running `mise use/install` on a cargo: tool while Settings::get().cargo.binstall_only is true and BinstallStatus::Disabled (e.g. settings disable cargo-binstall, or internal binstall is turned off via config).

Common situations: User enables cargo.binstall_only to avoid slow/rusty source builds but has also disabled cargo-binstall (cargo.binstall = false or equivalent), then installs any crate-only tool; CI config copied from a binstall-enabled machine onto one with binstall disabled.

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


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/405dcebbe594a537. Report an issue: GitHub.

Appendix: source

Thrown at src/backend/cargo.rs:279

                    let result = self
                        .execute_install_command(ctx, &tv, cmd.arg(&install_arg))
                        .await;
                    if result.as_ref().is_ok() {
                        self.write_install_state_best_effort(&tv);
                        return Ok(tv.clone());
                    }
                    if Settings::get().cargo.binstall_only
                        || !result.as_ref().is_err_and(|err| {
                            Error::get_exit_status(err)
                                == Some(CARGO_BINSTALL_NO_FALLBACK_EXIT_CODE)
                        })
                    {
                        result?;
                    }
                    info!("cargo-binstall found no prebuilt binary; falling back to cargo install");
                }
                BinstallStatus::Disabled if Settings::get().cargo.binstall_only => {
                    bail!("cargo-binstall is disabled, but cargo.binstall_only is set");
                }
                _ if Settings::get().cargo.binstall_only => {
                    bail!("cargo-binstall is not available, but cargo.binstall_only is set");
                }
                BinstallStatus::Unavailable => match Settings::get().cargo.binstall_native {
                    Some(true)
                        if self
                            .native_binstall(ctx, &tv, NativeBinstallAction::Install)
                            .await? =>
                    {
                        self.write_install_state_best_effort(&tv);
                        return Ok(tv.clone());
                    }
                    Some(_) => {}
                    None if native_binstall::rollout_warning_active() => {
                        self.native_binstall(ctx, &tv, NativeBinstallAction::WarnOnly)
                            .await?;
                    }

View on GitHub (pinned to 533346cc37)