{"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":92,"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(super) 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":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/packages/brew/source.rs#L74-L110","documentation":"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.","triggerScenarios":"`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).","commonSituations":"Homebrew API snapshot missing the checksum field (metadata gap, third-party tap, very new formula); stale cached API data on the machine.","solutions":["Refresh API metadata (`brew update`, clear mise's brew cache) and retry","Choose a formula version/platform with bottles to avoid the source path","Use brew directly for this formula","Report to mise/homebrew if current API data for a mainstream formula lacks the checksum"],"exampleFix":"null","handlingStrategy":"validation","validationCode":"curl -s https://formulae.brew.sh/api/formula/<name>.json | jq -e '.ruby_source_checksum.sha256' >/dev/null && echo ok || echo 'missing formula checksum'","typeGuard":null,"tryCatchPattern":"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","preventionTips":["Keep brew and mise metadata caches current","Validate API fields before scripted source builds","Stick to core formulas and stable versions","Document required platforms with bottle coverage"],"tags":["homebrew","checksum","api-metadata","build-from-source"],"backgroundTag":"checksum-mismatch","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}