PROTOBUF_ATTRIBUTE_REINITIALIZES error compiling protobuf (26.1)

64 views
Skip to first unread message

James J

unread,
Jan 13, 2025, 4:31:02 PM1/13/25
to Protocol Buffers
When compiling the bazel protobuf target as part of the Envoy project (release 1.32.3), an error is returned saying that PROTOBUF_ATTRIBUTE_REINITIALIZES is an 'unknown type name' in the generated 'type.pb.h' file.

When compiling protobuf on its own, separately from Envoy, the build completes successfully. When comparing the files,  PROTOBUF_ATTRIBUTE_REINITIALIZES appears in the file generated during the Envoy build, while ABSL_ATTRIBUTE_REINITIALIZES appears in the file from stand alone build of protobuf.

I compiled both Envoy and protobuf on the ppc64le architecture. The release of Envoy being compiled depends on protobuf version 26.1. Is there a build flag or configuration that determines whether PROTOBUF_ATTRIBUTE_REINITIALIZES or ABSL_ATTRIBUTE_REINITIALIZES is utilized in the generated files?

Any help is appreciated.

Em Rauch

unread,
Jan 13, 2025, 4:36:49 PM1/13/25
to Protocol Buffers
The issue may be due to having skew between an old protoc version with a more up to date runtime, which is a mismatch that we don't support (this is particularly strongly true in C++ where you really need an exact version match, per https://protobuf.dev/support/cross-version-runtime-guarantee/#cpp ). Is it possible that one case is using very stale protoc compared to your standalone build that is using the intended protoc 26.1?

James J

unread,
Jan 14, 2025, 3:15:27 PM1/14/25
to Protocol Buffers
This does seem to be the issue. I found two different protoc binaries in the bazel cache of my Envoy build. One is the correct version (26.1) and the other is version 24.4. Somehow the version 24.4 binary must be getting used to generate the files instead of the version 26.1 binary.

Thank you very much.
Reply all
Reply to author
Forward
0 new messages