def METHOD_NAME(args, root_dir=None):
  """Runs `gn` with provided args and return error if any."""
  try:
    command = [
        sys.executable,
        os.path.join(find_depot_tools.DEPOT_TOOLS_PATH, 'gn.py')
    ] + args
    subprocess.check_output(command, cwd=root_dir)
  except subprocess.CalledProcessError as err:
    return err.output
  return None