jdx/mise · error

rustup show profile returned an empty profile for

Error message

rustup show profile returned an empty profile for {}

What it means

mise runs `rustup show` to learn the default profile for a Rust tool version; if the command succeeds but prints an empty trimmed stdout, mise cannot proceed and bails rather than guessing a profile. This protects the install/satisfaction logic from silently operating on unknown rustup state.

Solutions

  1. Verify `rustup show` prints expected output manually; update rustup (`rustup self update`) to a current version
  2. Set a default toolchain and profile explicitly: `rustup set default-host`/`rustup default stable` and `rustup set profile minimal`
  3. If a wrapper/shim is intercepting rustup, ensure mise's rustup_env points at the real rustup binary
Defensive patterns

Strategy: validation

Validate before calling

const out = require('child_process').execSync('rustup show').toString().trim();
if (!out) console.error('rustup show returned empty output; update rustup before using mise rust');

Try / catch

try { await miseInstall('rust', version); } catch (e) { if (String(e).includes('empty profile')) { console.error('Update rustup and set a default profile: rustup set profile minimal'); } else throw e; }

Prevention

When it happens

Trigger: install_version_ or is_install_satisfied on a rust tool version where `rustup show profile` returns exit code 0 but empty stdout — e.g. rustup printing nothing for the queried key due to an unexpected rustup version or unusual toolchain state.

Common situations: Nonstandard or very old rustup versions whose `rustup show` output format differs; rustup with a default-toolchain none and empty settings; rustup wrappers/proxies swallowing output.

Related errors


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

Appendix: source

Thrown at src/plugins/core/rust.rs:281

        let mut cmd = cmd(runtime.bin_dir.join(RUSTUP_BIN), args)
            .env("PATH", rustup_path_env(runtime)?)
            .stdout_capture()
            .stderr_capture()
            .unchecked();
        for (key, value) in rustup_env(&runtime.homes, &tv.version) {
            cmd = cmd.env(key, value);
        }
        let output = cmd.run()?;
        if !output.status.success() {
            bail!(
                "rustup show profile failed for {}: {}",
                tv.style(),
                String::from_utf8_lossy(&output.stderr).trim()
            );
        }
        let profile = String::from_utf8_lossy(&output.stdout).trim().to_string();
        if profile.is_empty() {
            bail!(
                "rustup show profile returned an empty profile for {}",
                tv.style()
            );
        }
        Ok(profile)
    }

    fn missing_components(
        &self,
        requested: &[String],
        installed: &BTreeSet<String>,
    ) -> Vec<String> {
        requested
            .iter()
            .filter(|component| !rustup_component_installed(installed, component))
            .cloned()
            .collect()
    }

View on GitHub (pinned to 533346cc37)