{"record":{"id":"7ddee652cd358b9f","repo":"jdx/mise","slug":"unresolved-dependency","errorCode":null,"errorMessage":"unresolved dependency: {}","messagePattern":"unresolved dependency: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/resolve.rs","lineNumber":201,"sourceCode":"        raw_bases: &'a HashMap<FormulaKey, Option<String>>,\n        canonical: &'a HashMap<FormulaKey, FormulaKey>,\n        done: &'a mut HashSet<FormulaKey>,\n        visiting: &'a mut Vec<FormulaKey>,\n        on_request: &'a HashSet<FormulaKey>,\n        sorted: &'a mut Vec<ResolvedFormula>,\n    }\n    fn visit(key: &FormulaKey, ctx: &mut VisitContext<'_>) -> Result<()> {\n        if ctx.done.contains(key) {\n            return Ok(());\n        }\n        if ctx.visiting.iter().any(|n| n == key) {\n            // dependency cycles exist in homebrew/core (rare, e.g. mutual\n            // optional deps); break the cycle rather than erroring\n            debug!(\"dependency cycle involving {}, breaking\", key.name);\n            return Ok(());\n        }\n        let Some(formula) = ctx.formulae.get(key) else {\n            bail!(\"unresolved dependency: {}\", key.name);\n        };\n        ctx.visiting.push(key.clone());\n        let tag = dep_tag(formula, ctx.host_tag);\n        for dep in install_deps(formula, &tag) {\n            let dep_key = FormulaKey::new(dep.clone(), key.tap_name.clone(), key.tap_url.clone());\n            let dep_key = ctx.canonical.get(&dep_key).cloned().unwrap_or(dep_key);\n            visit(&dep_key, ctx)?;\n        }\n        ctx.visiting.pop();\n        ctx.done.insert(key.clone());\n        ctx.sorted.push(ResolvedFormula {\n            formula: ctx.formulae[key].clone(),\n            tap_raw_base: ctx.raw_bases.get(key).cloned().flatten(),\n            on_request: ctx.on_request.contains(key),\n        });\n        Ok(())\n    }\n    let mut keys: Vec<FormulaKey> = formulae.keys().cloned().collect();","sourceCodeStart":183,"sourceCodeEnd":219,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/packages/brew/resolve.rs#L183-L219","documentation":"While walking the dependency closure of requested formulae, the resolver looks each dependency up in the loaded formula map (ctx.formulae); if a dependency key is missing after canonicalization, the graph cannot be completed, so it fails with the unresolved dependency name.","triggerScenarios":"A formula declares a dependency that is absent from the fetched tap data — a typo'd/stale formula dependency, a dependency living in a tap that wasn't fetched, or canonicalization mapping to a key that was never loaded.","commonSituations":"Third-party taps whose metadata references formulas not present locally; stale local tap metadata after upstream renames/removals; network fetch skipped (dry-run) leaving formulae incomplete.","solutions":["Update tap metadata (re-run with taps refresh enabled; not dry-run)","Install the missing tap that provides the dependency","Check the formula's dependency list upstream — it may reference a renamed formula; pin the parent formula's version or report it","Retry after a network failure that truncated tap data"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"const missing = deps.filter(d => !formulae.has(d));\nif (missing.length) throw new Error(`tap metadata missing: ${missing.join(', ')} — refresh taps first`);","typeGuard":null,"tryCatchPattern":"catch (e) {\n  if (String(e).startsWith('unresolved dependency')) {\n    await refreshTaps();\n    return resolveClosure(pkgs);\n  }\n  throw e;\n}","preventionTips":["Keep taps updated before resolving closures","Ensure all taps providing dependencies are declared/fetched","Don't use dry-run output as a substitute for a real resolve"],"tags":["brew","dependency-resolution","taps"],"backgroundTag":"missing-dependency","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}