def METHOD_NAME(args):
    subprocess.check_call(
        ["bazel", "build"] + [
            "--aspects=@bazel_compdb//:aspects.bzl%compilation_database_aspect",
            "--output_groups=compdb_files,header_files",
        ] + args.bazel_targets,
    )
    execroot = subprocess.check_output(
        ["bazel", "info", "execution_root"],
    ).decode().strip()
    db_entries = []
    for db in Path(execroot).glob('**/*.compile_commands.json'):
        raw_commands = db.read_text().splitlines()
        for raw_command in raw_commands:
            db_entries.append(json.loads(raw_command.rstrip(',')))
    def replace_execroot_marker(db_entry):
        if 'directory' in db_entry and db_entry['directory'] == '__EXEC_ROOT__':
            db_entry['directory'] = execroot
        if 'command' in db_entry:
            db_entry['command'] = (
                db_entry['command'].replace('-isysroot __BAZEL_XCODE_SDKROOT__', '')
            )
        return db_entry
    return list(map(replace_execroot_marker, db_entries))