#error This file was generated by a newer version of protoc

Hi,

I am working on a pluggable device and I am adding protos from tensorflow sources, in particular these three ones:

I am using bazel for compiling my plugin, I have a rule to compile the protos into C++ source files and the plugin depends on it.
When I build it, I get this error:

In file included from cc/tensorflow/plugin_primeclient/kernels/var.inc:7,
                 from cc/tensorflow/plugin_primeclient/kernels/kernels.cc:58:
bazel-out/aarch64-fastbuild/bin/cc/tensorflow/plugin/interface/proto/resource_handle.pb.h:12:2: error: #error This file was generated by a newer version of protoc which is
   12 | #error This file was generated by a newer version of protoc which is
      |  ^~~~~
bazel-out/aarch64-fastbuild/bin/cc/tensorflow/plugin/interface/proto/resource_handle.pb.h:13:2: error: #error incompatible with your Protocol Buffer headers. Please update
   13 | #error incompatible with your Protocol Buffer headers. Please update
      |  ^~~~~
bazel-out/aarch64-fastbuild/bin/cc/tensorflow/plugin/interface/proto/resource_handle.pb.h:14:2: error: #error your headers.
   14 | #error your headers.
      |  ^~~~~
(...)

protoc --version tells me:

protoc --version
libprotoc 3.6.1

I am running everything in a docker container using the arm tensorflow docker image and using bazel installed with npm.

My bazel build rules for the proto library and the plugin looks like:

load("@rules_proto//proto:defs.bzl", "proto_library")

cc_library(
    name = "interface",
    hdrs = glob(["interface/**/*.h"]) + glob(["interface/**/*_impl.inc"]),
    includes = ["interface"],
    strip_include_prefix = "interface",
    deps = [":interface_cc_proto"],
    visibility = ["//cc/tensorflow:__subpackages__"],
)

cc_proto_library(
    name = "interface_cc_proto",
    deps = [":interface_proto"],
)

proto_library(
    name = "interface_proto",
    srcs = glob(["interface/**/*.proto"])
)

This is not the typical question on the forum, I hope it will find some echo :slight_smile:
Thank you for your interest