{"record":{"id":"e73716f712d632df","repo":"nodejs/node","slug":"mb-config-file-s-has-problems","errorCode":null,"errorMessage":"mb config file %s has problems:","messagePattern":"mb config file (.+?) has problems:","errorType":"exception","errorClass":"MBErr","httpStatus":null,"severity":"error","filePath":"deps/v8/tools/mb/mb.py","lineNumber":483,"sourceCode":"        if not mixin in self.mixins:\n          errs.append('Unknown mixin \"%s\" referenced by config \"%s\".' %\n                      (mixin, config))\n        referenced_mixins.add(mixin)\n\n    for mixin in self.mixins:\n      for sub_mixin in self.mixins[mixin].get('mixins', []):\n        if not sub_mixin in self.mixins:\n          errs.append('Unknown mixin \"%s\" referenced by mixin \"%s\".' %\n                      (sub_mixin, mixin))\n        referenced_mixins.add(sub_mixin)\n\n    # Check that every mixin defined is actually referenced somewhere.\n    for mixin in self.mixins:\n      if not mixin in referenced_mixins:\n        errs.append('Unreferenced mixin \"%s\".' % mixin)\n\n    if errs:\n      raise MBErr(('mb config file %s has problems:' % self.args.config_file) +\n                    '\\n  ' + '\\n  '.join(errs))\n\n    if print_ok:\n      self.Print('mb config file %s looks ok.' % self.args.config_file)\n    return 0\n\n  def GetConfig(self):\n    build_dir = self.args.path[0]\n\n    vals = self.DefaultVals()\n    if self.args.builder or self.args.builder_group or self.args.config:\n      vals = self.Lookup()\n      # Re-run gn gen in order to ensure the config is consistent with the\n      # build dir.\n      self.RunGNGen(vals)\n      return vals\n\n    toolchain_path = self.PathJoin(self.ToAbsPath(build_dir),","sourceCodeStart":465,"sourceCodeEnd":501,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/v8/tools/mb/mb.py#L465-L501","documentation":"mb.py validates the mb_config.pyl mixin graph during ReadConfigFile(). It collects two classes of error: a mixin referenced inside another mixin's 'mixins' list that is not itself defined ('Unknown mixin'), and a defined mixin that nothing references ('Unreferenced mixin'). If any errors accumulate, it raises MBErr listing all problems against the config file path.","triggerScenarios":"Running `mb.py analyze`/`gen`/`lookup` after editing mb_config.pyl such that a mixin name is misspelled (referenced but undefined) or a mixin was removed from all builders but left defined. The validator gathers all errs and raises if the list is non-empty.","commonSituations":"Renaming a mixin but forgetting to update a builder that uses it; deleting a builder that was the sole consumer of a mixin (leaving it unreferenced); merge conflicts in mb_config.pyl leaving a dangling reference.","solutions":["Read the full error list — it names every offending mixin; fix each 'Unknown mixin' (correct the spelling / define it) and each 'Unreferenced mixin' (remove it or wire it to a builder).","Run `mb.py validate --config <file> -f <file>` to re-check after edits until it reports 'looks ok'.","For a merge conflict, resolve the conflict fully so both sides' mixin definitions and references are consistent."],"exampleFix":"// before\n  'mixins': {\n    'shared': {...},\n    'mybuilder': {'mixins': ['shard']},   // typo: 'shard' undefined\n  }\n// after\n  'mixins': {\n    'shared': {...},\n    'mybuilder': {'mixins': ['shared']},\n  }","handlingStrategy":"validation","validationCode":"errs = []\nreferenced = set()\nfor m, defn in mixins.items():\n    for sub in defn.get('mixins', []):\n        if sub not in mixins: errs.append(f'Unknown mixin {sub!r} in {m!r}')\n        referenced.add(sub)\nfor m in mixins:\n    if m not in referenced: errs.append(f'Unreferenced mixin {m!r}')\nassert not errs, errs","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Run `mb.py validate` after every mb_config.pyl edit.","When renaming a mixin, grep all builders/mixins that reference it and update in the same change.","Delete mixins at the same time you remove their last consumer; don't leave them dangling."],"tags":["mb","config","validation","mixins","v8-build"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}