{"record":{"id":"831581c08f8e9032","repo":"jdx/mise","slug":"api-metadata-has-no-formula-checksum","errorCode":null,"errorMessage":"{}: API metadata has no formula checksum","messagePattern":"(.+?): API metadata has no formula checksum","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/source.rs","lineNumber":91,"sourceCode":"    if src.checksum.is_none() {\n        bail!(\"{}: source archive has no sha256 in the API\", formula.name);\n    }\n    // the formula .rb must be pinned to the API snapshot's commit and\n    // verifiable — evaluating a newer/unverified formula against older\n    // source metadata would build the wrong thing\n    if formula.ruby_source_path.is_none() {\n        bail!(\"{}: API metadata has no ruby_source_path\", formula.name);\n    }\n    if formula.tap_git_head.is_none() {\n        bail!(\"{}: API metadata has no tap_git_head\", formula.name);\n    }\n    if formula\n        .ruby_source_checksum\n        .as_ref()\n        .and_then(|c| c.sha256.as_deref())\n        .is_none()\n    {\n        bail!(\"{}: API metadata has no formula checksum\", formula.name);\n    }\n    Ok(())\n}\n\n/// Build a formula from source into its keg and link it.\npub async fn build(\n    rf: &ResolvedFormula,\n    closure: &[ResolvedFormula],\n    pr: &dyn SingleReport,\n) -> Result<()> {\n    let formula = &rf.formula;\n    let name = &formula.name;\n    let pkg_version = formula.pkg_version()?;\n    check_buildable(formula)?;\n\n    pr.set_message(\"resolve ruby\".to_string());\n    let ruby = ruby_bin().await?;\n    let formula_rb = fetch_formula_rb(rf, pr).await?;","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/system/packages/brew/source.rs#L73-L109","documentation":"mise downloads the formula's .rb pinned to the API snapshot commit and verifies it against the sha256 recorded in ruby_source_checksum. If that checksum is absent from the API metadata, the formula file cannot be verified and check_buildable rejects the source build — evaluating an unverified formula against the source metadata could build the wrong thing.","triggerScenarios":"formula.ruby_source_checksum (or its sha256 field) is None during check_buildable on a source-build path.","commonSituations":"Partial or stale Homebrew API cache; upstream metadata anomalies; taps that do not publish formula checksums.","solutions":["Clear mise's Homebrew API cache and retry to refresh metadata","Update mise to the latest version","Install the formula with native Homebrew, which does not depend on mise's verification chain"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match check_buildable(&formula) {\n    Err(e) if e.to_string().contains(\"formula checksum\") => {\n        clear_homebrew_api_cache()?;\n        check_buildable(&formula)\n    }\n    other => other,\n}","preventionTips":["Never skip the .rb verification these errors guard — stale metadata builds the wrong thing","Refresh the Homebrew API cache before source builds on machines used infrequently","Fall back to native brew if the formula checksum never appears in the API"],"tags":["brew","source-build","formula-metadata","checksum"],"backgroundTag":"missing-package-metadata","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}