{"record":{"id":"5d3eacd1af2cfab7","repo":"nodejs/node","slug":"must-specify-a-build-phase-for-s-on-s","errorCode":null,"errorMessage":"Must specify a build --phase for %s on %s","messagePattern":"Must specify a build --phase for (.+?) on (.+?)","errorType":"exception","errorClass":"MBErr","httpStatus":null,"severity":"error","filePath":"deps/v8/tools/mb/mb.py","lineNumber":622,"sourceCode":"    if not self.args.builder_group or not self.args.builder:\n      raise MBErr('Must specify either -c/--config or '\n                  '(-m/--builder-group and -b/--builder)')\n\n    if not self.args.builder_group in self.builder_groups:\n      raise MBErr('Builder groups name \"%s\" not found in \"%s\"' %\n                  (self.args.builder_group, self.args.config_file))\n\n    config = _v8_builder_fallback(\n        self.args.builder, self.builder_groups[self.args.builder_group])\n\n    if not config:\n      raise MBErr(\n        'Builder name \"%s\"  not found under builder_groups[%s] in \"%s\"' %\n        (self.args.builder, self.args.builder_group, self.args.config_file))\n\n    if isinstance(config, dict):\n      if self.args.phase is None:\n        raise MBErr('Must specify a build --phase for %s on %s' %\n                    (self.args.builder, self.args.builder_group))\n      phase = str(self.args.phase)\n      if phase not in config:\n        raise MBErr('Phase %s doesn\\'t exist for %s on %s' %\n                    (phase, self.args.builder, self.args.builder_group))\n      return config[phase]\n\n    if self.args.phase is not None:\n      raise MBErr('Must not specify a build --phase for %s on %s' %\n                  (self.args.builder, self.args.builder_group))\n    return config\n\n  def FlattenConfig(self, config):\n    mixins = self.configs[config]\n    vals = self.DefaultVals()\n\n    visited = []\n    self.FlattenMixins(mixins, vals, visited)","sourceCodeStart":604,"sourceCodeEnd":640,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/v8/tools/mb/mb.py#L604-L640","documentation":"When the resolved builder config is a dict (a multi-phase builder, e.g. separate build/test phases), ConfigFromArgs() requires --phase to select which phase to use. If self.args.phase is None while config is a dict, it raises MBErr('Must specify a build --phase for %s on %s'). The companion error 'Must not specify a build --phase' fires for the inverse mismatch (phase given but config is a plain string).","triggerScenarios":"Running `mb.py gen -m <group> -b <multi-phase-builder>` without `--phase <n>` where the builder's config value in mb_config.pyl is a dict like {'0': '...', '1': '...'}. isinstance(config, dict) is true and phase is None.","commonSituations":"A builder that was converted to multi-phase (e.g. for build/test splitting) but the caller's recipe wasn't updated to pass --phase; copy-pasting a command for a single-phase builder against a now-multi-phase one.","solutions":["Add `--phase <n>` (typically 0 or 1) matching a key in the builder's phase dict.","Inspect builder_groups[<group>][<builder>] in mb_config.pyl to see the valid phase keys.","If the builder should be single-phase, change its config value from a dict to a plain config string."],"exampleFix":"// before\n  mb.py gen -m tryserver.v8 -b \"V8 Win32 - builder\" out/Default   // dict config\n// after\n  mb.py gen -m tryserver.v8 -b \"V8 Win32 - builder\" --phase 1 out/Default","handlingStrategy":"validation","validationCode":"cfg = _v8_builder_fallback(args.builder, builder_groups[args.builder_group])\nif isinstance(cfg, dict) and args.phase is None:\n    sys.exit(f'builder {args.builder!r} is multi-phase; pass --phase one of {sorted(cfg)}')\nif not isinstance(cfg, dict) and args.phase is not None:\n    sys.exit(f'builder {args.builder!r} is single-phase; do not pass --phase')","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Inspect the builder's config value in mb_config.pyl: dict means phases are required, string means single-phase.","Update recipes to pass --phase when a builder is converted to multi-phase.","Validate the phase key exists in the dict before running mb."],"tags":["mb","phase","builder","v8-build"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}