-
Notifications
You must be signed in to change notification settings - Fork 727
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
protobuf-c 1.4.1 won't build against protobuf 22.1 #544
Comments
after upgrade the protobuf to 4.22.x, the protobuf-c cannot compile anymore (protobuf-c#544) due to following changes: 1.protobuf using c++14, that cause the command_line_interface.h report error 2.protobuf using abseil-cpp library instead the trace API with GOOGLE_ header 3. removed GOOGLE_DISALLOW_EVIL_CONSTRUCTORS
I've been trying to build 1.4.1 + 66a0b0d against protobuf 22.5 and .. [tkloczko@pers-jacek protobuf-c-1.4.1]$ make V=1
/usr/bin/g++ -std=c++11 -std=c++14 -DHAVE_CONFIG_H -I. -include ./config.h -I./protobuf-c -I. -I. -DPROTOBUF_USE_DLLS -DNOMINMAX -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -std=c++17 -fno-rtti -fno-exceptions -c -o protoc-c/protoc_gen_c-c_bytes_field.o `test -f 'protoc-c/c_bytes_field.cc' || echo './'`protoc-c/c_bytes_field.cc
In file included from protoc-c/c_bytes_field.cc:64:
./protoc-c/c_helpers.h: In function ‘int google::protobuf::compiler::c::FieldSyntax(const google::protobuf::FieldDescriptor*)’:
./protoc-c/c_helpers.h:175:31: error: ‘google::protobuf::FileDescriptor::Syntax google::protobuf::FileDescriptor::syntax() const’ is private within this context
175 | return field->file()->syntax() == FileDescriptor::SYNTAX_PROTO3 ? 3 : 2;
| ~~~~~~~~~~~~~~~~~~~~~^~
In file included from ./protoc-c/c_field.h:68,
from ./protoc-c/c_bytes_field.h:68,
from protoc-c/c_bytes_field.cc:63:
/usr/include/google/protobuf/descriptor.h:2631:31: note: declared private here
2631 | inline FileDescriptor::Syntax FileDescriptor::syntax() const {
| ^~~~~~~~~~~~~~
./protoc-c/c_helpers.h:175:31: warning: ‘google::protobuf::FileDescriptor::Syntax google::protobuf::FileDescriptor::syntax() const’ is deprecated: Syntax is deprecated in favor of editions. Please use targeted feature helpers instead (e.g. has_presence, is_packed, requires_utf8_validation, etc). [-Wdeprecated-declarations]
175 | return field->file()->syntax() == FileDescriptor::SYNTAX_PROTO3 ? 3 : 2;
| ~~~~~~~~~~~~~~~~~~~~~^~
/usr/include/google/protobuf/descriptor.h:2631:31: note: declared here
2631 | inline FileDescriptor::Syntax FileDescriptor::syntax() const {
| ^~~~~~~~~~~~~~
./protoc-c/c_helpers.h:175:53: error: ‘google::protobuf::FileDescriptor::Syntax google::protobuf::FileDescriptor::SYNTAX_PROTO3’ is private within this context
175 | return field->file()->syntax() == FileDescriptor::SYNTAX_PROTO3 ? 3 : 2;
| ^~~~~~~~~~~~~
/usr/include/google/protobuf/descriptor.h:1694:5: note: declared private here
1694 | SYNTAX_PROTO3 = 3,
| ^~~~~~~~~~~~~
make: *** [Makefile:1597: protoc-c/protoc_gen_c-c_bytes_field.o] Error 1 |
Looks like missing checking dependencies for absl. |
With protobuf 22.5 built with gcc 13.1, I see errors like this while linking. Any idea why? CXXLD protoc-c/protoc-gen-c |
Is there a known version combination of libprotobuf-c and protobuf that works? |
Hi, Please try out the branch in #673 with either protobuf 22.5 or protobuf 23.3. Thanks! |
Is it any chance backport those changes for protobuf 21.x (last version which is not using absl)? |
The changes in #673 add support for protobuf 22.x and 23.x. They do not remove support for previous versions of protobuf. So there is nothing to backport, we would simply merge #673 and release a new version of protobuf-c. |
@edmonds Let me know if you need help doing this (merge and release). I imagine many (including myself) are needing this. I think at least it should be merged into |
Update: I better test the pull request first ha (Windows, CMake), will update that PR with my findings. |
Could build successfully with protobuf 23.3. Thanks! |
@edmonds Confirm, it fixes my issue too. Would be nice to have a new release. |
I can confirm that this patch also allows protobuf-c to work with protobuf 24. I got the seemingly common missing header error below, but running
|
Please make a new release that includes this fix. Thank you. |
Do we have an update on a release for this issue @0-wiz-0 |
Add another one to the list waiting on a release. |
Hi, thanks for testing. This should be fixed in the 1.5.0 release. |
I can confirm that 1.5.0 is OK now. |
It uses macros like
GOOGLE_LOG
that were defined in protobuf 21 in the filegoogle/protobuf/stubs/macros.h
that no longer exists in 22.1, and this now triggers these build errors.The text was updated successfully, but these errors were encountered: