{"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":240,"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":222,"sourceCodeEnd":258,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/packages/brew/resolve.rs#L222-L258","documentation":"While walking a formula's dependency closure, mise encountered a dependency name that is absent from the formula map fetched from the Homebrew API. Rather than guessing, it bails with the unresolved formula name. This indicates the dependency graph references a formula that could not be resolved to a tap/canonical key.","triggerScenarios":"`visit` in resolve.rs processes a dep whose name is not present in `ctx.formulae` after canonicalization — e.g. the API snapshot lacks the formula, a tap dependency points to a formula on a tap that was not fetched, or the name was renamed/deleted in homebrew/core.","commonSituations":"Stale or partial Homebrew API metadata; installing a tap formula whose deps live on another tap that is not tapped; formula renamed upstream (old name kept as an alias, not a real formula); typo in a custom tap formula's depends_on.","solutions":["Run `brew update` / refresh the API metadata and retry, so the formula map is complete","Check `brew info <name>` — if renamed, use the new formula name in your mise config","Ensure all required taps are added (mise tap or brew tap) so cross-tap dependencies resolve","If the formula genuinely exists but mise misses it, file a mise bug with the formula name and tap"],"exampleFix":"# before\nbrew_deps = [\"old-name\"]\n# after (formula renamed)\nbrew_deps = [\"new-name\"]","handlingStrategy":"validation","validationCode":"brew info <formula-name> >/dev/null 2>&1 && echo ok || echo 'formula unknown'\nmise ls-remote brew:<formula-name> | head -1","typeGuard":null,"tryCatchPattern":"catch the 'unresolved dependency: X' message; run `brew info X`; if renamed, update mise config to the new name, if cross-tap, add the tap via `mise tap` or brew","preventionTips":["Keep taps and brew metadata updated (`brew update`)","Pin formulas that exist and are not renamed","Prefer core formulas with stable names","Check `brew missing` after tap changes"],"tags":["homebrew","dependency-resolution","not-found"],"backgroundTag":"missing-dependency","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"}