def METHOD_NAME(self, task: Any) -> Any:
    assert isinstance(task, CompileCommand)
    cmd = cast(CompileCommand, task)
    success = True
    compiler_cmd, compiler_result = run_compiler(cmd, error_ok=True, log_command=False)
    file_path = os.path.join(YB_SRC_ROOT, cmd.rel_file_path)
    extra_messages = []
    failure_reason = None
    compiler_stdout = compiler_result.stdout
    compiler_stderr = compiler_result.stderr
    if compiler_result.returncode != 0:
        success = False
        failure_reason = "Could not compile file"
        compiler_output_file_path = file_path + ".compiler_errors.txt"
        report_helper = ReportHelper()
        report_helper.add_items([
            ('Compilation directory', cmd.dir_path),
            ('Compiler command line', compiler_cmd.compiler_args.get_cmd_line_str()),
            ('Compiler standard output', compiler_stdout),
            ('Compiler standard error', compiler_stderr),
            ('Compiler exit code', str(compiler_result.returncode)),
        ])
        report_helper.write_to_file(compiler_output_file_path)
        extra_messages.extend([
            "Could not compile file %s" % cmd.rel_file_path,
            "Saved compiler output details to %s" % compiler_output_file_path,
        ])
    return CompilerResult(
        cmd=cmd,
        compiler_cmd_line=compiler_cmd.compiler_args.immutable_arg_list(),
        stdout=compiler_stdout,
        stderr=compiler_stderr,
        exit_code=compiler_result.returncode,
        extra_messages=extra_messages,
        success=success,
        failure_reason=failure_reason)