Closed kloczek closed 10 months ago
In generated protobuf-config.cmake I see as well:
# User options
include("${CMAKE_CURRENT_LIST_DIR}/protobuf-options.cmake")
# Depend packages
if(NOT TARGET absl::strings)
find_package(absl CONFIG)
endif()
if(NOT TARGET utf8_range)
find_package(utf8_range CONFIG)
endif()
# Imported targets
include("${CMAKE_CURRENT_LIST_DIR}/protobuf-targets.cmake")
# protobuf-generate function
include("${CMAKE_CURRENT_LIST_DIR}/protobuf-generate.cmake")
# CMake FindProtobuf module compatible file
if(protobuf_MODULE_COMPATIBLE)
include("${CMAKE_CURRENT_LIST_DIR}/protobuf-module.cmake")
endif()
Just in case I've build protobuf with -D utf8_range_ENABLE_INSTALL=OFF
.
I've added quick hack to remove utf8_range
from Requires on rpm package %install stage.
With such product I was able to start testing use generated package on building other packages.
Results:
[ 81%] Linking CXX executable libphonenumber_test
/usr/bin/cmake -E cmake_link_script CMakeFiles/libphonenumber_test.dir/link.txt --verbose=1
/usr/bin/g++ -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 -flto=auto -flto-partition=none -DNDEBUG -Wl,--gc-sections -Wl,--as-needed -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,--build-id=sha1 CMakeFiles/libphonenumber_test.dir/test/phonenumbers/asyoutypeformatter_test.cc.o CMakeFiles/libphonenumber_test.dir/test/phonenumbers/logger_test.cc.o CMakeFiles/libphonenumber_test.dir/test/phonenumbers/matcher_test.cc.o CMakeFiles/libphonenumber_test.dir/test/phonenumbers/phonenumberutil_test.cc.o CMakeFiles/libphonenumber_test.dir/test/phonenumbers/regexp_adapter_test.cc.o CMakeFiles/libphonenumber_test.dir/test/phonenumbers/regexp_cache_test.cc.o CMakeFiles/libphonenumber_test.dir/test/phonenumbers/run_tests.cc.o CMakeFiles/libphonenumber_test.dir/test/phonenumbers/shortnumberinfo_test.cc.o CMakeFiles/libphonenumber_test.dir/test/phonenumbers/stringutil_test.cc.o CMakeFiles/libphonenumber_test.dir/test/phonenumbers/test_util.cc.o CMakeFiles/libphonenumber_test.dir/test/phonenumbers/unicodestring_test.cc.o CMakeFiles/libphonenumber_test.dir/test/phonenumbers/utf/unicodetext_test.cc.o CMakeFiles/libphonenumber_test.dir/test/phonenumbers/geocoding/area_code_map_test.cc.o CMakeFiles/libphonenumber_test.dir/test/phonenumbers/geocoding/geocoding_data_test.cc.o CMakeFiles/libphonenumber_test.dir/test/phonenumbers/geocoding/geocoding_test_data.cc.o CMakeFiles/libphonenumber_test.dir/test/phonenumbers/geocoding/mapping_file_provider_test.cc.o CMakeFiles/libphonenumber_test.dir/test/phonenumbers/geocoding/phonenumber_offline_geocoder_test.cc.o CMakeFiles/libphonenumber_test.dir/test/phonenumbers/phonenumbermatch_test.cc.o CMakeFiles/libphonenumber_test.dir/test/phonenumbers/phonenumbermatcher_test.cc.o -o libphonenumber_test libphonenumber_testing.a /usr/lib64/libgtest.so -lpthread /usr/lib64/libicuuc.so /usr/lib64/libicui18n.so /usr/lib64/libprotobuf.so /usr/lib64/libabsl_cord.so.2301.0.0 /usr/lib64/libabsl_cordz_info.so.2301.0.0 /usr/lib64/libabsl_cord_internal.so.2301.0.0 /usr/lib64/libabsl_cordz_functions.so.2301.0.0 /usr/lib64/libabsl_cordz_handle.so.2301.0.0 /usr/lib64/libabsl_crc_cord_state.so.2301.0.0 /usr/lib64/libabsl_crc32c.so.2301.0.0 /usr/lib64/libabsl_crc_internal.so.2301.0.0 /usr/lib64/libabsl_crc_cpu_detect.so.2301.0.0 /usr/lib64/libabsl_hash.so.2301.0.0 /usr/lib64/libabsl_city.so.2301.0.0 /usr/lib64/libabsl_bad_variant_access.so.2301.0.0 /usr/lib64/libabsl_low_level_hash.so.2301.0.0 /usr/lib64/libabsl_raw_hash_set.so.2301.0.0 /usr/lib64/libabsl_hashtablez_sampler.so.2301.0.0 /usr/lib64/libabsl_exponential_biased.so.2301.0.0 /usr/lib64/libabsl_bad_optional_access.so.2301.0.0 /usr/lib64/libabsl_synchronization.so.2301.0.0 /usr/lib64/libabsl_graphcycles_internal.so.2301.0.0 /usr/lib64/libabsl_stacktrace.so.2301.0.0 /usr/lib64/libabsl_symbolize.so.2301.0.0 /usr/lib64/libabsl_malloc_internal.so.2301.0.0 /usr/lib64/libabsl_debugging_internal.so.2301.0.0 /usr/lib64/libabsl_demangle_internal.so.2301.0.0 /usr/lib64/libabsl_time.so.2301.0.0 /usr/lib64/libabsl_strings.so.2301.0.0 /usr/lib64/libabsl_strings_internal.so.2301.0.0 /usr/lib64/libabsl_throw_delegate.so.2301.0.0 /usr/lib64/libabsl_base.so.2301.0.0 /usr/lib64/libabsl_spinlock_wait.so.2301.0.0 /usr/lib64/libabsl_int128.so.2301.0.0 /usr/lib64/libabsl_raw_logging_internal.so.2301.0.0 /usr/lib64/libabsl_log_severity.so.2301.0.0 /usr/lib64/libabsl_civil_time.so.2301.0.0 /usr/lib64/libabsl_time_zone.so.2301.0.0 /usr/lib64/libboost_date_time.so /usr/lib64/libboost_system.so -lboost_thread /usr/lib64/libboost_chrono.so /usr/lib64/libboost_atomic.so
/usr/bin/ld: /tmp/ccOihmdo.lto.o: in function `google::protobuf::RepeatedField<int>::GrowNoAnnotate(int, int)':
/usr/include/google/protobuf/thread_safe_arena.h:198: undefined reference to `google::protobuf::internal::ThreadSafeArena::thread_cache_'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/libphonenumber_test.dir/build.make:442: libphonenumber_test] Error 1
make[2]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/libphonenumber-8.13.11/x86_64-redhat-linux-gnu'
make[1]: *** [CMakeFiles/Makefile2:359: CMakeFiles/libphonenumber_test.dir/all] Error 2
make[1]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/libphonenumber-8.13.11/x86_64-redhat-linux-gnu'
make: *** [Makefile:159: all] Error 2
[ 17%] Linking CXX executable ../../../../runtime_output_directory/xprotocol_plugin
cd /home/tkloczko/rpmbuild/BUILD/mysql-8.0.33/x86_64-redhat-linux-gnu/plugin/x/protocol/plugin && /usr/bin/cmake -E cmake_link_script CMakeFiles/xprotocol_plugin.dir/link.txt --verbose=1
/usr/bin/g++ -std=c++17 -fno-omit-frame-pointer -ftls-model=initial-exec -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 -flto=auto -flto-partition=none -Wall -Wextra -Wformat-security -Wvla -Wundef -Wmissing-format-attribute -Woverloaded-virtual -Wcast-qual -Wimplicit-fallthrough=5 -Wstringop-truncation -Wsuggest-override -Wmissing-include-dirs -Wextra-semi -Wlogical-op -ffunction-sections -fdata-sections -DNDEBUG -Wl,--gc-sections -Wl,--as-needed -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,--build-id=sha1 -Wl,--gc-sections -Wl,--as-needed -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,--build-id=sha1 -Wl,--build-id=sha1 -Wl,--no-as-needed -lpthread CMakeFiles/xprotocol_plugin.dir/message_field_chain.cc.o CMakeFiles/xprotocol_plugin.dir/messages_used_by_server.cc.o CMakeFiles/xprotocol_plugin.dir/xprotocol_plugin.cc.o -o ../../../../runtime_output_directory/xprotocol_plugin ../protobuf/libmysqlxmessages.a /usr/lib64/libprotoc.so /usr/lib64/libprotobuf.so
/usr/bin/ld: /usr/lib64/libprotoc.so: undefined reference to symbol '_ZN4absl12lts_2023012513base_internal12SpinLockWaitEPSt6atomicIjEiPKNS1_22SpinLockWaitTransitionENS1_14SchedulingModeE'
/usr/bin/ld: /usr/lib64/libabsl_spinlock_wait.so.2301.0.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [plugin/x/protocol/plugin/CMakeFiles/xprotocol_plugin.dir/build.make:135: runtime_output_directory/xprotocol_plugin] Error 1
make[2]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/mysql-8.0.33/x86_64-redhat-linux-gnu'
make[1]: *** [CMakeFiles/Makefile2:9718: plugin/x/protocol/plugin/CMakeFiles/xprotocol_plugin.dir/all] Error 2
make[1]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/mysql-8.0.33/x86_64-redhat-linux-gnu'
make: *** [Makefile:169: all] Error 2
[ 21%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/opencv-caffe.pb.cc.o
cd /home/tkloczko/rpmbuild/BUILD/opencv-4.7.0/x86_64-redhat-linux-gnu/modules/dnn && /usr/bin/g++ -DCVAPI_EXPORTS -DENABLE_PLUGINS -DHAVE_PROTOBUF=1 -DOPENCV_DNN_EXTERNAL_PROTOBUF=1 -DVK_NO_PROTOTYPES -D_USE_MATH_DEFINES -D__OPENCV_BUILD=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/tkloczko/rpmbuild/BUILD/opencv-4.7.0/x86_64-redhat-linux-gnu -I/usr/include/vulkan -I/home/tkloczko/rpmbuild/BUILD/opencv-4.7.0/modules/dnn/include -I/home/tkloczko/rpmbuild/BUILD/opencv-4.7.0/x86_64-redhat-linux-gnu/modules/dnn -I/home/tkloczko/rpmbuild/BUILD/opencv-4.7.0/modules/core/include -I/home/tkloczko/rpmbuild/BUILD/opencv-4.7.0/modules/imgproc/include -isystem /usr/include/eigen3 -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 -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wundef -Winit-self -Wpointer-arith -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -fopenmp -Wno-deprecated -Wno-missing-declarations -Wno-shadow -Wno-unused-parameter -Wno-sign-compare -Wno-invalid-offsetof -DNDEBUG -std=c++11 -fPIC -Wno-suggest-override -Wno-array-bounds -MD -MT modules/dnn/CMakeFiles/opencv_dnn.dir/opencv-caffe.pb.cc.o -MF CMakeFiles/opencv_dnn.dir/opencv-caffe.pb.cc.o.d -o CMakeFiles/opencv_dnn.dir/opencv-caffe.pb.cc.o -c /home/tkloczko/rpmbuild/BUILD/opencv-4.7.0/x86_64-redhat-linux-gnu/modules/dnn/opencv-caffe.pb.cc
In file included from /usr/include/absl/base/config.h:86,
from /usr/include/absl/base/attributes.h:37,
from /usr/include/absl/strings/string_view.h:39,
from /usr/include/google/protobuf/stubs/common.h:44,
from /usr/include/google/protobuf/io/coded_stream.h:130,
from /home/tkloczko/rpmbuild/BUILD/opencv-4.7.0/x86_64-redhat-linux-gnu/modules/dnn/opencv-caffe.pb.h:24,
from /home/tkloczko/rpmbuild/BUILD/opencv-4.7.0/x86_64-redhat-linux-gnu/modules/dnn/opencv-caffe.pb.cc:4:
/usr/include/absl/base/policy_checks.h:79:2: error: #error "C++ versions less than C++14 are not supported."
79 | #error "C++ versions less than C++14 are not supported."
| ^~~~~
In file included from /home/tkloczko/rpmbuild/BUILD/opencv-4.7.0/x86_64-redhat-linux-gnu/modules/dnn/opencv-caffe.pb.h:11:
/usr/include/google/protobuf/port_def.inc:205:15: error: static assertion failed: Protobuf only supports C++14 and newer.
205 | static_assert(PROTOBUF_CPLUSPLUS_MIN(201402L), "Protobuf only supports C++14 and newer.");
| ^~~~~~~~~~~~~~~~~~~~~~
/usr/include/google/protobuf/port_def.inc:205:15: note: the comparison reduces to ‘(201103 >= 201402)’
/usr/include/absl/strings/string_view.h:52:26: error: ‘string_view’ in namespace ‘std’ does not name a type
52 | using string_view = std::string_view;
| ^~~~~~~~~~~
/usr/include/absl/strings/string_view.h:52:21: note: ‘std::string_view’ is only available from C++17 onwards
52 | using string_view = std::string_view;
| ^~~
/usr/include/absl/strings/string_view.h:686:8: error: ‘string_view’ does not name a type
686 | inline string_view ClippedSubstr(string_view s, size_t pos,
| ^~~~~~~~~~~
/usr/include/absl/strings/string_view.h:697:11: error: ‘string_view’ does not name a type
697 | constexpr string_view NullSafeStringView(const char* p) {
| ^~~~~~~~~~~
In file included from /usr/include/google/protobuf/stubs/port.h:45,
from /usr/include/google/protobuf/stubs/common.h:46:
/usr/include/google/protobuf/port_def.inc:205:15: error: static assertion failed: Protobuf only supports C++14 and newer.
205 | static_assert(PROTOBUF_CPLUSPLUS_MIN(201402L), "Protobuf only supports C++14 and newer.");
| ^~~~~~~~~~~~~~~~~~~~~~
/usr/include/google/protobuf/port_def.inc:205:15: note: the comparison reduces to ‘(201103 >= 201402)’
In file included from /usr/include/google/protobuf/stubs/common.h:56:
/usr/include/google/protobuf/port_def.inc:205:15: error: static assertion failed: Protobuf only supports C++14 and newer.
205 | static_assert(PROTOBUF_CPLUSPLUS_MIN(201402L), "Protobuf only supports C++14 and newer.");
| ^~~~~~~~~~~~~~~~~~~~~~
/usr/include/google/protobuf/port_def.inc:205:15: note: the comparison reduces to ‘(201103 >= 201402)’
In file included from /usr/include/absl/log/internal/check_op.h:36,
from /usr/include/absl/log/internal/check_impl.h:19,
from /usr/include/absl/log/absl_check.h:38,
from /usr/include/google/protobuf/io/coded_stream.h:132:
/usr/include/absl/log/internal/nullstream.h:49:32: error: ‘absl::string_view’ has not been declared
49 | NullStream& AtLocation(absl::string_view, int) { return *this; }
| ^~~~~~~~~~~
In file included from /usr/include/absl/time/time.h:89,
from /usr/include/absl/log/log_entry.h:35,
from /usr/include/absl/log/internal/log_message.h:41,
from /usr/include/absl/log/internal/strip.h:24,
from /usr/include/absl/log/internal/check_op.h:37:
/usr/include/absl/time/civil_time.h:489:27: error: ‘string_view’ is not a member of ‘absl’
489 | bool ParseCivilTime(absl::string_view s, CivilSecond* c);
| ^~~~~~~~~~~
/usr/include/absl/time/civil_time.h:489:53: error: expected primary-expression before ‘*’ token
489 | bool ParseCivilTime(absl::string_view s, CivilSecond* c);
| ^
/usr/include/absl/time/civil_time.h:489:55: error: ‘c’ was not declared in this scope
489 | bool ParseCivilTime(absl::string_view s, CivilSecond* c);
| ^
/usr/include/absl/time/civil_time.h:489:56: error: expression list treated as compound expression in initializer [-fpermissive]
489 | bool ParseCivilTime(absl::string_view s, CivilSecond* c);
| ^
/usr/include/absl/time/civil_time.h:490:6: error: redefinition of ‘bool absl::lts_20230125::ParseCivilTime’
490 | bool ParseCivilTime(absl::string_view s, CivilMinute* c);
| ^~~~~~~~~~~~~~
/usr/include/absl/time/civil_time.h:489:6: note: ‘bool absl::lts_20230125::ParseCivilTime’ previously defined here
489 | bool ParseCivilTime(absl::string_view s, CivilSecond* c);
| ^~~~~~~~~~~~~~
/usr/include/absl/time/civil_time.h:490:27: error: ‘string_view’ is not a member of ‘absl’
490 | bool ParseCivilTime(absl::string_view s, CivilMinute* c);
| ^~~~~~~~~~~
/usr/include/absl/time/civil_time.h:490:53: error: expected primary-expression before ‘*’ token
490 | bool ParseCivilTime(absl::string_view s, CivilMinute* c);
| ^
/usr/include/absl/time/civil_time.h:490:55: error: ‘c’ was not declared in this scope
490 | bool ParseCivilTime(absl::string_view s, CivilMinute* c);
| ^
/usr/include/absl/time/civil_time.h:491:6: error: redefinition of ‘bool absl::lts_20230125::ParseCivilTime’
491 | bool ParseCivilTime(absl::string_view s, CivilHour* c);
| ^~~~~~~~~~~~~~
/usr/include/absl/time/civil_time.h:489:6: note: ‘bool absl::lts_20230125::ParseCivilTime’ previously defined here
489 | bool ParseCivilTime(absl::string_view s, CivilSecond* c);
| ^~~~~~~~~~~~~~
/usr/include/absl/time/civil_time.h:491:27: error: ‘string_view’ is not a member of ‘absl’
491 | bool ParseCivilTime(absl::string_view s, CivilHour* c);
| ^~~~~~~~~~~
/usr/include/absl/time/civil_time.h:491:51: error: expected primary-expression before ‘*’ token
491 | bool ParseCivilTime(absl::string_view s, CivilHour* c);
| ^
/usr/include/absl/time/civil_time.h:491:53: error: ‘c’ was not declared in this scope
491 | bool ParseCivilTime(absl::string_view s, CivilHour* c);
| ^
/usr/include/absl/time/civil_time.h:492:6: error: redefinition of ‘bool absl::lts_20230125::ParseCivilTime’
492 | bool ParseCivilTime(absl::string_view s, CivilDay* c);
| ^~~~~~~~~~~~~~
/usr/include/absl/time/civil_time.h:489:6: note: ‘bool absl::lts_20230125::ParseCivilTime’ previously defined here
489 | bool ParseCivilTime(absl::string_view s, CivilSecond* c);
| ^~~~~~~~~~~~~~
/usr/include/absl/time/civil_time.h:492:27: error: ‘string_view’ is not a member of ‘absl’
492 | bool ParseCivilTime(absl::string_view s, CivilDay* c);
| ^~~~~~~~~~~
/usr/include/absl/time/civil_time.h:492:50: error: expected primary-expression before ‘*’ token
492 | bool ParseCivilTime(absl::string_view s, CivilDay* c);
| ^
/usr/include/absl/time/civil_time.h:492:52: error: ‘c’ was not declared in this scope
492 | bool ParseCivilTime(absl::string_view s, CivilDay* c);
| ^
/usr/include/absl/time/civil_time.h:493:6: error: redefinition of ‘bool absl::lts_20230125::ParseCivilTime’
493 | bool ParseCivilTime(absl::string_view s, CivilMonth* c);
| ^~~~~~~~~~~~~~
/usr/include/absl/time/civil_time.h:489:6: note: ‘bool absl::lts_20230125::ParseCivilTime’ previously defined here
489 | bool ParseCivilTime(absl::string_view s, CivilSecond* c);
| ^~~~~~~~~~~~~~
/usr/include/absl/time/civil_time.h:493:27: error: ‘string_view’ is not a member of ‘absl’
493 | bool ParseCivilTime(absl::string_view s, CivilMonth* c);
| ^~~~~~~~~~~
/usr/include/absl/time/civil_time.h:493:52: error: expected primary-expression before ‘*’ token
493 | bool ParseCivilTime(absl::string_view s, CivilMonth* c);
| ^
/usr/include/absl/time/civil_time.h:493:54: error: ‘c’ was not declared in this scope
493 | bool ParseCivilTime(absl::string_view s, CivilMonth* c);
| ^
/usr/include/absl/time/civil_time.h:494:6: error: redefinition of ‘bool absl::lts_20230125::ParseCivilTime’
494 | bool ParseCivilTime(absl::string_view s, CivilYear* c);
| ^~~~~~~~~~~~~~
/usr/include/absl/time/civil_time.h:489:6: note: ‘bool absl::lts_20230125::ParseCivilTime’ previously defined here
489 | bool ParseCivilTime(absl::string_view s, CivilSecond* c);
| ^~~~~~~~~~~~~~
/usr/include/absl/time/civil_time.h:494:27: error: ‘string_view’ is not a member of ‘absl’
494 | bool ParseCivilTime(absl::string_view s, CivilYear* c);
| ^~~~~~~~~~~
/usr/include/absl/time/civil_time.h:494:51: error: expected primary-expression before ‘*’ token
494 | bool ParseCivilTime(absl::string_view s, CivilYear* c);
| ^
/usr/include/absl/time/civil_time.h:494:53: error: ‘c’ was not declared in this scope
494 | bool ParseCivilTime(absl::string_view s, CivilYear* c);
| ^
/usr/include/absl/time/civil_time.h:509:34: error: ‘string_view’ is not a member of ‘absl’
509 | bool ParseLenientCivilTime(absl::string_view s, CivilSecond* c);
| ^~~~~~~~~~~
/usr/include/absl/time/civil_time.h:509:60: error: expected primary-expression before ‘*’ token
509 | bool ParseLenientCivilTime(absl::string_view s, CivilSecond* c);
| ^
/usr/include/absl/time/civil_time.h:509:62: error: ‘c’ was not declared in this scope
509 | bool ParseLenientCivilTime(absl::string_view s, CivilSecond* c);
| ^
/usr/include/absl/time/civil_time.h:509:63: error: expression list treated as compound expression in initializer [-fpermissive]
509 | bool ParseLenientCivilTime(absl::string_view s, CivilSecond* c);
| ^
/usr/include/absl/time/civil_time.h:510:6: error: redefinition of ‘bool absl::lts_20230125::ParseLenientCivilTime’
510 | bool ParseLenientCivilTime(absl::string_view s, CivilMinute* c);
| ^~~~~~~~~~~~~~~~~~~~~
/usr/include/absl/time/civil_time.h:509:6: note: ‘bool absl::lts_20230125::ParseLenientCivilTime’ previously defined here
509 | bool ParseLenientCivilTime(absl::string_view s, CivilSecond* c);
| ^~~~~~~~~~~~~~~~~~~~~
/usr/include/absl/time/civil_time.h:510:34: error: ‘string_view’ is not a member of ‘absl’
510 | bool ParseLenientCivilTime(absl::string_view s, CivilMinute* c);
| ^~~~~~~~~~~
/usr/include/absl/time/civil_time.h:510:60: error: expected primary-expression before ‘*’ token
510 | bool ParseLenientCivilTime(absl::string_view s, CivilMinute* c);
| ^
/usr/include/absl/time/civil_time.h:510:62: error: ‘c’ was not declared in this scope
510 | bool ParseLenientCivilTime(absl::string_view s, CivilMinute* c);
| ^
/usr/include/absl/time/civil_time.h:511:6: error: redefinition of ‘bool absl::lts_20230125::ParseLenientCivilTime’
511 | bool ParseLenientCivilTime(absl::string_view s, CivilHour* c);
| ^~~~~~~~~~~~~~~~~~~~~
/usr/include/absl/time/civil_time.h:509:6: note: ‘bool absl::lts_20230125::ParseLenientCivilTime’ previously defined here
509 | bool ParseLenientCivilTime(absl::string_view s, CivilSecond* c);
| ^~~~~~~~~~~~~~~~~~~~~
/usr/include/absl/time/civil_time.h:511:34: error: ‘string_view’ is not a member of ‘absl’
511 | bool ParseLenientCivilTime(absl::string_view s, CivilHour* c);
| ^~~~~~~~~~~
/usr/include/absl/time/civil_time.h:511:58: error: expected primary-expression before ‘*’ token
511 | bool ParseLenientCivilTime(absl::string_view s, CivilHour* c);
| ^
/usr/include/absl/time/civil_time.h:511:60: error: ‘c’ was not declared in this scope
511 | bool ParseLenientCivilTime(absl::string_view s, CivilHour* c);
| ^
/usr/include/absl/time/civil_time.h:512:6: error: redefinition of ‘bool absl::lts_20230125::ParseLenientCivilTime’
512 | bool ParseLenientCivilTime(absl::string_view s, CivilDay* c);
| ^~~~~~~~~~~~~~~~~~~~~
/usr/include/absl/time/civil_time.h:509:6: note: ‘bool absl::lts_20230125::ParseLenientCivilTime’ previously defined here
509 | bool ParseLenientCivilTime(absl::string_view s, CivilSecond* c);
| ^~~~~~~~~~~~~~~~~~~~~
/usr/include/absl/time/civil_time.h:512:34: error: ‘string_view’ is not a member of ‘absl’
512 | bool ParseLenientCivilTime(absl::string_view s, CivilDay* c);
| ^~~~~~~~~~~
/usr/include/absl/time/civil_time.h:512:57: error: expected primary-expression before ‘*’ token
512 | bool ParseLenientCivilTime(absl::string_view s, CivilDay* c);
| ^
/usr/include/absl/time/civil_time.h:512:59: error: ‘c’ was not declared in this scope
512 | bool ParseLenientCivilTime(absl::string_view s, CivilDay* c);
| ^
/usr/include/absl/time/civil_time.h:513:6: error: redefinition of ‘bool absl::lts_20230125::ParseLenientCivilTime’
513 | bool ParseLenientCivilTime(absl::string_view s, CivilMonth* c);
| ^~~~~~~~~~~~~~~~~~~~~
/usr/include/absl/time/civil_time.h:509:6: note: ‘bool absl::lts_20230125::ParseLenientCivilTime’ previously defined here
509 | bool ParseLenientCivilTime(absl::string_view s, CivilSecond* c);
| ^~~~~~~~~~~~~~~~~~~~~
/usr/include/absl/time/civil_time.h:513:34: error: ‘string_view’ is not a member of ‘absl’
513 | bool ParseLenientCivilTime(absl::string_view s, CivilMonth* c);
| ^~~~~~~~~~~
/usr/include/absl/time/civil_time.h:513:59: error: expected primary-expression before ‘*’ token
513 | bool ParseLenientCivilTime(absl::string_view s, CivilMonth* c);
| ^
/usr/include/absl/time/civil_time.h:513:61: error: ‘c’ was not declared in this scope
513 | bool ParseLenientCivilTime(absl::string_view s, CivilMonth* c);
| ^
/usr/include/absl/time/civil_time.h:514:6: error: redefinition of ‘bool absl::lts_20230125::ParseLenientCivilTime’
514 | bool ParseLenientCivilTime(absl::string_view s, CivilYear* c);
| ^~~~~~~~~~~~~~~~~~~~~
/usr/include/absl/time/civil_time.h:509:6: note: ‘bool absl::lts_20230125::ParseLenientCivilTime’ previously defined here
509 | bool ParseLenientCivilTime(absl::string_view s, CivilSecond* c);
| ^~~~~~~~~~~~~~~~~~~~~
/usr/include/absl/time/civil_time.h:514:34: error: ‘string_view’ is not a member of ‘absl’
514 | bool ParseLenientCivilTime(absl::string_view s, CivilYear* c);
| ^~~~~~~~~~~
/usr/include/absl/time/civil_time.h:514:58: error: expected primary-expression before ‘*’ token
514 | bool ParseLenientCivilTime(absl::string_view s, CivilYear* c);
| ^
/usr/include/absl/time/civil_time.h:514:60: error: ‘c’ was not declared in this scope
514 | bool ParseLenientCivilTime(absl::string_view s, CivilYear* c);
| ^
/usr/include/absl/time/civil_time.h:540:26: error: ‘string_view’ is not a member of ‘absl’
540 | bool AbslParseFlag(absl::string_view s, CivilSecond* c, std::string* error);
| ^~~~~~~~~~~
/usr/include/absl/time/civil_time.h:540:52: error: expected primary-expression before ‘*’ token
540 | bool AbslParseFlag(absl::string_view s, CivilSecond* c, std::string* error);
| ^
/usr/include/absl/time/civil_time.h:540:54: error: ‘c’ was not declared in this scope
540 | bool AbslParseFlag(absl::string_view s, CivilSecond* c, std::string* error);
| ^
/usr/include/absl/time/civil_time.h:540:68: error: expected primary-expression before ‘*’ token
540 | bool AbslParseFlag(absl::string_view s, CivilSecond* c, std::string* error);
| ^
/usr/include/absl/time/civil_time.h:540:70: error: ‘error’ was not declared in this scope; did you mean ‘perror’?
540 | bool AbslParseFlag(absl::string_view s, CivilSecond* c, std::string* error);
| ^~~~~
| perror
/usr/include/absl/time/civil_time.h:540:75: error: expression list treated as compound expression in initializer [-fpermissive]
540 | bool AbslParseFlag(absl::string_view s, CivilSecond* c, std::string* error);
| ^
/usr/include/absl/time/civil_time.h:541:6: error: redefinition of ‘bool absl::lts_20230125::time_internal::AbslParseFlag’
541 | bool AbslParseFlag(absl::string_view s, CivilMinute* c, std::string* error);
| ^~~~~~~~~~~~~
/usr/include/absl/time/civil_time.h:540:6: note: ‘bool absl::lts_20230125::time_internal::AbslParseFlag’ previously defined here
540 | bool AbslParseFlag(absl::string_view s, CivilSecond* c, std::string* error);
| ^~~~~~~~~~~~~
/usr/include/absl/time/civil_time.h:541:26: error: ‘string_view’ is not a member of ‘absl’
541 | bool AbslParseFlag(absl::string_view s, CivilMinute* c, std::string* error);
| ^~~~~~~~~~~
/usr/include/absl/time/civil_time.h:541:52: error: expected primary-expression before ‘*’ token
541 | bool AbslParseFlag(absl::string_view s, CivilMinute* c, std::string* error);
| ^
/usr/include/absl/time/civil_time.h:541:54: error: ‘c’ was not declared in this scope
541 | bool AbslParseFlag(absl::string_view s, CivilMinute* c, std::string* error);
| ^
/usr/include/absl/time/civil_time.h:541:68: error: expected primary-expression before ‘*’ token
541 | bool AbslParseFlag(absl::string_view s, CivilMinute* c, std::string* error);
| ^
/usr/include/absl/time/civil_time.h:541:70: error: ‘error’ was not declared in this scope; did you mean ‘perror’?
541 | bool AbslParseFlag(absl::string_view s, CivilMinute* c, std::string* error);
| ^~~~~
| perror
/usr/include/absl/time/civil_time.h:542:6: error: redefinition of ‘bool absl::lts_20230125::time_internal::AbslParseFlag’
542 | bool AbslParseFlag(absl::string_view s, CivilHour* c, std::string* error);
| ^~~~~~~~~~~~~
/usr/include/absl/time/civil_time.h:540:6: note: ‘bool absl::lts_20230125::time_internal::AbslParseFlag’ previously defined here
540 | bool AbslParseFlag(absl::string_view s, CivilSecond* c, std::string* error);
| ^~~~~~~~~~~~~
/usr/include/absl/time/civil_time.h:542:26: error: ‘string_view’ is not a member of ‘absl’
542 | bool AbslParseFlag(absl::string_view s, CivilHour* c, std::string* error);
| ^~~~~~~~~~~
/usr/include/absl/time/civil_time.h:542:50: error: expected primary-expression before ‘*’ token
542 | bool AbslParseFlag(absl::string_view s, CivilHour* c, std::string* error);
| ^
/usr/include/absl/time/civil_time.h:542:52: error: ‘c’ was not declared in this scope
542 | bool AbslParseFlag(absl::string_view s, CivilHour* c, std::string* error);
| ^
/usr/include/absl/time/civil_time.h:542:66: error: expected primary-expression before ‘*’ token
542 | bool AbslParseFlag(absl::string_view s, CivilHour* c, std::string* error);
| ^
/usr/include/absl/time/civil_time.h:542:68: error: ‘error’ was not declared in this scope; did you mean ‘perror’?
542 | bool AbslParseFlag(absl::string_view s, CivilHour* c, std::string* error);
| ^~~~~
| perror
/usr/include/absl/time/civil_time.h:543:6: error: redefinition of ‘bool absl::lts_20230125::time_internal::AbslParseFlag’
543 | bool AbslParseFlag(absl::string_view s, CivilDay* c, std::string* error);
| ^~~~~~~~~~~~~
/usr/include/absl/time/civil_time.h:540:6: note: ‘bool absl::lts_20230125::time_internal::AbslParseFlag’ previously defined here
540 | bool AbslParseFlag(absl::string_view s, CivilSecond* c, std::string* error);
| ^~~~~~~~~~~~~
/usr/include/absl/time/civil_time.h:543:26: error: ‘string_view’ is not a member of ‘absl’
543 | bool AbslParseFlag(absl::string_view s, CivilDay* c, std::string* error);
| ^~~~~~~~~~~
/usr/include/absl/time/civil_time.h:543:49: error: expected primary-expression before ‘*’ token
543 | bool AbslParseFlag(absl::string_view s, CivilDay* c, std::string* error);
| ^
/usr/include/absl/time/civil_time.h:543:51: error: ‘c’ was not declared in this scope
543 | bool AbslParseFlag(absl::string_view s, CivilDay* c, std::string* error);
| ^
/usr/include/absl/time/civil_time.h:543:65: error: expected primary-expression before ‘*’ token
543 | bool AbslParseFlag(absl::string_view s, CivilDay* c, std::string* error);
| ^
/usr/include/absl/time/civil_time.h:543:67: error: ‘error’ was not declared in this scope; did you mean ‘perror’?
543 | bool AbslParseFlag(absl::string_view s, CivilDay* c, std::string* error);
| ^~~~~
| perror
/usr/include/absl/time/civil_time.h:544:6: error: redefinition of ‘bool absl::lts_20230125::time_internal::AbslParseFlag’
544 | bool AbslParseFlag(absl::string_view s, CivilMonth* c, std::string* error);
| ^~~~~~~~~~~~~
/usr/include/absl/time/civil_time.h:540:6: note: ‘bool absl::lts_20230125::time_internal::AbslParseFlag’ previously defined here
540 | bool AbslParseFlag(absl::string_view s, CivilSecond* c, std::string* error);
| ^~~~~~~~~~~~~
/usr/include/absl/time/civil_time.h:544:26: error: ‘string_view’ is not a member of ‘absl’
544 | bool AbslParseFlag(absl::string_view s, CivilMonth* c, std::string* error);
| ^~~~~~~~~~~
/usr/include/absl/time/civil_time.h:544:51: error: expected primary-expression before ‘*’ token
544 | bool AbslParseFlag(absl::string_view s, CivilMonth* c, std::string* error);
| ^
/usr/include/absl/time/civil_time.h:544:53: error: ‘c’ was not declared in this scope
544 | bool AbslParseFlag(absl::string_view s, CivilMonth* c, std::string* error);
| ^
/usr/include/absl/time/civil_time.h:544:67: error: expected primary-expression before ‘*’ token
544 | bool AbslParseFlag(absl::string_view s, CivilMonth* c, std::string* error);
| ^
/usr/include/absl/time/civil_time.h:544:69: error: ‘error’ was not declared in this scope; did you mean ‘perror’?
544 | bool AbslParseFlag(absl::string_view s, CivilMonth* c, std::string* error);
| ^~~~~
| perror
/usr/include/absl/time/civil_time.h:545:6: error: redefinition of ‘bool absl::lts_20230125::time_internal::AbslParseFlag’
545 | bool AbslParseFlag(absl::string_view s, CivilYear* c, std::string* error);
| ^~~~~~~~~~~~~
/usr/include/absl/time/civil_time.h:540:6: note: ‘bool absl::lts_20230125::time_internal::AbslParseFlag’ previously defined here
540 | bool AbslParseFlag(absl::string_view s, CivilSecond* c, std::string* error);
| ^~~~~~~~~~~~~
/usr/include/absl/time/civil_time.h:545:26: error: ‘string_view’ is not a member of ‘absl’
545 | bool AbslParseFlag(absl::string_view s, CivilYear* c, std::string* error);
| ^~~~~~~~~~~
/usr/include/absl/time/civil_time.h:545:50: error: expected primary-expression before ‘*’ token
545 | bool AbslParseFlag(absl::string_view s, CivilYear* c, std::string* error);
| ^
/usr/include/absl/time/civil_time.h:545:52: error: ‘c’ was not declared in this scope
545 | bool AbslParseFlag(absl::string_view s, CivilYear* c, std::string* error);
| ^
/usr/include/absl/time/civil_time.h:545:66: error: expected primary-expression before ‘*’ token
545 | bool AbslParseFlag(absl::string_view s, CivilYear* c, std::string* error);
| ^
/usr/include/absl/time/civil_time.h:545:68: error: ‘error’ was not declared in this scope; did you mean ‘perror’?
545 | bool AbslParseFlag(absl::string_view s, CivilYear* c, std::string* error);
| ^~~~~
| perror
/usr/include/absl/time/time.h:619:26: error: ‘string_view’ is not a member of ‘absl’
619 | bool ParseDuration(absl::string_view dur_string, Duration* d);
| ^~~~~~~~~~~
/usr/include/absl/time/time.h:619:58: error: expected primary-expression before ‘*’ token
619 | bool ParseDuration(absl::string_view dur_string, Duration* d);
| ^
/usr/include/absl/time/time.h:619:60: error: ‘d’ was not declared in this scope
619 | bool ParseDuration(absl::string_view dur_string, Duration* d);
| ^
/usr/include/absl/time/time.h:619:61: error: expression list treated as compound expression in initializer [-fpermissive]
619 | bool ParseDuration(absl::string_view dur_string, Duration* d);
| ^
/usr/include/absl/time/time.h:626:26: error: ‘string_view’ is not a member of ‘absl’
626 | bool AbslParseFlag(absl::string_view text, Duration* dst, std::string* error);
| ^~~~~~~~~~~
/usr/include/absl/time/time.h:626:52: error: expected primary-expression before ‘*’ token
626 | bool AbslParseFlag(absl::string_view text, Duration* dst, std::string* error);
| ^
/usr/include/absl/time/time.h:626:54: error: ‘dst’ was not declared in this scope
626 | bool AbslParseFlag(absl::string_view text, Duration* dst, std::string* error);
| ^~~
/usr/include/absl/time/time.h:626:70: error: expected primary-expression before ‘*’ token
626 | bool AbslParseFlag(absl::string_view text, Duration* dst, std::string* error);
| ^
/usr/include/absl/time/time.h:626:72: error: ‘error’ was not declared in this scope; did you mean ‘perror’?
626 | bool AbslParseFlag(absl::string_view text, Duration* dst, std::string* error);
| ^~~~~
| perror
/usr/include/absl/time/time.h:626:77: error: expression list treated as compound expression in initializer [-fpermissive]
626 | bool AbslParseFlag(absl::string_view text, Duration* dst, std::string* error);
| ^
/usr/include/absl/time/time.h:934:6: error: redefinition of ‘bool absl::lts_20230125::AbslParseFlag’
934 | bool AbslParseFlag(absl::string_view text, Time* t, std::string* error);
| ^~~~~~~~~~~~~
/usr/include/absl/time/time.h:626:6: note: ‘bool absl::lts_20230125::AbslParseFlag’ previously defined here
626 | bool AbslParseFlag(absl::string_view text, Duration* dst, std::string* error);
| ^~~~~~~~~~~~~
/usr/include/absl/time/time.h:934:26: error: ‘string_view’ is not a member of ‘absl’
934 | bool AbslParseFlag(absl::string_view text, Time* t, std::string* error);
| ^~~~~~~~~~~
/usr/include/absl/time/time.h:934:48: error: expected primary-expression before ‘*’ token
934 | bool AbslParseFlag(absl::string_view text, Time* t, std::string* error);
| ^
/usr/include/absl/time/time.h:934:50: error: ‘t’ was not declared in this scope; did you mean ‘tm’?
934 | bool AbslParseFlag(absl::string_view text, Time* t, std::string* error);
| ^
| tm
/usr/include/absl/time/time.h:934:64: error: expected primary-expression before ‘*’ token
934 | bool AbslParseFlag(absl::string_view text, Time* t, std::string* error);
| ^
/usr/include/absl/time/time.h:934:66: error: ‘error’ was not declared in this scope; did you mean ‘perror’?
934 | bool AbslParseFlag(absl::string_view text, Time* t, std::string* error);
| ^~~~~
| perror
/usr/include/absl/time/time.h:1138:32: error: ‘string_view’ is not a member of ‘absl’
1138 | inline bool LoadTimeZone(absl::string_view name, TimeZone* tz) {
| ^~~~~~~~~~~
/usr/include/absl/time/time.h:1138:58: error: expected primary-expression before ‘*’ token
1138 | inline bool LoadTimeZone(absl::string_view name, TimeZone* tz) {
| ^
/usr/include/absl/time/time.h:1138:60: error: ‘tz’ was not declared in this scope; did you mean ‘tm’?
1138 | inline bool LoadTimeZone(absl::string_view name, TimeZone* tz) {
| ^~
| tm
/usr/include/absl/time/time.h:1138:62: error: expression list treated as compound expression in initializer [-fpermissive]
1138 | inline bool LoadTimeZone(absl::string_view name, TimeZone* tz) {
| ^
/usr/include/absl/time/time.h:1375:59: error: ‘string_view’ is not a member of ‘absl’
1375 | ABSL_ATTRIBUTE_PURE_FUNCTION std::string FormatTime(absl::string_view format,
| ^~~~~~~~~~~
/usr/include/absl/time/time.h:1376:58: error: expected primary-expression before ‘t’
1376 | Time t, TimeZone tz);
| ^
/usr/include/absl/time/time.h:1376:70: error: expected primary-expression before ‘tz’
1376 | Time t, TimeZone tz);
| ^~
/usr/include/absl/time/time.h:1381:72: error: ‘std::string absl::lts_20230125::FormatTime(Time, TimeZone)’ redeclared as different kind of entity
1381 | ABSL_ATTRIBUTE_PURE_FUNCTION std::string FormatTime(Time t, TimeZone tz);
| ^
/usr/include/absl/time/time.h:1375:42: note: previous declaration ‘std::string absl::lts_20230125::FormatTime’
1375 | ABSL_ATTRIBUTE_PURE_FUNCTION std::string FormatTime(absl::string_view format,
| ^~~~~~~~~~
/usr/include/absl/time/time.h:1382:59: error: ‘std::string absl::lts_20230125::FormatTime(Time)’ redeclared as different kind of entity
1382 | ABSL_ATTRIBUTE_PURE_FUNCTION std::string FormatTime(Time t);
| ^
/usr/include/absl/time/time.h:1375:42: note: previous declaration ‘std::string absl::lts_20230125::FormatTime’
1375 | ABSL_ATTRIBUTE_PURE_FUNCTION std::string FormatTime(absl::string_view format,
| ^~~~~~~~~~
/usr/include/absl/time/time.h: In function ‘std::ostream& absl::lts_20230125::operator<<(std::ostream&, Time)’:
/usr/include/absl/time/time.h:1386:26: error: no match for call to ‘(std::string {aka std::__cxx11::basic_string<char>}) (absl::lts_20230125::Time&)’
1386 | return os << FormatTime(t);
| ~~~~~~~~~~^~~
/usr/include/absl/time/time.h: At global scope:
/usr/include/absl/time/time.h:1438:22: error: ‘string_view’ is not a member of ‘absl’
1438 | bool ParseTime(absl::string_view format, absl::string_view input, Time* time,
| ^~~~~~~~~~~
/usr/include/absl/time/time.h:1438:48: error: ‘string_view’ is not a member of ‘absl’
1438 | bool ParseTime(absl::string_view format, absl::string_view input, Time* time,
| ^~~~~~~~~~~
/usr/include/absl/time/time.h:1438:71: error: expected primary-expression before ‘*’ token
1438 | bool ParseTime(absl::string_view format, absl::string_view input, Time* time,
| ^
/usr/include/absl/time/time.h:1439:27: error: expected primary-expression before ‘*’ token
1439 | std::string* err);
| ^
/usr/include/absl/time/time.h:1439:29: error: ‘err’ was not declared in this scope; did you mean ‘erf’?
1439 | std::string* err);
| ^~~
| erf
/usr/include/absl/time/time.h:1439:32: error: expression list treated as compound expression in initializer [-fpermissive]
1439 | std::string* err);
| ^
/usr/include/absl/time/time.h:1448:6: error: redefinition of ‘bool absl::lts_20230125::ParseTime’
1448 | bool ParseTime(absl::string_view format, absl::string_view input, TimeZone tz,
| ^~~~~~~~~
/usr/include/absl/time/time.h:1438:6: note: ‘bool absl::lts_20230125::ParseTime’ previously defined here
1438 | bool ParseTime(absl::string_view format, absl::string_view input, Time* time,
| ^~~~~~~~~
/usr/include/absl/time/time.h:1448:22: error: ‘string_view’ is not a member of ‘absl’
1448 | bool ParseTime(absl::string_view format, absl::string_view input, TimeZone tz,
| ^~~~~~~~~~~
/usr/include/absl/time/time.h:1448:48: error: ‘string_view’ is not a member of ‘absl’
1448 | bool ParseTime(absl::string_view format, absl::string_view input, TimeZone tz,
| ^~~~~~~~~~~
/usr/include/absl/time/time.h:1448:76: error: expected primary-expression before ‘tz’
1448 | bool ParseTime(absl::string_view format, absl::string_view input, TimeZone tz,
| ^~
/usr/include/absl/time/time.h:1449:20: error: expected primary-expression before ‘*’ token
1449 | Time* time, std::string* err);
| ^
/usr/include/absl/time/time.h:1449:39: error: expected primary-expression before ‘*’ token
1449 | Time* time, std::string* err);
| ^
/usr/include/absl/time/time.h:1449:41: error: ‘err’ was not declared in this scope; did you mean ‘erf’?
1449 | Time* time, std::string* err);
| ^~~
| erf
In file included from /usr/include/absl/types/span.h:69,
from /usr/include/absl/log/log_entry.h:36:
/usr/include/absl/types/internal/span.h:119:26: error: ‘remove_const_t’ in namespace ‘std’ does not name a template type; did you mean ‘remove_const’?
119 | using Container = std::remove_const_t<T>;
| ^~~~~~~~~~~~~~
| remove_const
/usr/include/absl/types/internal/span.h:121:44: error: parse error in template argument list
121 | decltype(span_internal::GetData(std::declval<const Container&>()));
| ^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/absl/types/internal/span.h:122:64: error: ‘Container’ was not declared in this scope
122 | using MutData = decltype(span_internal::GetData(std::declval<Container&>()));
| ^~~~~~~~~
/usr/include/absl/types/internal/span.h:122:56: error: parse error in template argument list
122 | using MutData = decltype(span_internal::GetData(std::declval<Container&>()));
| ^~~~~~~~~~~~~~~~~~~
/usr/include/absl/types/internal/span.h:130:29: error: ‘enable_if_t’ in namespace ‘std’ does not name a template type
130 | using EnableIfIsView = std::enable_if_t<IsView<T>::value, int>;
| ^~~~~~~~~~~
/usr/include/absl/types/internal/span.h:130:24: note: ‘std::enable_if_t’ is only available from C++14 onwards
130 | using EnableIfIsView = std::enable_if_t<IsView<T>::value, int>;
| ^~~
/usr/include/absl/types/internal/span.h:133:32: error: ‘enable_if_t’ in namespace ‘std’ does not name a template type
133 | using EnableIfNotIsView = std::enable_if_t<!IsView<T>::value, int>;
| ^~~~~~~~~~~
/usr/include/absl/types/internal/span.h:133:27: note: ‘std::enable_if_t’ is only available from C++14 onwards
133 | using EnableIfNotIsView = std::enable_if_t<!IsView<T>::value, int>;
| ^~~
/usr/include/absl/types/span.h:201:39: error: ‘EnableIfNotIsView’ in namespace ‘absl::lts_20230125::span_internal’ does not name a template type
201 | typename = span_internal::EnableIfNotIsView<V>>
| ^~~~~~~~~~~~~~~~~
/usr/include/absl/types/span.h:201:56: error: expected ‘>’ before ‘<’ token
201 | typename = span_internal::EnableIfNotIsView<V>>
| ^
/usr/include/absl/types/span.h:210:39: error: ‘EnableIfNotIsView’ in namespace ‘absl::lts_20230125::span_internal’ does not name a template type
210 | typename = span_internal::EnableIfNotIsView<V>>
| ^~~~~~~~~~~~~~~~~
/usr/include/absl/types/span.h:210:56: error: expected ‘>’ before ‘<’ token
210 | typename = span_internal::EnableIfNotIsView<V>>
| ^
/usr/include/absl/types/span.h:222:28: error: ‘absl::lts_20230125::span_internal::EnableIfIsView’ has not been declared
222 | span_internal::EnableIfIsView<V> = 0>
| ^~~~~~~~~~~~~~
/usr/include/absl/types/span.h:222:42: error: expected ‘>’ before ‘<’ token
222 | span_internal::EnableIfIsView<V> = 0>
| ^
/usr/include/absl/types/span.h:223:12: error: ‘template<class T> template<class V, class, class, <typeprefixerror><anonymous> > absl::lts_20230125::Span<T>::Span(V&)’ cannot be overloaded with ‘template<class T> template<class V, class, class, class> absl::lts_20230125::Span<T>::Span(V&)’
223 | explicit Span(V& v) noexcept // NOLINT(runtime/references)
| ^~~~
/usr/include/absl/types/span.h:202:12: note: previous declaration ‘template<class T> template<class V, class, class, class> absl::lts_20230125::Span<T>::Span(V&)’
202 | explicit Span(
| ^~~~
/usr/include/absl/types/span.h:227:28: error: ‘absl::lts_20230125::span_internal::EnableIfIsView’ has not been declared
227 | span_internal::EnableIfIsView<V> = 0>
| ^~~~~~~~~~~~~~
/usr/include/absl/types/span.h:227:42: error: expected ‘>’ before ‘<’ token
227 | span_internal::EnableIfIsView<V> = 0>
| ^
/usr/include/absl/types/span.h:228:13: error: ‘template<class T> template<class V, class, class, <typeprefixerror><anonymous> > constexpr absl::lts_20230125::Span<T>::Span(const V&)’ cannot be overloaded with ‘template<class T> template<class V, class, class, class> constexpr absl::lts_20230125::Span<T>::Span(const V&)’
228 | constexpr Span(const V& v) noexcept // NOLINT(runtime/explicit)
| ^~~~
/usr/include/absl/types/span.h:211:13: note: previous declaration ‘template<class T> template<class V, class, class, class> constexpr absl::lts_20230125::Span<T>::Span(const V&)’
211 | constexpr Span(
| ^~~~
/usr/include/absl/log/log_entry.h:75:9: error: ‘string_view’ in namespace ‘absl’ does not name a type
75 | absl::string_view source_filename() const ABSL_ATTRIBUTE_LIFETIME_BOUND {
| ^~~~~~~~~~~
/usr/include/absl/log/log_entry.h:78:9: error: ‘string_view’ in namespace ‘absl’ does not name a type
78 | absl::string_view source_basename() const ABSL_ATTRIBUTE_LIFETIME_BOUND {
| ^~~~~~~~~~~
/usr/include/absl/log/log_entry.h:144:9: error: ‘string_view’ in namespace ‘absl’ does not name a type
144 | absl::string_view text_message_with_prefix_and_newline() const
| ^~~~~~~~~~~
/usr/include/absl/log/log_entry.h:150:9: error: ‘string_view’ in namespace ‘absl’ does not name a type
150 | absl::string_view text_message_with_prefix() const
| ^~~~~~~~~~~
/usr/include/absl/log/log_entry.h:156:9: error: ‘string_view’ in namespace ‘absl’ does not name a type
156 | absl::string_view text_message_with_newline() const
| ^~~~~~~~~~~
/usr/include/absl/log/log_entry.h:162:9: error: ‘string_view’ in namespace ‘absl’ does not name a type
162 | absl::string_view text_message() const ABSL_ATTRIBUTE_LIFETIME_BOUND {
| ^~~~~~~~~~~
/usr/include/absl/log/log_entry.h:177:9: error: ‘string_view’ in namespace ‘absl’ does not name a type
177 | absl::string_view encoded_message() const ABSL_ATTRIBUTE_LIFETIME_BOUND {
| ^~~~~~~~~~~
/usr/include/absl/log/log_entry.h:193:9: error: ‘string_view’ in namespace ‘absl’ does not name a type
193 | absl::string_view stacktrace() const ABSL_ATTRIBUTE_LIFETIME_BOUND {
| ^~~~~~~~~~~
/usr/include/absl/log/log_entry.h:200:9: error: ‘string_view’ in namespace ‘absl’ does not name a type
200 | absl::string_view full_filename_;
| ^~~~~~~~~~~
/usr/include/absl/log/log_entry.h:201:9: error: ‘string_view’ in namespace ‘absl’ does not name a type
201 | absl::string_view base_filename_;
| ^~~~~~~~~~~
/usr/include/absl/log/log_entry.h:210:9: error: ‘string_view’ in namespace ‘absl’ does not name a type
210 | absl::string_view encoding_;
| ^~~~~~~~~~~
In file included from /usr/include/absl/log/internal/log_message.h:43:
/usr/include/absl/strings/internal/has_absl_stringify.h:35:15: error: ‘string_view’ has not been declared
35 | void Append(string_view v);
| ^~~~~~~~~~~
/usr/include/absl/strings/internal/has_absl_stringify.h:38:62: error: ‘absl::string_view’ has not been declared
38 | friend void AbslFormatFlush(UnimplementedSink* sink, absl::string_view v);
| ^~~~~~~~~~~
/usr/include/absl/strings/internal/has_absl_stringify.h:46:13: error: ‘enable_if_t’ is not a member of ‘std’
46 | T, std::enable_if_t<std::is_void<decltype(AbslStringify(
| ^~~~~~~~~~~
/usr/include/absl/strings/internal/has_absl_stringify.h:46:13: note: ‘std::enable_if_t’ is only available from C++14 onwards
/usr/include/absl/strings/internal/has_absl_stringify.h:46:13: error: ‘enable_if_t’ is not a member of ‘std’
/usr/include/absl/strings/internal/has_absl_stringify.h:46:13: note: ‘std::enable_if_t’ is only available from C++14 onwards
/usr/include/absl/strings/internal/has_absl_stringify.h:48:41: error: type/value mismatch at argument 2 in template parameter list for ‘template<class T, class> struct absl::lts_20230125::strings_internal::HasAbslStringify’
48 | std::declval<const T&>()))>::value>> : std::true_type {};
| ^~~~~
/usr/include/absl/strings/internal/has_absl_stringify.h:48:41: note: expected a type, got ‘(<expression error> < std::is_void<decltype (AbslStringify(std::declval<absl::lts_20230125::strings_internal::UnimplementedSink&>(), declval<const T&>()))>::value)’
/usr/include/absl/strings/internal/has_absl_stringify.h:48:46: error: expected unqualified-id before ‘>’ token
48 | std::declval<const T&>()))>::value>> : std::true_type {};
| ^~
/usr/include/absl/log/internal/log_message.h:63:32: error: ‘absl::string_view’ has not been declared
63 | LogMessage& AtLocation(absl::string_view file, int line);
| ^~~~~~~~~~~
/usr/include/absl/log/internal/log_message.h:134:32: error: ‘absl::string_view’ has not been declared
134 | LogMessage& operator<<(absl::string_view v);
| ^~~~~~~~~~~
/usr/include/absl/log/internal/log_message.h:134:15: error: ‘absl::lts_20230125::log_internal::LogMessage& absl::lts_20230125::log_internal::LogMessage::operator<<(int)’ cannot be overloaded with ‘absl::lts_20230125::log_internal::LogMessage& absl::lts_20230125::log_internal::LogMessage::operator<<(int)’
134 | LogMessage& operator<<(absl::string_view v);
| ^~~~~~~~
/usr/include/absl/log/internal/log_message.h:106:15: note: previous declaration ‘absl::lts_20230125::log_internal::LogMessage& absl::lts_20230125::log_internal::LogMessage::operator<<(int)’
106 | LogMessage& operator<<(signed int v) { return operator<< <signed int>(v); }
| ^~~~~~~~
/usr/include/absl/log/internal/log_message.h:222:34: error: ‘absl::string_view’ has not been declared
222 | void CopyToEncodedBuffer(absl::string_view str,
| ^~~~~~~~~~~
/usr/include/absl/log/internal/log_message.h:259:21: error: ‘absl::string_view’ has not been declared
259 | void Append(absl::string_view v) {
| ^~~~~~~~~~~
/usr/include/absl/log/internal/log_message.h:264:58: error: ‘absl::string_view’ has not been declared
264 | friend void AbslFormatFlush(StringifySink* sink, absl::string_view v) {
| ^~~~~~~~~~~
/usr/include/absl/log/internal/log_message.h:336:25: error: ‘absl::string_view’ has not been declared
336 | absl::string_view failure_msg) ABSL_ATTRIBUTE_COLD;
| ^~~~~~~~~~~
/usr/include/absl/log/internal/log_message.h:344:32: error: ‘absl::string_view’ has not been declared
344 | absl::string_view failure_msg) ABSL_ATTRIBUTE_COLD;
| ^~~~~~~~~~~
/usr/include/absl/log/internal/check_op.h:310:1: error: ‘string_view’ in namespace ‘absl’ does not name a type
310 | ABSL_LOG_INTERNAL_DEFINE_MAKE_CHECK_OP_STRING_EXTERN(const absl::string_view&);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/absl/log/internal/check_op.h:310:1: error: ‘string_view’ in namespace ‘absl’ does not name a type
310 | ABSL_LOG_INTERNAL_DEFINE_MAKE_CHECK_OP_STRING_EXTERN(const absl::string_view&);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/absl/container/internal/compressed_tuple.h:40,
from /usr/include/absl/container/internal/inlined_vector.h:30,
from /usr/include/absl/container/inlined_vector.h:53,
from /usr/include/absl/strings/cord.h:78,
from /usr/include/google/protobuf/io/coded_stream.h:134:
/usr/include/absl/utility/utility.h:164:12: error: ‘in_place_t’ has not been declared in ‘std’
164 | using std::in_place_t;
| ^~~~~~~~~~
/usr/include/absl/utility/utility.h:165:12: error: ‘in_place’ has not been declared in ‘std’
165 | using std::in_place;
| ^~~~~~~~
/usr/include/absl/utility/utility.h:181:12: error: ‘in_place_type’ has not been declared in ‘std’
181 | using std::in_place_type;
| ^~~~~~~~~~~~~
/usr/include/absl/utility/utility.h:182:12: error: ‘in_place_type_t’ has not been declared in ‘std’
182 | using std::in_place_type_t;
| ^~~~~~~~~~~~~~~
/usr/include/absl/utility/utility.h:198:12: error: ‘in_place_index’ has not been declared in ‘std’
198 | using std::in_place_index;
| ^~~~~~~~~~~~~~
/usr/include/absl/utility/utility.h:199:12: error: ‘in_place_index_t’ has not been declared in ‘std’
199 | using std::in_place_index_t;
| ^~~~~~~~~~~~~~~~
/usr/include/absl/container/internal/compressed_tuple.h:107:46: error: expected ‘)’ before ‘,’ token
107 | explicit constexpr Storage(absl::in_place_t, V&& v)
| ~ ^
| )
/usr/include/absl/container/internal/compressed_tuple.h:120:46: error: expected ‘)’ before ‘,’ token
120 | explicit constexpr Storage(absl::in_place_t, V&& v)
| ~ ^
| )
/usr/include/absl/container/internal/compressed_tuple.h:143:58: error: expected ‘)’ before ‘,’ token
143 | explicit constexpr CompressedTupleImpl(absl::in_place_t, Vs&&... args)
| ~ ^
| )
/usr/include/absl/container/internal/compressed_tuple.h:155:58: error: expected ‘)’ before ‘,’ token
155 | explicit constexpr CompressedTupleImpl(absl::in_place_t, Vs&&... args)
| ~ ^
| )
/usr/include/absl/container/internal/compressed_tuple.h: In constructor ‘constexpr absl::lts_20230125::container_internal::CompressedTuple<Ts>::CompressedTuple(const Ts& ...)’:
/usr/include/absl/container/internal/compressed_tuple.h:242:52: error: ‘in_place’ is not a member of ‘absl’
242 | : CompressedTuple::CompressedTupleImpl(absl::in_place, base...) {}
| ^~~~~~~~
/usr/include/absl/container/internal/compressed_tuple.h: In constructor ‘constexpr absl::lts_20230125::container_internal::CompressedTuple<Ts>::CompressedTuple(First&&, Vs&& ...)’:
/usr/include/absl/container/internal/compressed_tuple.h:254:52: error: ‘in_place’ is not a member of ‘absl’
254 | : CompressedTuple::CompressedTupleImpl(absl::in_place,
| ^~~~~~~~
In file included from /usr/include/absl/container/internal/inlined_vector.h:31:
/usr/include/absl/memory/memory.h: At global scope:
/usr/include/absl/memory/memory.h:97:12: error: ‘make_unique’ has not been declared in ‘std’
97 | using std::make_unique;
| ^~~~~~~~~~~
In file included from /usr/include/absl/crc/internal/crc_cord_state.h:23,
from /usr/include/absl/strings/cord.h:79:
/usr/include/absl/crc/crc32c.h:72:37: error: ‘absl::string_view’ has not been declared
72 | absl::string_view buf_to_add);
| ^~~~~~~~~~~
[..]
In other words looks likke protobuf 23.0 is not ready to be used.
Gentle ping .. any update?
I was able to rebuild protobuf-c usimg 22.5 however still on rebuilding libphonenumber, mysql, opencv are failing on missing symbols.
@coryan do you have a moment to take a look at this?
Happy to do a drive-by. It would be useful to know what platform (Linux, Windows, etc.) this was on, and what version of the compiler. Looks like some Linux distro, with GCC.
utf8_range
Is utf8_range
a hard dependency? If it is, then the install instructions should say so. Consider adding step-by-step instructions to build all the dependencies from source in https://github.com/protocolbuffers/protobuf/blob/main/src/README.md
If it is not a hard dependency, then this:
Needs to have a conditional:
if (some_variable_enabled_when_utf8_is_required)
list(APPEND _pc_targets "utf8_range")
endif ()
libphonenumber
This error:
/usr/bin/ld: /tmp/ccOihmdo.lto.o: in function `google::protobuf::RepeatedField<int>::GrowNoAnnotate(int, int)':
/usr/include/google/protobuf/thread_safe_arena.h:198: undefined reference to `google::protobuf::internal::ThreadSafeArena::thread_cache_'
was fixed in #12700. I think @fowles already backported that fix to the 22.x and 23.x branches.
mysql
This error
/usr/bin/ld: /usr/lib64/libprotoc.so: undefined reference to symbol '_ZN4absl12lts_2023012513base_internal12SpinLockWaitEPSt6atomicIjEiPKNS1_22SpinLockWaitTransitionENS1_14SchedulingModeE'
/usr/bin/ld: /usr/lib64/libabsl_spinlock_wait.so.2301.0.0: error adding symbols: DSO missing from command line
Seems like a missing -labsl*
. Most likely mysql
is using find_package(protobuf)
, using the FindProtobuf
embedded with CMake and missing all the new deps. That is indeed the case:
That needs to change to find_package(protobuf CONFIG)
. See #12292. It is becoming a FAQ, the Protobuf team should consider updating the release notes.
opencv
I think in this case the error explains itself:
79 | #error "C++ versions less than C++14 are not supported."
The opencv library was configured (or maybe defaults to) compile as C++11:
[ 21%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/opencv-caffe.pb.cc.o
cd /home/tkloczko/rpmbuild/BUILD/opencv-4.7.0/x86_64-redhat-linux-gnu/modules/dnn && /usr/bin/g++ \
... stuff omitted for clarity ...
-DNDEBUG \
-std=c++11 \
-fPIC -Wno-suggest-override -Wno-array-bounds -MD -MT modules/dnn/CMakeFiles/opencv_dnn.dir/opencv-caffe.pb.cc.o -MF CMakeFiles/opencv_dnn.dir/opencv-caffe.pb.cc.o.d -o CMakeFiles/opencv_dnn.dir/opencv-caffe.pb.cc.o -c /home/tkloczko/rpmbuild/BUILD/opencv-4.7.0/x86_64-redhat-linux-gnu/modules/dnn/opencv-caffe.pb.cc
I am not familiar with the configuration options for opencv. It may be necessary to use cmake -DCMAKE_CXX_STANDARD=14 ...
, or maybe just omit the -DCMAKE_CXX_STANDARD=14
altogether. Most compilers default to C++14 or higher these days. There are very few cases where one needs to explicitly request C++11.
In summary:
utf8_range
is not a hard-dependency.opencv
may need some tweaks.HTH
Happy to do a drive-by. It would be useful to know what platform (Linux, Windows, etc.) this was on, and what version of the compiler. Looks like some Linux distro, with GCC.
The dependency on
utf8_range
Is
utf8_range
a hard dependency? If it is, then the install instructions should say so. Consider adding step-by-step instructions to build all the dependencies from source in https://github.com/protocolbuffers/protobuf/blob/main/src/README.mdIf it is not a hard dependency, then this:
Needs to have a conditional:
if (some_variable_enabled_when_utf8_is_required) list(APPEND _pc_targets "utf8_range") endif ()
I dont see any fix for that in 22.x branch https://github.com/protocolbuffers/protobuf/compare/v22.5...22.x
The broken build for
libphonenumber
This error:
/usr/bin/ld: /tmp/ccOihmdo.lto.o: in function `google::protobuf::RepeatedField<int>::GrowNoAnnotate(int, int)': /usr/include/google/protobuf/thread_safe_arena.h:198: undefined reference to `google::protobuf::internal::ThreadSafeArena::thread_cache_'
was fixed in #12700. I think @fowles already backported that fix to the 22.x and 23.x branches.
None of the commits from https://github.com/protocolbuffers/protobuf/pull/12700 are on the list https://github.com/protocolbuffers/protobuf/compare/v22.5...22.x
The broken build for
mysql
This error
/usr/bin/ld: /usr/lib64/libprotoc.so: undefined reference to symbol '_ZN4absl12lts_2023012513base_internal12SpinLockWaitEPSt6atomicIjEiPKNS1_22SpinLockWaitTransitionENS1_14SchedulingModeE' /usr/bin/ld: /usr/lib64/libabsl_spinlock_wait.so.2301.0.0: error adding symbols: DSO missing from command line
Seems like a missing
-labsl*
. Most likelymysql
is usingfind_package(protobuf)
, using theFindProtobuf
embedded with CMake and missing all the new deps. That is indeed the case:That needs to change to
find_package(protobuf CONFIG)
. See #12292. It is becoming a FAQ, the Protobuf team should consider updating the release notes.
mysql is not using absl API and error message shows missing symbol in libprotoc -> it points on libprotoc underlinking with some of the absl DSOs.
[tkloczko@pers-jacek SPECS]$ objdump -x /usr/lib64/libprotoc.so | grep NEED
NEEDED libprotobuf.so.22.5.0
NEEDED libabsl_log_internal_check_op.so.2301.0.0
NEEDED libabsl_log_internal_message.so.2301.0.0
NEEDED libabsl_log_internal_nullguard.so.2301.0.0
NEEDED libabsl_hash.so.2301.0.0
NEEDED libabsl_raw_hash_set.so.2301.0.0
NEEDED libabsl_str_format_internal.so.2301.0.0
NEEDED libabsl_synchronization.so.2301.0.0
NEEDED libabsl_strings.so.2301.0.0
NEEDED libabsl_throw_delegate.so.2301.0.0
NEEDED libabsl_spinlock_wait.so.2301.0.0
NEEDED libstdc++.so.6
NEEDED libgcc_s.so.1
NEEDED libc.so.6
VERNEED 0x0000000000014270
VERNEEDNUM 0x0000000000000003
In summary:
- Looks like the version of Protobuf you are using is missing some fixes already in the release branches.
As I've wrote I've tested that with 23.0.
- Maybe there is a bug in the CMake files if
utf8_range
is not a hard-dependency.- I think there are multiple opportunities to improve the Protobuf documentation around building and installation.
- mysql needs some patches to use Protobuf >= 22.0.
I disagree. It compiles and linking fails because missing symbols.
Happy to do a drive-by. It would be useful to know what platform (Linux, Windows, etc.) this was on, and what version of the compiler. Looks like some Linux distro, with GCC.
The dependency on
utf8_range
Is
utf8_range
a hard dependency? If it is, then the install instructions should say so. Consider adding step-by-step instructions to build all the dependencies from source in https://github.com/protocolbuffers/protobuf/blob/main/src/README.md If it is not a hard dependency, then this: https://github.com/protocolbuffers/protobuf/blob/56d1b0f3f5e0170ea336a754af0bb3ae7b6d4bfa/cmake/install.cmake#L7I dont see any fix for that in 22.x branch v22.5...22.x
Yes. I said "if it is not a hard dependency". But I looked at the code again and it is. That means this:
I've added quick hack to remove utf8_range from Requires on rpm package %install stage.
Was probably not a good idea.
was fixed in #12700. I think @fowles already backported that fix to the 22.x and 23.x branches.
None of the commits from #12700 are on the list v22.5...22.x
I am not sure why that matters since you are testing with 23.0. FWIW, the relevant commit in the 22.x series is https://github.com/protocolbuffers/protobuf/commit/18fae1c15112efad2080c2b2f726d904fea48b35 and it is there:
https://github.com/protocolbuffers/protobuf/compare/v22.4...22.x
The relevant commit in the 23.x series is https://github.com/protocolbuffers/protobuf/commit/1ca4e9c4859a23112684138c78608ddc0b8f1770
mysql is not using absl API and error message shows missing symbol in libprotoc -> it points on libprotoc underlinking with some of the absl DSOs.
I am not sure I follow. That is intentional. libprotoc.so
depends on the Abseil symbols. Some of the abseil symbols are part of the public API of libprotoc. It is not expected that -lprotoc
by itself will be enough. If it did (for example by linking all the absl* libraries into the .so
), I think applications that used Abseil and libprotoc at the same time would quickly run into ODR violations.
In summary:
- Looks like the version of Protobuf you are using is missing some fixes already in the release branches.
As I've wrote I've tested that with 23.0.
Thanks that is useful. Could you also share the specific Linux distro and the steps you are using to compile Protobuf? It would make it easier to repro any bugs locally.
- mysql needs some patches to use Protobuf >= 22.0.
I disagree. It compiles and linking fails because missing symbols.
I think you are expecting that linking with just -lprotoc
should work. It does not and it is not expected to. The Protobuf team has fixed the pkg-config modules and the CMake config files to add any new -l
flags. That should make it easier to migrate build scripts to add the flags where needed.
Build scripts written for Protobuf <= 21.x must be updated to take into account the new dependencies. If a build script (like mysql's) relies on CMake's FindProtobuf
module it needs to be updated. That is because FindProtobuf
does not know about the new dependencies.
mysql uses that module and that is why the build is missing -l
flags.
I also do not think the Protobuf team should (or could) fix the FindProtobuf
module. First, because they cannot go back in time and fix the version of that module that already shipped everywhere. Second, because CMake's team plan of record is to migrate to the config files that Protobuf already generates and installs.
I appreciate this is maybe surprising and/or frustrating. But I am not sure what actions are you suggesting.
I am not sure why that matters since you are testing with 23.0. FWIW, the relevant commit in the 22.x series is https://github.com/protocolbuffers/protobuf/commit/18fae1c15112efad2080c2b2f726d904fea48b35 and it is there:
Nope I'm now on 22.5 because with that version I was able to compile everythiong and have now only linking issues.
Trying to figure out why libprotobuf DSO does not provdes `google::protobuf::internal::ThreadSafeArena::threadcache' I found another "intersting: thing. Despite
[tkloczko@pers-jacek x86_64-redhat-linux-gnu]$ cmake -L
CMake Warning:
No source or binary directory provided. Both will be assumed to be the
same as the current working directory, but note that this warning will
become a fatal error in future CMake releases.
CMake Error: The source directory "/home/tkloczko/rpmbuild/BUILD/protobuf-22.5/x86_64-redhat-linux-gnu" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
-- Cache values
CMAKE_BUILD_TYPE:STRING=RelWithDebInfo
CMAKE_INSTALL_PREFIX:PATH=/usr
GTest_DIR:PATH=/usr/lib64/cmake/GTest
absl_DIR:PATH=/usr/lib64/cmake/absl
protobuf_ABSL_PROVIDER:STRING=package
protobuf_ALLOW_CCACHE:BOOL=OFF
protobuf_BUILD_CONFORMANCE:BOOL=OFF
protobuf_BUILD_EXAMPLES:BOOL=OFF
protobuf_BUILD_LIBPROTOC:BOOL=OFF
protobuf_BUILD_PROTOBUF_BINARIES:BOOL=ON
protobuf_BUILD_PROTOC_BINARIES:BOOL=ON
protobuf_BUILD_SHARED_LIBS:BOOL=ON
protobuf_BUILD_TESTS:BOOL=ON
protobuf_DISABLE_RTTI:BOOL=OFF
protobuf_INSTALL:BOOL=ON
protobuf_INSTALL_EXAMPLES:BOOL=OFF
protobuf_REMOVE_INSTALLED_HEADERS:BOOL=OFF
protobuf_TEST_XML_OUTDIR:BOOL=OFF
protobuf_USE_EXTERNAL_GTEST:BOOL=ON
protobuf_WITH_ZLIB:BOOL=ON
utf8_range_ENABLE_INSTALL:BOOL=OFF
utf8_range_ENABLE_TESTS:BOOL=OFF
in which is possible to see protobuf_BUILD_LIBPROTOC:BOOL=OFF
libprotoc DSO is build, linked and installed.
I am not sure why that matters since you are testing with 23.0. FWIW, the relevant commit in the 22.x series is 18fae1c and it is there:
Nope I'm now on 22.5 because with that version I was able to compile everythiong and have now only linking issues.
BTW looks like 18fae1c1 is already included in 22.5.
According to https://github.com/protocolbuffers/protobuf/blob/17a2d53176bc5c3bc3be8c636f999ca7a645cc68/cmake/README.md?plain=1#L296-L314
PROTOBUF_USE_DLLS
define should be used only on Win.
Going to try to roll back 18fae1c1.
PROTOBUF_USE_DLLS
define should be used only on Win.
I think the documentation is very much out of date and I filed a bug requesting fixes (see #12787).
Going to try to roll back 18fae1c.
If you compile the library with PROTOBUF_USE_DLLS defined and use it with that undefined you will have an inconsistent definition for this class:
And that macro is defined when CMake creates shared libraries. Both on Windows and other platforms:
That is what causes the undefined google::protobuf::internal::ThreadSafeArena::thread_cache_
symbol.
Are you sure you are using the correct .pc
file when building the downstream dependency? Or if you are not using .pc
files and you are using CMake: is the downstream build using the protobuf config (as opposed to the FindProtobuf
module)?
Are you sure you are using the correct .pc file when building the downstream dependency? Or if you are not using .pc files and you are using CMake: is the downstream build using the protobuf config (as opposed to the FindProtobuf module)?
Yes I'm sure.
Generated .pc files have that -DPROTOBUF_USE_DLLS
(I've done that without checking possible impact of that kind of change).
Of course reverte 18fae1c caused that it was not possible to build protobuf baceuse other sybols in that case where missing.
Nevertheless looks liks like something is wrong around use that define in some headers.
Or if you are not using .pc files and you are using CMake: is the downstream build using the protobuf config (as opposed to the FindProtobuf module)?
opencv, libphonenumber and Oracle mysql 8.x are usimg pkgconfig so what is in cmake module is not relevant in those cases.
Gentle ping .. any update? 🤔
I'm having trouble figuring out where this issue is at. Did you add back the dependency on utf8_range? That is a required (private) dependency, and you'll definitely break the build by stripping it out
Did you add back the dependency on utf8_range?
Yes. On packaging after installation in DESTDIR I'm usimg sed to remove " utf8_range" from .pc files.
That is a required (private) dependency, and you'll definitely break the build by stripping it out
Af far as I've been looking utf8_range
it used out of third_party/utf8_range/ and as I wrote I'm building protobuf with -D utf8_range_ENABLE_INSTALL=OFF
and despite that utf8_range
is added in .pc files Requires:
Yea that's the problem. We require utf8_range, and if you set utf8_range_ENABLE_INSTALL=OFF
we won't have it available. You need to install it and keep the dependency in the .pc files. We may collapse upb and utf8_range into the protobuf
repo in a future release, but for 22.x and 23.x you need both
Yea that's the problem. We require utf8_range, and if you set utf8_range_ENABLE_INSTALL=OFF we won't have it available.
It does't matter. Whatever is used as bundled library should not be listed in .pc files.
it's not used as a bundled library today. It needs to be installed and linked for protobuf to work.
At least the mysql issue is caused by mysql using find_package(protobuf)
. CMake's FindProtobuf
is broken for 22.x and up, and find_package(protobuf CONFIG)
needs to be used. Related to that, mysql also seems to be using all of our vendored logging code that's been replaced by Abseil.
I have no installed utf8_range
and just tested 23.1 it still has in .pc files listed utf8_range
in Requires.
Yes, because we do require utf8_range
. We ship it as a git sub-tree, and install it during protobuf installation. If you explicitly disable this installation you'll break our library
Yes, because we do require
utf8_range
. We ship it as a git sub-tree, and install it during protobuf installation. If you explicitly disable this installation you'll break our library
Just started plaing with 23.1 and:
utf8_range
[ 81%] Linking CXX executable libphonenumber_test
/usr/bin/cmake -E cmake_link_script CMakeFiles/libphonenumber_test.dir/link.txt --verbose=1
/usr/bin/g++ -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 -flto=auto -flto-partition=none -DNDEBUG -Wl,--gc-sections -Wl,--as-needed -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,--build-id=sha1 CMakeFiles/libphonenumber_test.dir/test/phonenumbers/asyoutypeformatter_test.cc.o CMakeFiles/libphonenumber_test.dir/test/phonenumbers/logger_test.cc.o CMakeFiles/libphonenumber_test.dir/test/phonenumbers/matcher_test.cc.o CMakeFiles/libphonenumber_test.dir/test/phonenumbers/phonenumberutil_test.cc.o CMakeFiles/libphonenumber_test.dir/test/phonenumbers/regexp_adapter_test.cc.o CMakeFiles/libphonenumber_test.dir/test/phonenumbers/regexp_cache_test.cc.o CMakeFiles/libphonenumber_test.dir/test/phonenumbers/run_tests.cc.o CMakeFiles/libphonenumber_test.dir/test/phonenumbers/shortnumberinfo_test.cc.o CMakeFiles/libphonenumber_test.dir/test/phonenumbers/stringutil_test.cc.o CMakeFiles/libphonenumber_test.dir/test/phonenumbers/test_util.cc.o CMakeFiles/libphonenumber_test.dir/test/phonenumbers/unicodestring_test.cc.o CMakeFiles/libphonenumber_test.dir/test/phonenumbers/utf/unicodetext_test.cc.o CMakeFiles/libphonenumber_test.dir/test/phonenumbers/geocoding/area_code_map_test.cc.o CMakeFiles/libphonenumber_test.dir/test/phonenumbers/geocoding/geocoding_data_test.cc.o CMakeFiles/libphonenumber_test.dir/test/phonenumbers/geocoding/geocoding_test_data.cc.o CMakeFiles/libphonenumber_test.dir/test/phonenumbers/geocoding/mapping_file_provider_test.cc.o CMakeFiles/libphonenumber_test.dir/test/phonenumbers/geocoding/phonenumber_offline_geocoder_test.cc.o CMakeFiles/libphonenumber_test.dir/test/phonenumbers/phonenumbermatch_test.cc.o CMakeFiles/libphonenumber_test.dir/test/phonenumbers/phonenumbermatcher_test.cc.o -o libphonenumber_test libphonenumber_testing.a /usr/lib64/libgtest.so -lpthread /usr/lib64/libicuuc.so /usr/lib64/libicui18n.so /usr/lib64/libprotobuf.so /usr/lib64/libabsl_cord.so.2301.0.0 /usr/lib64/libabsl_cordz_info.so.2301.0.0 /usr/lib64/libabsl_cord_internal.so.2301.0.0 /usr/lib64/libabsl_cordz_functions.so.2301.0.0 /usr/lib64/libabsl_cordz_handle.so.2301.0.0 /usr/lib64/libabsl_crc_cord_state.so.2301.0.0 /usr/lib64/libabsl_crc32c.so.2301.0.0 /usr/lib64/libabsl_crc_internal.so.2301.0.0 /usr/lib64/libabsl_crc_cpu_detect.so.2301.0.0 /usr/lib64/libabsl_hash.so.2301.0.0 /usr/lib64/libabsl_city.so.2301.0.0 /usr/lib64/libabsl_bad_variant_access.so.2301.0.0 /usr/lib64/libabsl_low_level_hash.so.2301.0.0 /usr/lib64/libabsl_raw_hash_set.so.2301.0.0 /usr/lib64/libabsl_hashtablez_sampler.so.2301.0.0 /usr/lib64/libabsl_exponential_biased.so.2301.0.0 /usr/lib64/libabsl_bad_optional_access.so.2301.0.0 /usr/lib64/libabsl_synchronization.so.2301.0.0 /usr/lib64/libabsl_graphcycles_internal.so.2301.0.0 /usr/lib64/libabsl_stacktrace.so.2301.0.0 /usr/lib64/libabsl_symbolize.so.2301.0.0 /usr/lib64/libabsl_malloc_internal.so.2301.0.0 /usr/lib64/libabsl_debugging_internal.so.2301.0.0 /usr/lib64/libabsl_demangle_internal.so.2301.0.0 /usr/lib64/libabsl_time.so.2301.0.0 /usr/lib64/libabsl_strings.so.2301.0.0 /usr/lib64/libabsl_strings_internal.so.2301.0.0 /usr/lib64/libabsl_throw_delegate.so.2301.0.0 /usr/lib64/libabsl_base.so.2301.0.0 /usr/lib64/libabsl_spinlock_wait.so.2301.0.0 /usr/lib64/libabsl_int128.so.2301.0.0 /usr/lib64/libabsl_raw_logging_internal.so.2301.0.0 /usr/lib64/libabsl_log_severity.so.2301.0.0 /usr/lib64/libabsl_civil_time.so.2301.0.0 /usr/lib64/libabsl_time_zone.so.2301.0.0 /usr/lib64/libboost_date_time.so /usr/lib64/libboost_system.so -lboost_thread /usr/lib64/libboost_chrono.so /usr/lib64/libboost_atomic.so
/usr/bin/ld: /tmp/ccAR3AjZ.lto.o: in function `google::protobuf::RepeatedField<int>::GrowNoAnnotate(int, int)':
/usr/include/google/protobuf/thread_safe_arena.h:198: undefined reference to `google::protobuf::internal::ThreadSafeArena::thread_cache_'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/libphonenumber_test.dir/build.make:442: libphonenumber_test] Error 1
make[2]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/libphonenumber-8.13.11/x86_64-redhat-linux-gnu'
make[1]: *** [CMakeFiles/Makefile2:359: CMakeFiles/libphonenumber_test.dir/all] Error 2
make[1]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/libphonenumber-8.13.11/x86_64-redhat-linux-gnu'
That missing smbol has nothing to do with utf8_range
.
Did you try to build latest Oracle mysql, opencv and libpronenumber with installes 23.1? In all three cases build fails on that missing symbol.
And again: as I'm building protobuf with bundled utf8_range why this library appears on pkgconfig dependencies list if none of the protobuf installed header files are usong anything from utf8_range
?
Other thing is question about using absl. mysql and libpronenumber are using boost (but only header files without libking with any boost DSOs) and libstdc++ classes. opencv is using only libstdc++. Additionally absl has very fragmented ABI which consist out of MANY DSOs which makes LTO inefficient and adds more wasted memory on jump tables between DSOs symbols.
Is it really necessary tu use it? 🤔
Yes, absl is definitely required for protobuf. We use it for a variety of important internal optimizations and in 23.x we add support for bytes
fields with type absl::Cord
, which is very important for zero copy handling of large blobs.
Yes, absl is definitely required for protobuf. We use it for a variety of important internal optimizations and in 23.x we add support for
bytes
fields with typeabsl::Cord
, which is very important for zero copy handling of large blobs.
If you say so ..
So what about taht missing symbol?
[tkloczko@pers-jacek protobuf-23.1]$ grep -r thread_cache_
src/google/protobuf/arena.cc: static internal::ThreadLocalStorage<ThreadCache>* thread_cache_ =
src/google/protobuf/arena.cc: return *thread_cache_->Get();
src/google/protobuf/arena.cc: ThreadSafeArena::ThreadCache ThreadSafeArena::thread_cache_;
src/google/protobuf/thread_safe_arena.h: PROTOBUF_CONSTINIT static PROTOBUF_THREAD_LOCAL ThreadCache thread_cache_;
src/google/protobuf/thread_safe_arena.h: static ThreadCache& thread_cache() { return thread_cache_; }
As you see that class is not part of the utf8_range
.
I don't think the original problem has anything to do with utf8_range
, it was just some of the subsequent ones you saw when you tried to remove the dependency. I think Carlos nailed the root problem a while back:
PROTOBUF_USE_DLLS
define should be used only on Win.I think the documentation is very much out of date and I filed a bug requesting fixes (see #12787).
Going to try to roll back 18fae1c.
If you compile the library with PROTOBUF_USE_DLLS defined and use it with that undefined you will have an inconsistent definition for this class:
And that macro is defined when CMake creates shared libraries. Both on Windows and other platforms:
That is what causes the undefined
google::protobuf::internal::ThreadSafeArena::thread_cache_
symbol.Are you sure you are using the correct
.pc
file when building the downstream dependency? Or if you are not using.pc
files and you are using CMake: is the downstream build using the protobuf config (as opposed to theFindProtobuf
module)?
He confirmed that at least mysql is using FindProtobuf
, meaning that they'd have an inconsistent value of PROTOBUF_USE_DLLS
and it would cause issues with this symbol
That is usually caused by some configuration error with support for thread local
are likely related. What platform are you on?
If you compile the library with PROTOBUF_USE_DLLS defined and use it with that undefined you will have an inconsistent definition for this class:
Here cmake parames which I have in my protobuf.spec
%build
%cmake \
-D CMAKE_PREFIX_PATH=%{_prefix} \
-D protobuf_ABSL_PROVIDER=ON \
-D protobuf_ABSL_PROVIDER=package \
-D protobuf_BUILD_TESTS=ON \
-D protobuf_USE_EXTERNAL_GTEST=ON \
-D utf8_range_ENABLE_INSTALL=OFF \
%{nil}
protobuf copiles and links with statis libutf8_validity.a which is not installed.
He confirmed that at least mysql is using
FindProtobuf
, meaning that they'd have an inconsistent value ofPROTOBUF_USE_DLLS
and it would cause issues with this symbol
Negative ..
[tkloczko@pers-jacek mysql-8.0.33]$ grep -r FindProtobuf
cmake/protobuf.cmake: # Set the same variables as FindProtobuf.cmake (First reset all)
extra/protobuf/protobuf-3.19.4/cmake/protobuf-config.cmake.in:# CMake FindProtobuf module compatible file
extra/protobuf/protobuf-3.19.4/cmake/protobuf-options.cmake:# FindProtobuf module compatible
extra/protobuf/protobuf-3.19.4/cmake/protobuf-options.cmake:option(protobuf_MODULE_COMPATIBLE "CMake built-in FindProtobuf.cmake module compatible" OFF)
In libphonenumber
[tkloczko@pers-jacek libphonenumber-8.13.11]$ grep -r FindProtobuf
[tkloczko@pers-jacek libphonenumber-8.13.11]$
and opencv
[tkloczko@pers-jacek opencv-4.7.0]$ grep -r FindProtobuf
CMakeLists.txt:include(cmake/OpenCVFindProtobuf.cmake)
That is usually caused by some configuration error with support for thread local
protobuf cmake output:
+ cd protobuf-23.1
+ ASMFLAGS='-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 -flto=auto -flto-partition=none'
+ CFLAGS='-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 -flto=auto -flto-partition=none'
+ CXXFLAGS='-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 -flto=auto -flto-partition=none'
+ FFLAGS='-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 -flto=auto -flto-partition=none -I/usr/lib64/gfortran/modules'
+ FCFLAGS='-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 -flto=auto -flto-partition=none -I/usr/lib64/gfortran/modules'
+ LDFLAGS='-Wl,--gc-sections -Wl,--as-needed -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,--build-id=sha1'
+ RUSTFLAGS='-C codegen-units=1 -C debuginfo=2 -C opt-level=2 -C link-arg=-fdata-sections -C link-arg=-ffunction-sections -C link-arg=-Wl,--as-needed -C link-arg=-Wl,-z,now -C link-arg=-Wl,-z,relro --cap-lints=warn'
+ VALAFLAGS=-g
+ CC=/usr/bin/gcc
+ CXX=/usr/bin/g++
+ FC=/usr/bin/gfortran
+ AR=/usr/bin/gcc-ar
+ NM=/usr/bin/gcc-nm
+ RANLIB=/usr/bin/gcc-ranlib
+ export ASMFLAGS CFLAGS CXXFLAGS FFLAGS FCFLAGS LDFLAGS VALAFLAGS CC CXX FC AR NM RANLIB RUSTFLAGS VALAFLAGS
+ /usr/bin/cmake -B x86_64-redhat-linux-gnu -D BUILD_SHARED_LIBS=ON -D CMAKE_AR=/usr/bin/gcc-ar -D CMAKE_BUILD_TYPE=RelWithDebInfo -D CMAKE_C_FLAGS_RELEASE=-DNDEBUG -D CMAKE_CXX_FLAGS_RELEASE=-DNDEBUG -D CMAKE_Fortran_FLAGS_RELEASE=-DNDEBUG -D CMAKE_INSTALL_PREFIX=/usr -D CMAKE_NM=/usr/bin/gcc-nm -D CMAKE_RANLIB=/usr/bin/gcc-ranlib -D CMAKE_VERBOSE_MAKEFILE=ON -D INCLUDE_INSTALL_DIR=/usr/include -D LIB_INSTALL_DIR=/usr/lib64 -D LIB_SUFFIX=64 -D SHARE_INSTALL_PREFIX=/usr/share -D SYSCONF_INSTALL_DIR=/etc -S . -D CMAKE_PREFIX_PATH=/usr -D protobuf_ABSL_PROVIDER=ON -D protobuf_ABSL_PROVIDER=package -D protobuf_BUILD_TESTS=ON -D protobuf_USE_EXTERNAL_GTEST=ON -D utf8_range_ENABLE_INSTALL=OFF
-- The C compiler identification is GNU 13.1.1
-- The CXX compiler identification is GNU 13.1.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
--
-- 23.1.0
-- Performing Test protobuf_HAVE_LD_VERSION_SCRIPT
-- Performing Test protobuf_HAVE_LD_VERSION_SCRIPT - Success
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
-- Performing Test protobuf_HAVE_BUILTIN_ATOMICS
-- Performing Test protobuf_HAVE_BUILTIN_ATOMICS - Success
-- Configuring done (1.7s)
-- Generating done (0.1s)
CMake Warning:
Manually-specified variables were not used by the project:
CMAKE_Fortran_FLAGS_RELEASE
INCLUDE_INSTALL_DIR
LIB_INSTALL_DIR
LIB_SUFFIX
SHARE_INSTALL_PREFIX
SYSCONF_INSTALL_DIR
-- Build files have been written to: /home/tkloczko/rpmbuild/BUILD/protobuf-23.1/x86_64-redhat-linux-gnu
That grep won't turn up FindPackage uses. The key point is that FIND_PACKAGE(Protobuf)
falls back to the FindPackage
implementation shipped with cmake, which is broken. What you want is FIND_PACKAGE(Protobuf CONFIG)
[tkloczko@pers-jacek BUILD]$ grep -ri 'FIND_PACKAGE(Protobuf)' opencv-4.7.0 mysql-8.0.33 libphonenumber-8.13.11
opencv-4.7.0/cmake/OpenCVFindProtobuf.cmake:# BUILD_PROTOBUF=OFF: Custom manual protobuf configuration (see find_package(Protobuf) for details):
opencv-4.7.0/opencv_contrib-4.7.0/modules/cnn_3dobj/CMakeLists.txt: find_package(Protobuf)
mysql-8.0.33/cmake/protobuf.cmake: FIND_PACKAGE(Protobuf)
mysql-8.0.33/extra/protobuf/protobuf-3.19.4/cmake/examples.cmake:# sub_directory cannot be used because the find_package(protobuf) call would cause failures with redefined targets.
BTW:
[tkloczko@pers-jacek protobuf]$ grep -r ifdef -h /usr/include/google/protobuf | sort | uniq
#ifdef LIBPROTOBUF_EXPORTS
#ifdef LIBPROTOC_EXPORTS
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
#ifdef PROTOBUF_FORCE_COPY_IN_MOVE
#ifdef PROTOBUF_FORCE_COPY_IN_SWAP
# ifdef __SANITIZE_ADDRESS__
# ifdef __SANITIZE_THREAD__
#ifdef ADDRESS_SANITIZER
#ifdef DEPRECATED_METHODS_TO_BE_DELETED
#ifdef GOOGLE_PROTOBUF_INTERNAL_DONATE_STEAL_INLINE
#ifdef GOOGLE_PROTOBUF_UTF8_VALIDATION_ENABLED
#ifdef NDEBUG
#ifdef PACKAGE
#ifdef PROTOBUF_ALIGNAS
#ifdef PROTOBUF_ALWAYS_INLINE
#ifdef PROTOBUF_ALWAYS_INLINE_CALL
#ifdef PROTOBUF_ASAN
#ifdef PROTOBUF_ASSUME
#ifdef PROTOBUF_ATTRIBUTE_INIT_PRIORITY1
#ifdef PROTOBUF_ATTRIBUTE_INIT_PRIORITY2
#ifdef PROTOBUF_ATTRIBUTE_NO_DESTROY
#ifdef PROTOBUF_ATTRIBUTE_REINITIALIZES
#ifdef PROTOBUF_ATTRIBUTE_STANDALONE_DEBUG
#ifdef PROTOBUF_ATTRIBUTE_WEAK
#ifdef PROTOBUF_BIG_ENDIAN
#ifdef PROTOBUF_BUILTIN_BSWAP16
#ifdef PROTOBUF_BUILTIN_BSWAP32
#ifdef PROTOBUF_BUILTIN_BSWAP64
#ifdef PROTOBUF_COLD
#ifdef PROTOBUF_CONSTINIT
#ifdef PROTOBUF_DID_UNDEF_LINUX
#ifdef PROTOBUF_DID_UNDEF_PACKAGE
#ifdef PROTOBUF_EXCLUSIVE_LOCKS_REQUIRED
#ifdef PROTOBUF_EXPORT
#ifdef PROTOBUF_FALLTHROUGH_INTENDED
#ifdef PROTOBUF_FIELD_OFFSET
#ifdef PROTOBUF_FINAL
#ifdef PROTOBUF_FORCE_ALLOCATION_ON_CONSTRUCTION
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
#ifdef PROTOBUF_FORCE_COPY_IN_MOVE
#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
#ifdef PROTOBUF_FORCE_COPY_IN_SWAP
#ifdef PROTOBUF_FORCE_RESET_IN_CLEAR
#ifdef PROTOBUF_FUTURE_BREAKING_CHANGES
#ifdef PROTOBUF_FUZZ_MESSAGE_SPACE_USED_LONG
#ifdef PROTOBUF_GUARDED_BY
#ifdef PROTOBUF_LITTLE_ENDIAN
#ifdef PROTOBUF_LOCKS_EXCLUDED
#ifdef PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC
#ifdef PROTOBUF_MIN_PROTOC_VERSION
#ifdef PROTOBUF_MSAN
#ifdef PROTOBUF_MUSTTAIL
#ifdef PROTOBUF_NDEBUG_INLINE
#ifdef PROTOBUF_NODISCARD
#ifdef PROTOBUF_NOINLINE
#ifdef PROTOBUF_NO_THREADLOCAL
#ifdef PROTOBUF_NO_THREAD_SAFETY_ANALYSIS
#ifdef PROTOBUF_PRAGMA_INIT_SEG
#ifdef PROTOBUF_RESTRICT
#ifdef PROTOBUF_RETURNS_NONNULL
#ifdef PROTOBUF_RTTI
#ifdef PROTOBUF_SECTION_VARIABLE
#ifdef PROTOBUF_STABLE_EXPERIMENTS
#ifdef PROTOBUF_TAILCALL
#ifdef PROTOBUF_THREAD_LOCAL
#ifdef PROTOBUF_TSAN
#ifdef PROTOBUF_UNUSED
#ifdef PROTOBUF_USE_TABLE_PARSER_ON_REFLECTION
#ifdef PROTOBUF_VERSION
#ifdef PROTOBUF_VERSION_SUFFIX
#ifdef PROTOBUF_has_attribute_DEFINED_
#ifdef PROTOBUF_has_builtin_DEFINED_
#ifdef PROTOBUF_has_cpp_attribute_DEFINED_
#ifdef PROTOBUF_has_feature_DEFINED_
#ifdef PROTOBUF_has_warning_DEFINED_
#ifdef PROTOC_EXPORT
#ifdef SWIG
#ifdef _MSC_VER
#ifdef _WIN32
#ifdef _XBOX_ONE
#ifdef __APPLE__
#ifdef __GNUC__
#ifdef __aarch64__
#ifdef __clang__
#ifdef __cpp_aligned_new
#ifdef __cpp_if_constexpr
#ifdef linux
#ifdef major
#ifdef minor
// '#ifdef LANG_CXX11' to behave differently from '#if LANG_CXX11'.
// GCC, and MSVC. Function-like macros are usable without an #ifdef guard.
// use #ifdef the select the best implementation based on hardware / OS.
In first look most of those defines are used only on protobuf build time and whould not be used in public API definition.
Note: because you set BUILD_SHARED_LIBS=ON
, I believe our cmake config will then enable protobuf_BUILD_SHARED_LIBS
and PROTOBUF_USE_DLLS
. That means protobuf will be built without ThreadSafeArena::thread_cache_
. If your project then doesn't get PROTOBUF_USE_DLLS
defined, you'd end up with a declaration of that field in thread_safe_arena.h
but no linkage
I believe the issue is that you or your dependencies are using FindPackage
, which doesn't properly set PROTOBUF_USE_DLLS
as we would have expected from our installed .pc
file. Your grep shows 2 places that are using FindPackage
, and another with a somewhat ominous comment referencing it.
This would also explain your issues with utf8_range, since FindPackage
doesn't know about our new dependencies
Note: because you set
BUILD_SHARED_LIBS=ON
, I believe our cmake config will then enableprotobuf_BUILD_SHARED_LIBS
andPROTOBUF_USE_DLLS
. That means protobuf will be built withoutThreadSafeArena::thread_cache_
. If your project then doesn't getPROTOBUF_USE_DLLS
defined, you'd end up with a declaration of that field inthread_safe_arena.h
but no linkage
Here is cmake -L
result
-- Cache values
CMAKE_BUILD_TYPE:STRING=RelWithDebInfo
CMAKE_INSTALL_PREFIX:PATH=/usr
GTest_DIR:PATH=/usr/lib64/cmake/GTest
absl_DIR:PATH=/usr/lib64/cmake/absl
protobuf_ABSL_PROVIDER:STRING=package
protobuf_ALLOW_CCACHE:BOOL=OFF
protobuf_BUILD_CONFORMANCE:BOOL=OFF
protobuf_BUILD_EXAMPLES:BOOL=OFF
protobuf_BUILD_LIBPROTOC:BOOL=OFF
protobuf_BUILD_PROTOBUF_BINARIES:BOOL=ON
protobuf_BUILD_PROTOC_BINARIES:BOOL=ON
protobuf_BUILD_SHARED_LIBS:BOOL=ON
protobuf_BUILD_TESTS:BOOL=ON
protobuf_DISABLE_RTTI:BOOL=OFF
protobuf_INSTALL:BOOL=ON
protobuf_INSTALL_EXAMPLES:BOOL=OFF
protobuf_REMOVE_INSTALLED_HEADERS:BOOL=OFF
protobuf_TEST_XML_OUTDIR:BOOL=OFF
protobuf_USE_EXTERNAL_GTEST:BOOL=ON
protobuf_WITH_ZLIB:BOOL=ON
utf8_range_ENABLE_INSTALL:BOOL=OFF
utf8_range_ENABLE_TESTS:BOOL=OFF
As you see on that list it is protobuf_BUILD_SHARED_LIBS:BOOL=ON
and there is no PROTOBUF_USE_DLLS
which should be set to some default (depends on what has been detected) value.
PROTOBUF_USE_DLLS
isn't a cmake flag. We set it directly on our libraries via target_compile_definitions
, only when protobuf_BUILD_SHARED_LIBS
is set. So if you installed protobuf with protobuf_BUILD_SHARED_LIBS
enabled, ThreadSafeArena::thread_cache_
won't exist. The fact that you're seeing linker errors about a missing symbol signals that someone is including our headers without PROTOBUF_USE_DLLS
set. Since we put this directly on our cmake targets, this would only happen if you're not getting our cmake configs (e.g. if someone is using FIND_PACKAGE(Protobuf)
).
As you showed in the original post, our .pc
file does set PROTOBUF_USE_DLLS
. So someone is using protobuf without that config
PROTOBUF_USE_DLLS
isn't a cmake flag. We set it directly on our libraries viatarget_compile_definitions
, only whenprotobuf_BUILD_SHARED_LIBS
is set. So if you installed protobuf withprotobuf_BUILD_SHARED_LIBS
enabled,ThreadSafeArena::thread_cache_
won't exist.
So looks like protobuf cmake is broken. Isn't it? 🤔
No, FIND_PACKAGE(Protobuf)
is broken and both mysql-8.0.33 and opencv-4.7.0 are using it. It's causing our headers to see mismatched flags from what the libraries were built with
As you showed in the original post, our
.pc
file does setPROTOBUF_USE_DLLS
. So someone is using protobuf without that config
libpronenumber is not using cmake module and uses pkgconfig which in protobuf.pc has Cflags: -I${includedir} -DPROTOBUF_USE_DLLS
and it fails on linking as well.
No,
FIND_PACKAGE(Protobuf)
is broken and both mysql-8.0.33 and opencv-4.7.0 are using it. It's causing our headers to see mismatched flags from what the libraries were built with
In both cases cmake is using installed by protobuf cmake module.
Again: did you try to reproduce this issue using details which I've already provided? 🤔
[tkloczko@pers-jacek pkgconfig]$ grep -r PROTOBUF_USE_DLLS /usr/lib64/cmake/protobuf
/usr/lib64/cmake/protobuf/protobuf-targets.cmake: INTERFACE_COMPILE_DEFINITIONS "PROTOBUF_USE_DLLS"
/usr/lib64/cmake/protobuf/protobuf-targets.cmake: INTERFACE_COMPILE_DEFINITIONS "PROTOBUF_USE_DLLS"
/usr/lib64/cmake/protobuf/protobuf-targets.cmake: INTERFACE_COMPILE_DEFINITIONS "PROTOBUF_USE_DLLS"
I have not seen a consistent enough set of reproduction steps to be able to reproduce this. You provided one set of cmake commands for building protobuf, but AFAICT it doesn't set protobuf_BUILD_SHARED_LIBS
, which your other comments suggest you have set. It's also not clear what platform you're on, is this linux or windows?
Also, this utf8_range_ENABLE_INSTALL
flag you're using is highly unsupported and I wouldn't expect it to work...
Also, this
utf8_range_ENABLE_INSTALL
flag you're using is highly unsupported and I wouldn't expect it to work...
ItWorks™️ and is causes that utf8_range
static library is not installed because it is used only on linking protobuf
binaries..
As it is not part of public protobuf
API/ABI it does not need to be installed.
I have not seen a consistent enough set of reproduction steps to be able to reproduce this. You provided one set of cmake commands for building protobuf, but AFAICT it doesn't set
protobuf_BUILD_SHARED_LIBS
, which your other comments suggest you have set. It's also not clear what platform your on, is this linux or windows?
Linux and Solaris. In both cases all fails the same way.
And please one more time have look on cmake -L output .. protobuf_BUILD_SHARED_LIBS:BOOL=ON
is in that output.
I did not set it but that with what end up cmake all because in main CMakeList.txt is
if (BUILD_SHARED_LIBS)
set(protobuf_BUILD_SHARED_LIBS_DEFAULT ON)
else (BUILD_SHARED_LIBS)
set(protobuf_BUILD_SHARED_LIBS_DEFAULT OFF)
endif (BUILD_SHARED_LIBS)
3rd time: did you try to reproduce that issue? 🤔
Here cmake parames which I have in my protobuf.spec
%build %cmake \ -D CMAKE_PREFIX_PATH=%{_prefix} \ -D protobuf_ABSL_PROVIDER=ON \ -D protobuf_ABSL_PROVIDER=package \ -D protobuf_BUILD_TESTS=ON \ -D protobuf_USE_EXTERNAL_GTEST=ON \ -D utf8_range_ENABLE_INSTALL=OFF \ %{nil}
This command doesn't have BUILD_SHARED_LIBS set either... Could you please provide reproduction steps that include all the flags you use to build:
I'm currently unable to build libpronenumber, because it seems stuck on C++11 which is incompatible with Abseil (it's ignoring -DCMAKE_CXX_STANDARD=14
)
Manually fixing libphonenumber to C++14, I get the following error from their Abseil dependency:
/bin/ld: libphonenumber.a(phonenumber.pb.cc.o): undefined reference to symbol '_ZN4absl12lts_2023012512log_internal21CheckOpMessageBuilder7ForVar2Ev'
/bin/ld: /usr/local/lib/libabsl_log_internal_check_op.so.2301.0.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/geocoding_test_program.dir/build.make:141: geocoding_test_program] Error 1
make[1]: *** [CMakeFiles/Makefile2:410: CMakeFiles/geocoding_test_program.dir/all] Error 2
This looks similar to what you saw in mysql, but if I set -DBUILD_TESTING=OFF
libphonenumber builds just fine. The commands I used were:
absl:
cmake . -DCMAKE_CXX_STANDARD=14 -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_SHARED_LIBS=ON
make install
protobuf:
cmake . -Dprotobuf_ABSL_PROVIDER=ON -Dprotobuf_ABSL_PROVIDER=package -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_USE_EXTERNAL_GTEST=ON -Dprotobuf_BUILD_SHARED_LIBS=ON
make install
libphonenumber:
cd cpp
cmake . -DCMAKE_PREFIX_PATH=/usr/local -DCMAKE_CXX_STANDARD=14 -DBUILD_TESTING=OFF
make
Looks like generated protobuf.pc has in Requires
utf8_range
.