nodejs/node · error · MBErr

Must not specify a build --phase for %s on %s

Error message

Must not specify a build --phase for %s on %s

What it means

Inverse of the phased-config case: the resolved builder config is a flat string (single-phase), but the caller passed --phase. MB rejects the flag because there is no phase dict to index into.

Source

Thrown at deps/v8/tools/mb/mb.py:631

        self.args.builder, self.builder_groups[self.args.builder_group])

    if not config:
      raise MBErr(
        'Builder name "%s"  not found under builder_groups[%s] in "%s"' %
        (self.args.builder, self.args.builder_group, self.args.config_file))

    if isinstance(config, dict):
      if self.args.phase is None:
        raise MBErr('Must specify a build --phase for %s on %s' %
                    (self.args.builder, self.args.builder_group))
      phase = str(self.args.phase)
      if phase not in config:
        raise MBErr('Phase %s doesn\'t exist for %s on %s' %
                    (phase, self.args.builder, self.args.builder_group))
      return config[phase]

    if self.args.phase is not None:
      raise MBErr('Must not specify a build --phase for %s on %s' %
                  (self.args.builder, self.args.builder_group))
    return config

  def FlattenConfig(self, config):
    mixins = self.configs[config]
    vals = self.DefaultVals()

    visited = []
    self.FlattenMixins(mixins, vals, visited)
    return vals

  def DefaultVals(self):
    return {
      'args_file': '',
      'cros_passthrough': False,
      'gn_args': '',
    }

View on GitHub (pinned to 1b2de5e052)

Solutions

  1. Drop the --phase argument from the MB invocation.
  2. If phases are genuinely needed, migrate the builder's config entry to a phased dict in the mb config file.

Example fix

// before
v8/tools/mb/mb.py gen -m client.v8 -b 'V8 Linux' --phase x64
// after
v8/tools/mb/mb.py gen -m client.v8 -b 'V8 Linux'
Defensive patterns

Strategy: validation

Validate before calling

config = resolve_builder_config(builder_group, builder)
if not isinstance(config, dict):
    assert phase is None, (
        f"builder {builder!r} is not phased; --phase must be omitted")

Prevention

When it happens

Trigger: Invoking `mb.py <subcmd> -m <group> -b <builder> --phase <X>` where builder_groups[group][builder] is a plain string rather than a dict.

Common situations: Copy-pasting a phased invocation against a non-phased builder; recipe not updated after a builder was de-phased; leftover --phase flag in a wrapper script.

Related errors


AI-assisted analysis of nodejs/node@1b2de5e052 (2026-08-13). Data as JSON: /api/errors/cfdbea017d411fcb. Report an issue: GitHub.