Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[package] google-cloud-cpp/1.31.1: Does not build with gcc 11 #9679

Closed
DS-Serafin opened this issue Mar 9, 2022 · 18 comments · Fixed by #10499
Closed

[package] google-cloud-cpp/1.31.1: Does not build with gcc 11 #9679

DS-Serafin opened this issue Mar 9, 2022 · 18 comments · Fixed by #10499
Labels
bug Something isn't working

Comments

@DS-Serafin
Copy link

Package and Environment Details (include every applicable attribute)

  • Package Name/Version: google-cloud-cpp
  • Operating System+version: Linux Ubuntu 21.04
  • Compiler+version: GCC 11
  • Conan version: conan 1.45.0

Conan profile

[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=11
compiler.libcxx=libstdc++11
build_type=Release
[options]
[build_requires]
[env]
CC=/usr/bin/gcc-11
CXX=/usr/bin/g++-11
CXXFLAGS=
[conf]
tools.cmake.cmaketoolchain:user_toolchain = {{ os.path.join(profile_dir, "../../toolchains/linux/gcc-libstdc++.cmake") }}

The toolchain only contains some definitions for gcc-11 and does not really matter it will also break with a default gcc 11 build.

Steps to reproduce (Include if Applicable)

Logs (Include/Attach if Applicable)

Click to expand log
/usr/bin/ld: ../../lib/libgoogle_cloud_cpp_generator.a(codegen_utils.cc.o): in function `google::cloud::generator_internal::CurrentCopyrightYear[abi:cxx11]()':
codegen_utils.cc:(.text+0x125): undefined reference to `absl::lts_20211102::FormatTime[abi:cxx11](absl::lts_20211102::string_view, absl::lts_20211102::Time, absl::lts_20211102::TimeZone)'
/usr/bin/ld: ../../lib/libgoogle_cloud_cpp_generator.a(codegen_utils.cc.o): in function `google::cloud::generator_internal::ProtoNameToCppName[abi:cxx11](absl::lts_20211102::string_view)':
codegen_utils.cc:(.text+0x31e): undefined reference to `absl::lts_20211102::StrReplaceAll[abi:cxx11](absl::lts_20211102::string_view, std::initializer_list<std::pair<absl::lts_20211102::string_view, absl::lts_20211102::string_view> >)'
/usr/bin/ld: ../../lib/libgoogle_cloud_cpp_generator.a(codegen_utils.cc.o): in function `google::cloud::generator_internal::BuildNamespaces(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, google::cloud::generator_internal::NamespaceType)':
codegen_utils.cc:(.text+0x437): undefined reference to `absl::lts_20211102::ByChar::Find(absl::lts_20211102::string_view, unsigned long) const'
/usr/bin/ld: codegen_utils.cc:(.text+0x51c): undefined reference to `absl::lts_20211102::ByChar::Find(absl::lts_20211102::string_view, unsigned long) const'
/usr/bin/ld: ../../lib/libgoogle_cloud_cpp_generator.a(codegen_utils.cc.o): in function `google::cloud::generator_internal::CamelCaseToSnakeCase[abi:cxx11](absl::lts_20211102::string_view)':
codegen_utils.cc:(.text+0x12ba): undefined reference to `absl::lts_20211102::strings_internal::ApplySubstitutions(absl::lts_20211102::string_view, std::vector<absl::lts_20211102::strings_internal::ViableSubstitution, std::allocator<absl::lts_20211102::strings_internal::ViableSubstitution> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
/usr/bin/ld: ../../lib/libgoogle_cloud_cpp_generator.a(codegen_utils.cc.o): in function `google::cloud::generator_internal::ServiceNameToFilePath[abi:cxx11](absl::lts_20211102::string_view)':
codegen_utils.cc:(.text+0x18f6): undefined reference to `absl::lts_20211102::ByChar::Find(absl::lts_20211102::string_view, unsigned long) const'
/usr/bin/ld: codegen_utils.cc:(.text+0x19ab): undefined reference to `absl::lts_20211102::ByChar::Find(absl::lts_20211102::string_view, unsigned long) const'
/usr/bin/ld: ../../lib/libgoogle_cloud_cpp_generator.a(codegen_utils.cc.o): in function `std::vector<absl::lts_20211102::strings_internal::ViableSubstitution, std::allocator<absl::lts_20211102::strings_internal::ViableSubstitution> > absl::lts_20211102::strings_internal::FindSubstitutions<std::vector<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >(absl::lts_20211102::string_view, std::vector<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&)':
codegen_utils.cc:(.text._ZN4absl12lts_2021110216strings_internal17FindSubstitutionsISt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESA_ESaISB_EEEES3_INS1_18ViableSubstitutionESaISE_EENS0_11string_viewERKT_[_ZN4absl12lts_2021110216strings_internal17FindSubstitutionsISt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESA_ESaISB_EEEES3_INS1_18ViableSubstitutionESaISE_EENS0_11string_viewERKT_]+0x94): undefined reference to `absl::lts_20211102::string_view::find(absl::lts_20211102::string_view, unsigned long) const'
/usr/bin/ld: ../../lib/libgoogle_cloud_cpp_generator.a(descriptor_utils.cc.o): in function `absl::lts_20211102::strings_internal::Splitter<absl::lts_20211102::ByChar, absl::lts_20211102::AllowEmpty, absl::lts_20211102::string_view>::ConvertToContainer<std::vector<absl::lts_20211102::string_view, std::allocator<absl::lts_20211102::string_view> >, absl::lts_20211102::string_view, false>::operator()(absl::lts_20211102::strings_internal::Splitter<absl::lts_20211102::ByChar, absl::lts_20211102::AllowEmpty, absl::lts_20211102::string_view> const&) const [clone .isra.0]':
descriptor_utils.cc:(.text+0xa07): undefined reference to `absl::lts_20211102::ByChar::Find(absl::lts_20211102::string_view, unsigned long) const'
/usr/bin/ld: descriptor_utils.cc:(.text+0xa9b): undefined reference to `absl::lts_20211102::ByChar::Find(absl::lts_20211102::string_view, unsigned long) const'
/usr/bin/ld: ../../lib/libgoogle_cloud_cpp_generator.a(descriptor_utils.cc.o): in function `google::cloud::generator_internal::(anonymous namespace)::FormatDoxygenLink(google::protobuf::Descriptor const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
descriptor_utils.cc:(.text+0x1775): undefined reference to `absl::lts_20211102::strings_internal::CatPieces[abi:cxx11](std::initializer_list<absl::lts_20211102::string_view>)'
/usr/bin/ld: ../../lib/libgoogle_cloud_cpp_generator.a(descriptor_utils.cc.o): in function `google::cloud::generator_internal::FormatMethodCommentsFromRpcComments[abi:cxx11](google::protobuf::MethodDescriptor const&, google::cloud::generator_internal::MethodParameterStyle)':
descriptor_utils.cc:(.text+0x2a8c): undefined reference to `absl::lts_20211102::StrReplaceAll[abi:cxx11](absl::lts_20211102::string_view, std::initializer_list<std::pair<absl::lts_20211102::string_view, absl::lts_20211102::string_view> >)'
/usr/bin/ld: descriptor_utils.cc:(.text+0x2aad): undefined reference to `absl::lts_20211102::StrReplaceAll[abi:cxx11](absl::lts_20211102::string_view, std::initializer_list<std::pair<absl::lts_20211102::string_view, absl::lts_20211102::string_view> >)'
/usr/bin/ld: descriptor_utils.cc:(.text+0x2e8a): undefined reference to `absl::lts_20211102::StrReplaceAll[abi:cxx11](absl::lts_20211102::string_view, std::initializer_list<std::pair<absl::lts_20211102::string_view, absl::lts_20211102::string_view> >)'
/usr/bin/ld: descriptor_utils.cc:(.text+0x2eb0): undefined reference to `absl::lts_20211102::StrReplaceAll[abi:cxx11](absl::lts_20211102::string_view, std::initializer_list<std::pair<absl::lts_20211102::string_view, absl::lts_20211102::string_view> >)'
/usr/bin/ld: descriptor_utils.cc:(.text+0x2fdb): undefined reference to `absl::lts_20211102::strings_internal::CatPieces[abi:cxx11](std::initializer_list<absl::lts_20211102::string_view>)'
/usr/bin/ld: descriptor_utils.cc:(.text+0x3878): undefined reference to `absl::lts_20211102::strings_internal::CatPieces[abi:cxx11](std::initializer_list<absl::lts_20211102::string_view>)'
/usr/bin/ld: ../../lib/libgoogle_cloud_cpp_generator.a(descriptor_utils.cc.o): in function `google::cloud::generator_internal::CreateServiceVars(google::protobuf::ServiceDescriptor const&, std::vector<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&)':
descriptor_utils.cc:(.text+0x5a9a): undefined reference to `absl::lts_20211102::StrReplaceAll[abi:cxx11](absl::lts_20211102::string_view, std::initializer_list<std::pair<absl::lts_20211102::string_view, absl::lts_20211102::string_view> >)'
/usr/bin/ld: descriptor_utils.cc:(.text+0x5b97): undefined reference to `absl::lts_20211102::StrReplaceAll[abi:cxx11](absl::lts_20211102::string_view, std::initializer_list<std::pair<absl::lts_20211102::string_view, absl::lts_20211102::string_view> >)'
/usr/bin/ld: ../../lib/libgoogle_cloud_cpp_generator.a(descriptor_utils.cc.o): in function `google::cloud::generator_internal::PrintMethod(google::protobuf::MethodDescriptor const&, google::cloud::generator_internal::Printer&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&, std::vector<google::cloud::generator_internal::Pattern<google::protobuf::MethodDescriptor>, std::allocator<google::cloud::generator_internal::Pattern<google::protobuf::MethodDescriptor> > > const&, char const*, int)':
descriptor_utils.cc:(.text+0x8ef5): undefined reference to `absl::lts_20211102::strings_internal::CatPieces[abi:cxx11](std::initializer_list<absl::lts_20211102::string_view>)'
/usr/bin/ld: descriptor_utils.cc:(.text+0x90b8): undefined reference to `absl::lts_20211102::strings_internal::CatPieces[abi:cxx11](std::initializer_list<absl::lts_20211102::string_view>)'
/usr/bin/ld: ../../lib/libgoogle_cloud_cpp_generator.a(descriptor_utils.cc.o): in function `google::cloud::generator_internal::CreateMethodVars(google::protobuf::ServiceDescriptor const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&)':
descriptor_utils.cc:(.text+0xc491): undefined reference to `absl::lts_20211102::variant_internal::ThrowBadVariantAccess()'
/usr/bin/ld: descriptor_utils.cc:(.text+0xc496): undefined reference to `absl::lts_20211102::variant_internal::ThrowBadVariantAccess()'
/usr/bin/ld: descriptor_utils.cc:(.text+0xc4a0): undefined reference to `absl::lts_20211102::variant_internal::ThrowBadVariantAccess()'
/usr/bin/ld: descriptor_utils.cc:(.text+0xc4b1): undefined reference to `absl::lts_20211102::variant_internal::ThrowBadVariantAccess()'
/usr/bin/ld: ../../lib/libgoogle_cloud_cpp_generator.a(service_code_generator.cc.o): in function `absl::lts_20211102::strings_internal::Splitter<absl::lts_20211102::ByChar, absl::lts_20211102::AllowEmpty, absl::lts_20211102::string_view>::ConvertToContainer<std::vector<absl::lts_20211102::string_view, std::allocator<absl::lts_20211102::string_view> >, absl::lts_20211102::string_view, false>::operator()(absl::lts_20211102::strings_internal::Splitter<absl::lts_20211102::ByChar, absl::lts_20211102::AllowEmpty, absl::lts_20211102::string_view> const&) const [clone .isra.0]':
service_code_generator.cc:(.text+0x157): undefined reference to `absl::lts_20211102::ByChar::Find(absl::lts_20211102::string_view, unsigned long) const'
/usr/bin/ld: service_code_generator.cc:(.text+0x1eb): undefined reference to `absl::lts_20211102::ByChar::Find(absl::lts_20211102::string_view, unsigned long) const'
/usr/bin/ld: ../../lib/libgoogle_cloud_cpp_generator.a(service_code_generator.cc.o): in function `google::cloud::generator_internal::ServiceCodeGenerator::SetVars(absl::lts_20211102::string_view)':
service_code_generator.cc:(.text+0x5ee4): undefined reference to `absl::lts_20211102::StrReplaceAll[abi:cxx11](absl::lts_20211102::string_view, std::initializer_list<std::pair<absl::lts_20211102::string_view, absl::lts_20211102::string_view> >)'
/usr/bin/ld: ../../lib/libgoogle_cloud_cpp_common.a(log.cc.o): in function `google::cloud::v1::operator<<(std::ostream&, google::cloud::v1::LogRecord const&)':
log.cc:(.text+0x2c3): undefined reference to `absl::lts_20211102::FormatTime[abi:cxx11](absl::lts_20211102::string_view, absl::lts_20211102::Time, absl::lts_20211102::TimeZone)'
/usr/bin/ld: ../../lib/libgoogle_cloud_cpp_common.a(log.cc.o): in function `google::cloud::v1::internal::DefaultLogBackend()':
log.cc:(.text+0xcf1): undefined reference to `absl::lts_20211102::ByChar::Find(absl::lts_20211102::string_view, unsigned long) const'
/usr/bin/ld: log.cc:(.text+0xd8e): undefined reference to `absl::lts_20211102::ByChar::Find(absl::lts_20211102::string_view, unsigned long) const'
collect2: error: ld returned 1 exit status
gmake[2]: *** [source_subfolder/generator/CMakeFiles/protoc-gen-cpp_codegen.dir/build.make:213: bin/protoc-gen-cpp_codegen] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:2401: source_subfolder/generator/CMakeFiles/protoc-gen-cpp_codegen.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
[ 90%] Building CXX object source_subfolder/google/cloud/pubsub/CMakeFiles/google_cloud_cpp_pubsub.dir/internal/publisher_round_robin.cc.o
[ 90%] Building CXX object source_subfolder/google/cloud/pubsub/CMakeFiles/google_cloud_cpp_pubsub.dir/internal/publisher_stub.cc.o
[ 90%] Linking CXX executable ../../bin/google-cloud-cpp-codegen
/usr/bin/ld: CMakeFiles/google-cloud-cpp-codegen.dir/standalone_main.cc.o: in function `void* absl::lts_20211102::flags_internal::FlagOps<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(absl::lts_20211102::flags_internal::FlagOp, void const*, void*, void*)':
standalone_main.cc:(.text._ZN4absl12lts_2021110214flags_internal7FlagOpsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEPvNS1_6FlagOpEPKvS9_S9_[_ZN4absl12lts_2021110214flags_internal7FlagOpsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEPvNS1_6FlagOpEPKvS9_S9_]+0x102): undefined reference to `absl::lts_20211102::flags_internal::AbslUnparseFlag[abi:cxx11](absl::lts_20211102::string_view)'
/usr/bin/ld: standalone_main.cc:(.text._ZN4absl12lts_2021110214flags_internal7FlagOpsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEPvNS1_6FlagOpEPKvS9_S9_[_ZN4absl12lts_2021110214flags_internal7FlagOpsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEPvNS1_6FlagOpEPKvS9_S9_]+0x1e3): undefined reference to `absl::lts_20211102::flags_internal::AbslParseFlag(absl::lts_20211102::string_view, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
/usr/bin/ld: ../../lib/libgoogle_cloud_cpp_generator.a(codegen_utils.cc.o): in function `google::cloud::generator_internal::CurrentCopyrightYear[abi:cxx11]()':
codegen_utils.cc:(.text+0x125): undefined reference to `absl::lts_20211102::FormatTime[abi:cxx11](absl::lts_20211102::string_view, absl::lts_20211102::Time, absl::lts_20211102::TimeZone)'
/usr/bin/ld: ../../lib/libgoogle_cloud_cpp_generator.a(codegen_utils.cc.o): in function `google::cloud::generator_internal::ProtoNameToCppName[abi:cxx11](absl::lts_20211102::string_view)':
codegen_utils.cc:(.text+0x31e): undefined reference to `absl::lts_20211102::StrReplaceAll[abi:cxx11](absl::lts_20211102::string_view, std::initializer_list<std::pair<absl::lts_20211102::string_view, absl::lts_20211102::string_view> >)'
/usr/bin/ld: ../../lib/libgoogle_cloud_cpp_generator.a(codegen_utils.cc.o): in function `google::cloud::generator_internal::BuildNamespaces(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, google::cloud::generator_internal::NamespaceType)':
codegen_utils.cc:(.text+0x437): undefined reference to `absl::lts_20211102::ByChar::Find(absl::lts_20211102::string_view, unsigned long) const'
/usr/bin/ld: codegen_utils.cc:(.text+0x51c): undefined reference to `absl::lts_20211102::ByChar::Find(absl::lts_20211102::string_view, unsigned long) const'
/usr/bin/ld: ../../lib/libgoogle_cloud_cpp_generator.a(codegen_utils.cc.o): in function `google::cloud::generator_internal::CamelCaseToSnakeCase[abi:cxx11](absl::lts_20211102::string_view)':
codegen_utils.cc:(.text+0x12ba): undefined reference to `absl::lts_20211102::strings_internal::ApplySubstitutions(absl::lts_20211102::string_view, std::vector<absl::lts_20211102::strings_internal::ViableSubstitution, std::allocator<absl::lts_20211102::strings_internal::ViableSubstitution> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
/usr/bin/ld: ../../lib/libgoogle_cloud_cpp_generator.a(codegen_utils.cc.o): in function `google::cloud::generator_internal::ServiceNameToFilePath[abi:cxx11](absl::lts_20211102::string_view)':
codegen_utils.cc:(.text+0x18f6): undefined reference to `absl::lts_20211102::ByChar::Find(absl::lts_20211102::string_view, unsigned long) const'
/usr/bin/ld: codegen_utils.cc:(.text+0x19ab): undefined reference to `absl::lts_20211102::ByChar::Find(absl::lts_20211102::string_view, unsigned long) const'
/usr/bin/ld: ../../lib/libgoogle_cloud_cpp_generator.a(codegen_utils.cc.o): in function `std::vector<absl::lts_20211102::strings_internal::ViableSubstitution, std::allocator<absl::lts_20211102::strings_internal::ViableSubstitution> > absl::lts_20211102::strings_internal::FindSubstitutions<std::vector<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >(absl::lts_20211102::string_view, std::vector<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&)':
codegen_utils.cc:(.text._ZN4absl12lts_2021110216strings_internal17FindSubstitutionsISt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESA_ESaISB_EEEES3_INS1_18ViableSubstitutionESaISE_EENS0_11string_viewERKT_[_ZN4absl12lts_2021110216strings_internal17FindSubstitutionsISt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESA_ESaISB_EEEES3_INS1_18ViableSubstitutionESaISE_EENS0_11string_viewERKT_]+0x94): undefined reference to `absl::lts_20211102::string_view::find(absl::lts_20211102::string_view, unsigned long) const'
/usr/bin/ld: ../../lib/libgoogle_cloud_cpp_generator.a(descriptor_utils.cc.o): in function `absl::lts_20211102::strings_internal::Splitter<absl::lts_20211102::ByChar, absl::lts_20211102::AllowEmpty, absl::lts_20211102::string_view>::ConvertToContainer<std::vector<absl::lts_20211102::string_view, std::allocator<absl::lts_20211102::string_view> >, absl::lts_20211102::string_view, false>::operator()(absl::lts_20211102::strings_internal::Splitter<absl::lts_20211102::ByChar, absl::lts_20211102::AllowEmpty, absl::lts_20211102::string_view> const&) const [clone .isra.0]':
descriptor_utils.cc:(.text+0xa07): undefined reference to `absl::lts_20211102::ByChar::Find(absl::lts_20211102::string_view, unsigned long) const'
/usr/bin/ld: descriptor_utils.cc:(.text+0xa9b): undefined reference to `absl::lts_20211102::ByChar::Find(absl::lts_20211102::string_view, unsigned long) const'
/usr/bin/ld: ../../lib/libgoogle_cloud_cpp_generator.a(descriptor_utils.cc.o): in function `google::cloud::generator_internal::(anonymous namespace)::FormatDoxygenLink(google::protobuf::Descriptor const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
descriptor_utils.cc:(.text+0x1775): undefined reference to `absl::lts_20211102::strings_internal::CatPieces[abi:cxx11](std::initializer_list<absl::lts_20211102::string_view>)'
/usr/bin/ld: ../../lib/libgoogle_cloud_cpp_generator.a(descriptor_utils.cc.o): in function `google::cloud::generator_internal::FormatMethodCommentsFromRpcComments[abi:cxx11](google::protobuf::MethodDescriptor const&, google::cloud::generator_internal::MethodParameterStyle)':
descriptor_utils.cc:(.text+0x2a8c): undefined reference to `absl::lts_20211102::StrReplaceAll[abi:cxx11](absl::lts_20211102::string_view, std::initializer_list<std::pair<absl::lts_20211102::string_view, absl::lts_20211102::string_view> >)'
/usr/bin/ld: descriptor_utils.cc:(.text+0x2aad): undefined reference to `absl::lts_20211102::StrReplaceAll[abi:cxx11](absl::lts_20211102::string_view, std::initializer_list<std::pair<absl::lts_20211102::string_view, absl::lts_20211102::string_view> >)'
/usr/bin/ld: descriptor_utils.cc:(.text+0x2e8a): undefined reference to `absl::lts_20211102::StrReplaceAll[abi:cxx11](absl::lts_20211102::string_view, std::initializer_list<std::pair<absl::lts_20211102::string_view, absl::lts_20211102::string_view> >)'
/usr/bin/ld: descriptor_utils.cc:(.text+0x2eb0): undefined reference to `absl::lts_20211102::StrReplaceAll[abi:cxx11](absl::lts_20211102::string_view, std::initializer_list<std::pair<absl::lts_20211102::string_view, absl::lts_20211102::string_view> >)'
/usr/bin/ld: descriptor_utils.cc:(.text+0x2fdb): undefined reference to `absl::lts_20211102::strings_internal::CatPieces[abi:cxx11](std::initializer_list<absl::lts_20211102::string_view>)'
/usr/bin/ld: descriptor_utils.cc:(.text+0x3878): undefined reference to `absl::lts_20211102::strings_internal::CatPieces[abi:cxx11](std::initializer_list<absl::lts_20211102::string_view>)'
/usr/bin/ld: ../../lib/libgoogle_cloud_cpp_generator.a(descriptor_utils.cc.o): in function `google::cloud::generator_internal::CreateServiceVars(google::protobuf::ServiceDescriptor const&, std::vector<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&)':
descriptor_utils.cc:(.text+0x5a9a): undefined reference to `absl::lts_20211102::StrReplaceAll[abi:cxx11](absl::lts_20211102::string_view, std::initializer_list<std::pair<absl::lts_20211102::string_view, absl::lts_20211102::string_view> >)'
/usr/bin/ld: descriptor_utils.cc:(.text+0x5b97): undefined reference to `absl::lts_20211102::StrReplaceAll[abi:cxx11](absl::lts_20211102::string_view, std::initializer_list<std::pair<absl::lts_20211102::string_view, absl::lts_20211102::string_view> >)'
/usr/bin/ld: ../../lib/libgoogle_cloud_cpp_generator.a(descriptor_utils.cc.o): in function `google::cloud::generator_internal::PrintMethod(google::protobuf::MethodDescriptor const&, google::cloud::generator_internal::Printer&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&, std::vector<google::cloud::generator_internal::Pattern<google::protobuf::MethodDescriptor>, std::allocator<google::cloud::generator_internal::Pattern<google::protobuf::MethodDescriptor> > > const&, char const*, int)':
descriptor_utils.cc:(.text+0x8ef5): undefined reference to `absl::lts_20211102::strings_internal::CatPieces[abi:cxx11](std::initializer_list<absl::lts_20211102::string_view>)'
/usr/bin/ld: descriptor_utils.cc:(.text+0x90b8): undefined reference to `absl::lts_20211102::strings_internal::CatPieces[abi:cxx11](std::initializer_list<absl::lts_20211102::string_view>)'
/usr/bin/ld: ../../lib/libgoogle_cloud_cpp_generator.a(descriptor_utils.cc.o): in function `google::cloud::generator_internal::CreateMethodVars(google::protobuf::ServiceDescriptor const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&)':
descriptor_utils.cc:(.text+0xc491): undefined reference to `absl::lts_20211102::variant_internal::ThrowBadVariantAccess()'
/usr/bin/ld: descriptor_utils.cc:(.text+0xc496): undefined reference to `absl::lts_20211102::variant_internal::ThrowBadVariantAccess()'
/usr/bin/ld: descriptor_utils.cc:(.text+0xc4a0): undefined reference to `absl::lts_20211102::variant_internal::ThrowBadVariantAccess()'
/usr/bin/ld: descriptor_utils.cc:(.text+0xc4b1): undefined reference to `absl::lts_20211102::variant_internal::ThrowBadVariantAccess()'
/usr/bin/ld: ../../lib/libgoogle_cloud_cpp_generator.a(service_code_generator.cc.o): in function `absl::lts_20211102::strings_internal::Splitter<absl::lts_20211102::ByChar, absl::lts_20211102::AllowEmpty, absl::lts_20211102::string_view>::ConvertToContainer<std::vector<absl::lts_20211102::string_view, std::allocator<absl::lts_20211102::string_view> >, absl::lts_20211102::string_view, false>::operator()(absl::lts_20211102::strings_internal::Splitter<absl::lts_20211102::ByChar, absl::lts_20211102::AllowEmpty, absl::lts_20211102::string_view> const&) const [clone .isra.0]':
service_code_generator.cc:(.text+0x157): undefined reference to `absl::lts_20211102::ByChar::Find(absl::lts_20211102::string_view, unsigned long) const'
/usr/bin/ld: service_code_generator.cc:(.text+0x1eb): undefined reference to `absl::lts_20211102::ByChar::Find(absl::lts_20211102::string_view, unsigned long) const'
/usr/bin/ld: ../../lib/libgoogle_cloud_cpp_generator.a(service_code_generator.cc.o): in function `google::cloud::generator_internal::ServiceCodeGenerator::SetVars(absl::lts_20211102::string_view)':
service_code_generator.cc:(.text+0x5ee4): undefined reference to `absl::lts_20211102::StrReplaceAll[abi:cxx11](absl::lts_20211102::string_view, std::initializer_list<std::pair<absl::lts_20211102::string_view, absl::lts_20211102::string_view> >)'
/usr/bin/ld: ../../lib/libgoogle_cloud_cpp_common.a(log.cc.o): in function `google::cloud::v1::operator<<(std::ostream&, google::cloud::v1::LogRecord const&)':
log.cc:(.text+0x2c3): undefined reference to `absl::lts_20211102::FormatTime[abi:cxx11](absl::lts_20211102::string_view, absl::lts_20211102::Time, absl::lts_20211102::TimeZone)'
/usr/bin/ld: ../../lib/libgoogle_cloud_cpp_common.a(log.cc.o): in function `google::cloud::v1::internal::DefaultLogBackend()':
log.cc:(.text+0xcf1): undefined reference to `absl::lts_20211102::ByChar::Find(absl::lts_20211102::string_view, unsigned long) const'
/usr/bin/ld: log.cc:(.text+0xd8e): undefined reference to `absl::lts_20211102::ByChar::Find(absl::lts_20211102::string_view, unsigned long) const'
collect2: error: ld returned 1 exit status
@DS-Serafin DS-Serafin added the bug Something isn't working label Mar 9, 2022
@SpaceIm
Copy link
Contributor

SpaceIm commented Mar 9, 2022

Likely the usual issue related to C++ standard and incoherency in the way abseil was built and consumed. Does it work if you try to force compiler.cppstd to 17?

@SSE4 SSE4 changed the title [package] google-clou-cpp/1.31.1: Does not build with gcc 11 [package] google-cloud-cpp/1.31.1: Does not build with gcc 11 Mar 10, 2022
@SSE4
Copy link
Contributor

SSE4 commented Mar 10, 2022

might be relevant: #7443

@DS-Serafin
Copy link
Author

@SpaceIm yes I can build with compiler.cppstd=17 but not sure this is a solution.

@SpaceIm
Copy link
Contributor

SpaceIm commented Mar 10, 2022

Didn't have the time to experiment, but I've proposed a solution in abseil recipe: #7443 (comment)

@SSE4
Copy link
Contributor

SSE4 commented Mar 11, 2022

@SpaceIm I've tried to pin ABI according to your method in #9703
for abseil test package it works like a charm, however, for google-cloud-cpp it's getting tons of errors.
it seems like C++ standard is not properly propagated?
google-cloud-cpp.txt

@SpaceIm
Copy link
Contributor

SpaceIm commented Mar 11, 2022

Maybe because google-cloud-cpp forces C++11 instead of relying on cxx_std_11 feature? https://github.com/googleapis/google-cloud-cpp/blob/8e39dd5c711c3209da4273fa554a705eba82f53c/CMakeLists.txt#L31-L41

@SSE4
Copy link
Contributor

SSE4 commented Mar 11, 2022

Maybe because google-cloud-cpp forces C++11 instead of relying on cxx_std_11 feature?

maybe. how should we deal with it in context of recipe(s)? reject other configurations besides C++11?

@SpaceIm
Copy link
Contributor

SpaceIm commented Mar 11, 2022

I would say fix google-cloud-cpp CMakeLists to use cxx_std_11 feature for all its targets. Might not be straightforward since it's not something you can globally enable like CMAKE_CXX_STANDARD.

The issue I'm suspecting is the last sentence of #7443 (comment):

Therefore, even if abseil was compiled with C++11 standard, a recipe using C++17 at consume time would not be tricked by going into the wrong branch (the opposite would not work, abseil compiled with C++17 could not work in a project forcing C++11, but in conan it shouldn't happen).

so:

  • compiler.cppstd not set in profile
  • abseil is compiled with a recent compiler and CMake sees cxx_std_11 feature and enables for example C++17
  • we pin the API & ABI of abseil with this standard at build time
  • google-cloud-cpp forces C++11 => compile error, stuff like std::any doesn't exist in C++11

@SSE4
Copy link
Contributor

SSE4 commented Mar 11, 2022

I would say fix google-cloud-cpp CMakeLists to use cxx_std_11 feature for all its targets.

but shouldn't it transitively receive cxx_std_11 whenever it does target_link_libraries(google-cloud-whatever PRIVATE absl::whatever)?

@SpaceIm
Copy link
Contributor

SpaceIm commented Mar 11, 2022

It should, but conan generators are not able to emulate cmake features like cxx_std_11. And even with that, CXX_STANDARD in google-cloud-cpp defeats cxx features.

@SSE4
Copy link
Contributor

SSE4 commented Mar 11, 2022

commenting this line: https://github.com/conan-io/conan-center-index/blob/master/recipes/google-cloud-cpp/all/conanfile.py#L110
causes google-cloud-cpp build to pass for GCC11
still, not sure what's the best solution to propagate cxx_std_11 from abseil.
if it's not supported by conan generator, maybe build modules may help?
otherwise, probably only calling set_target_properties in CMakeLists.txt (wrapper) could help.
still, the proper value for cxx_std_<year> has to be obtained from somewhere, it means abseil recipe has to store it somewhere (in package_info or .json file in package?)

@jgsogo
Copy link
Contributor

jgsogo commented Apr 25, 2022

I think I'll fight with this issue here: #10499 Wish me luck! 😅

@jgsogo
Copy link
Contributor

jgsogo commented Apr 25, 2022

In abseil sources I see they add cxx_std_11 target compile feature to all the targets: https://github.com/abseil/abseil-cpp/blob/master/CMake/AbseilHelpers.cmake#L263 (we force ABSL_PROPAGATE_CXX_STD=True).

On GCP we are forcing C++11 (CMAKE_CXX_STANDARD) https://github.com/conan-io/conan-center-index/blob/master/recipes/google-cloud-cpp/all/conanfile.py#L103 , but it has started to fail as I checked in this PR: #10498.

I'm not talking about new versions, but I would have expected that combination to work. Althoug cxx_std_11 is not propagated (Conan doesn't do that kind of stuff), the CMAKE_CXX_STANDARD should apply to all targets while building google-cloud-cpp libraries. It should be high enough...

I'm sure I'm missing something, I need to read more.

@jgsogo
Copy link
Contributor

jgsogo commented Apr 25, 2022

Oh... and we have grpc in the middle (also requiring abseil) that forces C++11: https://github.com/conan-io/conan-center-index/blob/master/recipes/grpc/all/conanfile.py#L160

@jgsogo
Copy link
Contributor

jgsogo commented Apr 25, 2022

Having a look at abseil sources I found this file: https://github.com/abseil/abseil-cpp/blob/ac1398a6296de03413d7b88df4b4aa16e9e450cc/absl/base/options.h, which we are modifying in abseil recipe. It has some very interesting content:

// ABSL_OPTION_USE_STD_STRING_VIEW
//
// This option controls whether absl::string_view is implemented as an alias to
// std::string_view, or as an independent implementation.
//
// A value of 0 means to use Abseil's implementation.  This requires only C++11
// support, and is expected to work on every toolchain we support.
//
// A value of 1 means to use an alias to std::string_view.  This requires that
// all code using Abseil is built in C++17 mode or later.
//
// A value of 2 means to detect the C++ version being used to compile Abseil,
// and use an alias only if a working std::string_view is available.  This
// option is useful when you are building your program from source.  It should
// not be used otherwise -- for example, if you are distributing Abseil in a
// binary package manager -- since in mode 2, absl::string_view will name a
// different type, with a different mangled name and binary layout, depending on
// the compiler flags passed by the end user.  For more info, see
// https://abseil.io/about/design/dropin-types.
//
// User code should not inspect this macro.  To check in the preprocessor if
// absl::string_view is a typedef of std::string_view, use the feature macro
// ABSL_USES_STD_STRING_VIEW.

#define ABSL_OPTION_USE_STD_STRING_VIEW 2

My Conan package (GCC 11) has value 1, so consumers require C++17...

So, even if abseil uses target_compile_features($abseil_stuff PUBLIC cxx_std_11), it detects that the compiler is able to use some newer features and the API will require C++17. Am I right?

The problem here is that we should be able to propagate downstream the minimal requirement (after parsing this options.h file!!!) to the consumers:

  • we can detect and store this C++ required in abseil itself and create something that would be automatically consumed (like some build-module) and warns/raises the consumer if the standard is not high enough
  • all consumers should parse this file and use the proper C++ standard.

@jgsogo
Copy link
Contributor

jgsogo commented Apr 25, 2022

I'm proposing these changes to abseil, that way the recipe will propagate (via Conan targets) the required C++ standard to its consumers: #10502. I have tested it using GCC11 and GCC8 and it works when building the dependency chain abseil, grpc and google-cloud-cpp (see all changes together here: #10499).

@DS-Serafin
Copy link
Author

DS-Serafin commented Apr 26, 2022

The problem here is that we should be able to propagate downstream the minimal requirement (after parsing this options.h file!!!) to the consumers:

Itis not a minimal requirement. It is cppstd==17. And I think that is a bug. You also cant compile with cpp20

Edit: I think it is cppstd == default cppstd of that compiler

@jgsogo
Copy link
Contributor

jgsogo commented Apr 26, 2022

I've tested it using docker image conanio/gcc11-ubuntu16.04:1.47.0 and my changes in #10499.

  • it works with defaults
  • it works forcing -s compiler.cppstd=20

If using GCC11, in my proposal, the abseil targets have a target_compiler_features(<abseil-thin> INTERFACE cxx_std_17) so consumers will use C++17. This minimal requirement is propagated downstream. For older compilers it propagates cxx_std_11, and if C++20 is forced (compiler.cppstd=20), then it will use that C++ standard to build all the libraries.

Edit.- Only tested latest version 1.39.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants