jdx/mise · error

: API metadata has no formula checksum

Error message

{}: API metadata has no formula checksum

What it means

mise verifies the formula .rb itself against the sha256 recorded in the API (`ruby_source_checksum.sha256`). When that checksum is missing from the metadata, the Ruby definition cannot be authenticated, so `check_buildable` rejects the source build.

Solutions

  1. Refresh API metadata (`brew update`, clear mise's brew cache) and retry
  2. Choose a formula version/platform with bottles to avoid the source path
  3. Use brew directly for this formula
  4. Report to mise/homebrew if current API data for a mainstream formula lacks the checksum

Example fix

null
Defensive patterns

Strategy: validation

Validate before calling

curl -s https://formulae.brew.sh/api/formula/<name>.json | jq -e '.ruby_source_checksum.sha256' >/dev/null && echo ok || echo 'missing formula checksum'

Try / catch

catch 'API metadata has no formula checksum' => refresh API metadata; if still absent, avoid the source build (use bottles/brew) and report the metadata gap

Prevention

When it happens

Trigger: `check_buildable` resolves `formula.ruby_source_checksum … sha256` to None for a formula being prepared to build from source (no bottle available for the host).

Common situations: Homebrew API snapshot missing the checksum field (metadata gap, third-party tap, very new formula); stale cached API data on the machine.

Understand the failure class

Background: Checksum mismatch errors: "checksum verification failed", "digest mismatch", "expected vs actual checksum" — what they mean and how to fix them — this error's family across 41 libraries.

Related errors


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

Appendix: source

Thrown at src/system/packages/brew/source.rs:92

    if src.checksum.is_none() {
        bail!("{}: source archive has no sha256 in the API", formula.name);
    }
    // the formula .rb must be pinned to the API snapshot's commit and
    // verifiable — evaluating a newer/unverified formula against older
    // source metadata would build the wrong thing
    if formula.ruby_source_path.is_none() {
        bail!("{}: API metadata has no ruby_source_path", formula.name);
    }
    if formula.tap_git_head.is_none() {
        bail!("{}: API metadata has no tap_git_head", formula.name);
    }
    if formula
        .ruby_source_checksum
        .as_ref()
        .and_then(|c| c.sha256.as_deref())
        .is_none()
    {
        bail!("{}: API metadata has no formula checksum", formula.name);
    }
    Ok(())
}

/// Build a formula from source into its keg and link it.
pub(super) async fn build(
    rf: &ResolvedFormula,
    closure: &[ResolvedFormula],
    pr: &dyn SingleReport,
) -> Result<()> {
    let formula = &rf.formula;
    let name = &formula.name;
    let pkg_version = formula.pkg_version()?;
    check_buildable(formula)?;

    pr.set_message("resolve ruby".to_string());
    let ruby = ruby_bin().await?;
    let formula_rb = fetch_formula_rb(rf, pr).await?;

View on GitHub (pinned to 533346cc37)