conan-io / conan-center-index

Recipes for the ConanCenter repository
https://conan.io/center
MIT License
964 stars 1.77k forks source link

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

Closed DS-Serafin closed 2 years ago

DS-Serafin commented 2 years ago

Package and Environment Details (include every applicable attribute)

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 >)' /usr/bin/ld: ../../lib/libgoogle_cloud_cpp_generator.a(codegen_utils.cc.o): in function `google::cloud::generator_internal::BuildNamespaces(std::__cxx11::basic_string, std::allocator > 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 >*, std::__cxx11::basic_string, std::allocator >*)' /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::FindSubstitutions, std::allocator >, std::__cxx11::basic_string, std::allocator > >, std::allocator, std::allocator >, std::__cxx11::basic_string, std::allocator > > > > >(absl::lts_20211102::string_view, std::vector, std::allocator >, std::__cxx11::basic_string, std::allocator > >, std::allocator, std::allocator >, std::__cxx11::basic_string, std::allocator > > > > 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::ConvertToContainer >, absl::lts_20211102::string_view, false>::operator()(absl::lts_20211102::strings_internal::Splitter 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, std::allocator > const&)': descriptor_utils.cc:(.text+0x1775): undefined reference to `absl::lts_20211102::strings_internal::CatPieces[abi:cxx11](std::initializer_list)' /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 >)' /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 >)' /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 >)' /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 >)' /usr/bin/ld: descriptor_utils.cc:(.text+0x2fdb): undefined reference to `absl::lts_20211102::strings_internal::CatPieces[abi:cxx11](std::initializer_list)' /usr/bin/ld: descriptor_utils.cc:(.text+0x3878): undefined reference to `absl::lts_20211102::strings_internal::CatPieces[abi:cxx11](std::initializer_list)' /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::allocator >, std::__cxx11::basic_string, std::allocator > >, std::allocator, std::allocator >, std::__cxx11::basic_string, std::allocator > > > > const&)': descriptor_utils.cc:(.text+0x5a9a): undefined reference to `absl::lts_20211102::StrReplaceAll[abi:cxx11](absl::lts_20211102::string_view, std::initializer_list >)' /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 >)' /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::allocator >, std::__cxx11::basic_string, std::allocator >, std::less, std::allocator > >, std::allocator, std::allocator > const, std::__cxx11::basic_string, std::allocator > > > > const&, std::vector, std::allocator > > const&, char const*, int)': descriptor_utils.cc:(.text+0x8ef5): undefined reference to `absl::lts_20211102::strings_internal::CatPieces[abi:cxx11](std::initializer_list)' /usr/bin/ld: descriptor_utils.cc:(.text+0x90b8): undefined reference to `absl::lts_20211102::strings_internal::CatPieces[abi:cxx11](std::initializer_list)' /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::allocator >, std::__cxx11::basic_string, std::allocator >, std::less, std::allocator > >, std::allocator, std::allocator > const, std::__cxx11::basic_string, std::allocator > > > > 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::ConvertToContainer >, absl::lts_20211102::string_view, false>::operator()(absl::lts_20211102::strings_internal::Splitter 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 >)' /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::allocator > >(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, std::allocator >*, std::__cxx11::basic_string, std::allocator >*)' /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 >)' /usr/bin/ld: ../../lib/libgoogle_cloud_cpp_generator.a(codegen_utils.cc.o): in function `google::cloud::generator_internal::BuildNamespaces(std::__cxx11::basic_string, std::allocator > 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 >*, std::__cxx11::basic_string, std::allocator >*)' /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::FindSubstitutions, std::allocator >, std::__cxx11::basic_string, std::allocator > >, std::allocator, std::allocator >, std::__cxx11::basic_string, std::allocator > > > > >(absl::lts_20211102::string_view, std::vector, std::allocator >, std::__cxx11::basic_string, std::allocator > >, std::allocator, std::allocator >, std::__cxx11::basic_string, std::allocator > > > > 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::ConvertToContainer >, absl::lts_20211102::string_view, false>::operator()(absl::lts_20211102::strings_internal::Splitter 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, std::allocator > const&)': descriptor_utils.cc:(.text+0x1775): undefined reference to `absl::lts_20211102::strings_internal::CatPieces[abi:cxx11](std::initializer_list)' /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 >)' /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 >)' /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 >)' /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 >)' /usr/bin/ld: descriptor_utils.cc:(.text+0x2fdb): undefined reference to `absl::lts_20211102::strings_internal::CatPieces[abi:cxx11](std::initializer_list)' /usr/bin/ld: descriptor_utils.cc:(.text+0x3878): undefined reference to `absl::lts_20211102::strings_internal::CatPieces[abi:cxx11](std::initializer_list)' /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::allocator >, std::__cxx11::basic_string, std::allocator > >, std::allocator, std::allocator >, std::__cxx11::basic_string, std::allocator > > > > const&)': descriptor_utils.cc:(.text+0x5a9a): undefined reference to `absl::lts_20211102::StrReplaceAll[abi:cxx11](absl::lts_20211102::string_view, std::initializer_list >)' /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 >)' /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::allocator >, std::__cxx11::basic_string, std::allocator >, std::less, std::allocator > >, std::allocator, std::allocator > const, std::__cxx11::basic_string, std::allocator > > > > const&, std::vector, std::allocator > > const&, char const*, int)': descriptor_utils.cc:(.text+0x8ef5): undefined reference to `absl::lts_20211102::strings_internal::CatPieces[abi:cxx11](std::initializer_list)' /usr/bin/ld: descriptor_utils.cc:(.text+0x90b8): undefined reference to `absl::lts_20211102::strings_internal::CatPieces[abi:cxx11](std::initializer_list)' /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::allocator >, std::__cxx11::basic_string, std::allocator >, std::less, std::allocator > >, std::allocator, std::allocator > const, std::__cxx11::basic_string, std::allocator > > > > 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::ConvertToContainer >, absl::lts_20211102::string_view, false>::operator()(absl::lts_20211102::strings_internal::Splitter 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 >)' /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 ```
SpaceIm commented 2 years ago

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 commented 2 years ago

might be relevant: https://github.com/conan-io/conan-center-index/pull/7443

DS-Serafin commented 2 years ago

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

SpaceIm commented 2 years ago

Didn't have the time to experiment, but I've proposed a solution in abseil recipe: https://github.com/conan-io/conan-center-index/pull/7443#issuecomment-1019947633

SSE4 commented 2 years ago

@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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 https://github.com/conan-io/conan-center-index/pull/7443#issuecomment-1019947633:

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:

SSE4 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

I think I'll fight with this issue here: https://github.com/conan-io/conan-center-index/pull/10499 Wish me luck! 😅

jgsogo commented 2 years ago

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: https://github.com/conan-io/conan-center-index/pull/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 commented 2 years ago

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 commented 2 years ago

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:

jgsogo commented 2 years ago

I'm proposing these changes to abseil, that way the recipe will propagate (via Conan targets) the required C++ standard to its consumers: https://github.com/conan-io/conan-center-index/pull/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: https://github.com/conan-io/conan-center-index/pull/10499).

DS-Serafin commented 2 years ago

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 commented 2 years ago

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

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