nodejs/node · error · MBErr

GN_ARGS is missing target_os = "chromeos": (GN_ARGS=%s)

Error message

GN_ARGS is missing target_os = "chromeos": (GN_ARGS=%s)

What it means

With cros_passthrough enabled, MB validates the user-supplied GN_ARGS contains a target_os="chromeos" assignment (regex `target_os.*=.*"chromeos"`). Without it the build is semantically wrong because the whole point of cros_passthrough is to target ChromeOS.

Source

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

      subdir, exe = 'win', 'gn.exe'

    arch = platform.machine()
    if (arch.startswith('s390') or arch.startswith('ppc') or
        self.platform.startswith('aix')):
      # use gn in PATH
      gn_path = 'gn'
    else:
      gn_path = self.PathJoin(self.chromium_src_dir, 'buildtools', subdir, exe)
    return [gn_path, subcommand, path] + list(args)


  def GNArgs(self, vals, expand_imports=False):
    if vals['cros_passthrough']:
      if not 'GN_ARGS' in os.environ:
        raise MBErr('MB is expecting GN_ARGS to be in the environment')
      gn_args = os.environ['GN_ARGS']
      if not re.search('target_os.*=.*"chromeos"', gn_args):
        raise MBErr('GN_ARGS is missing target_os = "chromeos": (GN_ARGS=%s)' %
                    gn_args)
    else:
      gn_args = vals['gn_args']

    android_version_code = self.args.android_version_code
    if android_version_code:
      gn_args += ' android_default_version_code="%s"' % android_version_code

    android_version_name = self.args.android_version_name
    if android_version_name:
      gn_args += ' android_default_version_name="%s"' % android_version_name

    args_gn_lines = []
    parsed_gn_args = {}

    args_file = vals.get('args_file', None)
    if args_file:
      if expand_imports:

View on GitHub (pinned to 1b2de5e052)

Solutions

  1. Ensure GNARGS contains the literal substring: target_os="chromeos".
  2. Mind quoting/spacing — the matcher is `target_os.*=.*"chromeos"`.
  3. Re-run MB with the corrected GNARGS environment.

Example fix

// before
GNARGS='is_debug=false use_system_minigbm=true'
// after
GNARGS='target_os="chromeos" is_debug=false use_system_minigbm=true'
Defensive patterns

Strategy: validation

Validate before calling

import os, re
ga = os.environ.get('GN_ARGS', '')
assert re.search(r'target_os.*=.*"chromeos"', ga), (
    'GN_ARGS must contain target_os="chromeos"')

Prevention

When it happens

Trigger: GN_ARGS is present in the environment but the substring `target_os = "chromeos"` (matching the regex) is absent.

Common situations: Recipe builds GNARGS but a typo/edit removed target_os; quoting/whitespace differs enough to miss the regex; args were truncated.

Related errors


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