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

The cargo backend's binstall preflight records BinstallStatus::Disabled (the user disabled cargo-binstall via settings). If the user also set `cargo.binstall_only = true` — meaning only prebuilt binstall artifacts may be used, never `cargo install` from source — these settings contradict and mise bails rather than silently compiling from source.

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 afd2eddd3a)

Solutions

  1. Re-enable cargo-binstall (remove the `cargo.binstall = false` / binstall disable setting) so binstall_only can be honored.
  2. Remove `cargo.binstall_only = true` from settings so mise may fall back to `cargo install`.
  3. Verify with `mise settings get cargo.binstall_only` and `mise settings get cargo.binstall` before installing.

Example fix

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

// after (settings.toml)
[cargo]
binstall = true
binstall_only = true
Defensive patterns

Strategy: validation

Validate before calling

import subprocess, sys
def preflight():
    s = subprocess.run(['mise','settings','get','cargo.binstall_only'],capture_output=True,text=True)
    b = subprocess.run(['mise','settings','get','cargo.binstall'],capture_output=True,text=True)
    if s.stdout.strip()=='true' and b.stdout.strip()=='false':
        sys.exit('conflict: cargo.binstall_only=true with binstall disabled')

Try / catch

try:
    mise_install(pkg)
except ConflictingCargoSettings:
    subprocess.run(['mise','settings','set','cargo.binstall','true'],check=True)
    mise_install(pkg)

Prevention

When it happens

Trigger: `mise install cargo:<crate>` (via install_version_) with settings `cargo.binstall = false` (binstall disabled) AND `cargo.binstall_only = true`.

Common situations: User previously disabled binstall to force source builds, then later set binstall_only expecting prebuilt-only installs; copied settings.toml from another machine where binstall was disabled.

Related errors


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