{"record":{"id":"f1d7b270e96649b5","repo":"jdx/mise","slug":"api-metadata-has-no-tap-git-head","errorCode":null,"errorMessage":"{}: API metadata has no tap_git_head","messagePattern":"(.+?): API metadata has no tap_git_head","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/source.rs","lineNumber":83,"sourceCode":"    };\n    if let Some(using) = &src.using {\n        bail!(\n            \"{}: source uses the {using:?} download strategy, which mise cannot build from \\\n             (and no bottle exists for this machine)\",\n            formula.name,\n        );\n    }\n    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<()> {","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/system/packages/brew/source.rs#L65-L101","documentation":"mise fetches the formula .rb pinned to the API snapshot's git commit so the formula is verifiable and consistent with the source metadata. Without tap_git_head in the API JSON the commit is unknown, the pinning/verification chain breaks, and check_buildable rejects the source build up front.","triggerScenarios":"formula.tap_git_head is None during check_buildable on a source-build path (host had no bottle).","commonSituations":"Stale or truncated Homebrew API cache entries; tap metadata that omits the git head; races between tap updates and API generation.","solutions":["Clear mise's Homebrew API cache and retry","Update mise to the latest version in case metadata handling changed","Install the formula with native Homebrew or wait for consistent upstream metadata"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match check_buildable(&formula) {\n    Err(e) if e.to_string().contains(\"tap_git_head\") => {\n        clear_homebrew_api_cache()?;\n        check_buildable(&formula)\n    }\n    other => other,\n}","preventionTips":["Refresh the API cache after tap updates to get consistent snapshots with tap_git_head","Update mise regularly so pinning metadata is parsed correctly","Use native brew when metadata stays inconsistent"],"tags":["brew","source-build","formula-metadata","homebrew-api"],"backgroundTag":"missing-package-metadata","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}