jdx/mise · error · eyre::Report

cargo-binstall cannot honor cargo install-only tool option(s

Error message

cargo-binstall cannot honor cargo install-only tool option(s): {options}
hint: Remove the option(s), or disable cargo.binstall_only to allow cargo install

What it means

mise's cargo backend prefers installing prebuilt binaries via cargo-binstall. Some tool options only take effect when compiling from source with `cargo install`: specifically `features` (non-empty) and `default-features = false` (src/backend/cargo.rs:454-469). When the setting `cargo.binstall_only = true` forbids source compilation and the tool carries such options, mise cannot honor them, so it fails up front instead of silently installing a binary without the requested features.

Source

Thrown at src/backend/cargo.rs:308

                            self.write_install_state_best_effort(&tv);
                            return Ok(tv.clone());
                        }
                    }
                    Some(false) => {}
                    None if native_binstall::rollout_warning_active() => {
                        self.native_binstall(ctx, &tv, NativeBinstallAction::WarnOnly)
                            .await?;
                    }
                    None => {}
                },
                _ => {}
            }
        } else if Settings::get().cargo.binstall_only
            && self.git_url().is_none()
            && !cargo_install_required_options.is_empty()
        {
            let options = format_tool_options(&cargo_install_required_options);
            bail!(
                "cargo-binstall cannot honor cargo install-only tool option(s): {options}\n\
                hint: Remove the option(s), or disable cargo.binstall_only to allow cargo install"
            );
        } else if !cargo_install_required_options.is_empty() {
            let options = format_tool_options(&cargo_install_required_options);
            info!(
                "not using cargo-binstall because cargo install-only tool option(s) are specified: {options}"
            );
        }

        let mut cmd = CmdLineRunner::new(
            self.spawn_program(&ctx.config, Some(&ctx.ts), "cargo")
                .await,
        )
        .arg("install");
        if let Some(url) = self.git_url() {
            cmd = cmd.arg(format!("--git={url}"));
            if let Some(rev) = tv.version.strip_prefix("rev:") {

View on GitHub (pinned to 6f52dcdf99)

Solutions

  1. Remove `features`/`default-features` options from the cargo tool entry in mise.toml
  2. Set `cargo.binstall_only = false` (or remove it) in settings so mise falls back to `cargo install` from source
  3. Switch to a prebuilt variant/backend that already includes the features you need (e.g. aqua: or github: backend for the same tool)

Example fix

# before (mise.toml)
[settings.cargo]
binstall_only = true
[tools."cargo:bat"]
features = ["build-assets"]
# after
[settings.cargo]
binstall_only = true
[tools]
bat = "latest"
Defensive patterns

Strategy: validation

Validate before calling

# before enabling cargo.binstall_only, assert no source-only options are set
grep -nE 'features|default-features' mise.toml && echo 'remove these options or keep binstall_only off'

Prevention

When it happens

Trigger: Settings contain `cargo.binstall_only = true`, the cargo tool has no git_url, and `cargo_install_required_options()` returns a non-empty list — i.e. the tool version options include `features = "..."` or `default-features = false`. The bail fires in install() before any download.

Common situations: Users enable cargo.binstall_only for speed or to force prebuilt binaries in CI, while a mise.toml entry like `[tools."cargo:somecrate"] features = ["full"]` still requests source-only compilation. Also hits after upgrading mise when binstall_only behavior tightened.

Related errors


AI-assisted analysis of jdx/mise@6f52dcdf99 (2026-08-22). Data as JSON: /api/errors/4690322ccccb5769. Report an issue: GitHub.