Skip to content
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

metricq-cpp FTBFS with protobuf >=22 #38

Closed
cvonelm opened this issue Nov 7, 2023 · 1 comment
Closed

metricq-cpp FTBFS with protobuf >=22 #38

cvonelm opened this issue Nov 7, 2023 · 1 comment
Assignees

Comments

@cvonelm
Copy link

cvonelm commented Nov 7, 2023

metricq-cpp fails to build with protobuf versions >= 22 due to two issues:

  1. protobuf 22 added Abseil as a dependency, but FindProtobuf.cmake does not take care of this dependency. This can be fixed by adding Abseil as a dependency to the metricq-protobuf target if versions >= 22 are detected.
  2. Additionally there seem to be breaking changes to the API:
[ 43%] Building CXX object CMakeFiles/metricq-source.dir/src/source.cpp.o
In file included from /include/google/protobuf/implicit_weak_message.h:39,
                 from include/google/protobuf/generated_message_util.h:55,
                 from include/metricq/datachunk.pb.h:27,
                 from metricq-cpp/src/source.cpp:33:
include/google/protobuf/repeated_field.h: In instantiation of 'class google::protobuf::RepeatedField<const long int>':
include/metricq/types.hpp:131:71:   required from here
include/google/protobuf/repeated_field.h:155:42: error: static assertion failed: We do not support const value types.
  155 |   static_assert(!std::is_const<Element>::value,
      |                                          ^~~~~
include/google/protobuf/repeated_field.h:155:42: note: '!(bool)std::integral_constant<bool, true>::value' evaluates to false
include/google/protobuf/repeated_field.h: In instantiation of 'class google::protobuf::RepeatedField<const double>':
include/metricq/types.hpp:132:54:   required from here
include/google/protobuf/repeated_field.h:155:42: error: static assertion failed: We do not support const value types.
include/google/protobuf/repeated_field.h:155:42: note: '!(bool)std::integral_constant<bool, true>::value' evaluates to false
make[2]: *** [CMakeFiles/metricq-source.dir/build.make:76: CMakeFiles/metricq-source.dir/src/source.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:453: CMakeFiles/metricq-source.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
@bmario
Copy link
Member

bmario commented Nov 7, 2023

@tilsche tilsche self-assigned this Dec 3, 2023
tilsche added a commit that referenced this issue Dec 3, 2023
This uses the config version of FindPackage.
But we have to sue the module compatibiltiy, because the build commands of config version are totally different and undocumented.

see protocolbuffers/protobuf#12637 (comment)
see https://stackoverflow.com/a/56896032/620382
@bmario bmario closed this as completed in 8f64c21 Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants