jdx/mise · error

unresolved dependency: {}

Error message

unresolved dependency: {}

What it means

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.

Source

Thrown at src/system/packages/brew/resolve.rs:201

        raw_bases: &'a HashMap<FormulaKey, Option<String>>,
        canonical: &'a HashMap<FormulaKey, FormulaKey>,
        done: &'a mut HashSet<FormulaKey>,
        visiting: &'a mut Vec<FormulaKey>,
        on_request: &'a HashSet<FormulaKey>,
        sorted: &'a mut Vec<ResolvedFormula>,
    }
    fn visit(key: &FormulaKey, ctx: &mut VisitContext<'_>) -> Result<()> {
        if ctx.done.contains(key) {
            return Ok(());
        }
        if ctx.visiting.iter().any(|n| n == key) {
            // dependency cycles exist in homebrew/core (rare, e.g. mutual
            // optional deps); break the cycle rather than erroring
            debug!("dependency cycle involving {}, breaking", key.name);
            return Ok(());
        }
        let Some(formula) = ctx.formulae.get(key) else {
            bail!("unresolved dependency: {}", key.name);
        };
        ctx.visiting.push(key.clone());
        let tag = dep_tag(formula, ctx.host_tag);
        for dep in install_deps(formula, &tag) {
            let dep_key = FormulaKey::new(dep.clone(), key.tap_name.clone(), key.tap_url.clone());
            let dep_key = ctx.canonical.get(&dep_key).cloned().unwrap_or(dep_key);
            visit(&dep_key, ctx)?;
        }
        ctx.visiting.pop();
        ctx.done.insert(key.clone());
        ctx.sorted.push(ResolvedFormula {
            formula: ctx.formulae[key].clone(),
            tap_raw_base: ctx.raw_bases.get(key).cloned().flatten(),
            on_request: ctx.on_request.contains(key),
        });
        Ok(())
    }
    let mut keys: Vec<FormulaKey> = formulae.keys().cloned().collect();

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Update tap metadata (re-run with taps refresh enabled; not dry-run)
  2. Install the missing tap that provides the dependency
  3. Check the formula's dependency list upstream — it may reference a renamed formula; pin the parent formula's version or report it
  4. Retry after a network failure that truncated tap data
Defensive patterns

Strategy: retry

Validate before calling

const missing = deps.filter(d => !formulae.has(d));
if (missing.length) throw new Error(`tap metadata missing: ${missing.join(', ')} — refresh taps first`);

Try / catch

catch (e) {
  if (String(e).startsWith('unresolved dependency')) {
    await refreshTaps();
    return resolveClosure(pkgs);
  }
  throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.

Related errors


AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/7ddee652cd358b9f. Report an issue: GitHub.