open-telemetry / opentelemetry-cpp

The OpenTelemetry C++ Client
https://opentelemetry.io/
Apache License 2.0
908 stars 432 forks source link

Internal abseil code compile error on gcc 14 #2723

Open kpvdr opened 5 months ago

kpvdr commented 5 months ago

This issue is Compile errors occur when using gcc 14 #2591 reopened. This issue has been observed on opentelemetry-cpp versions 1.15.0 and 1.16.0.

A cmake build in which internal abseil code is used generates compile errors on gcc 14. Using an external abseil devel package avoids the problem. Using the internal abseil code on the previous version of gcc (13) works ok.

OS: Fedora 40 or Fedora rawhide. Most likely any OS which supports gcc 14 will show this issue. Ensure that the abseil and abseil-devel packages are NOT installed.

Run cmake with WITH_ABSEIL:BOOL=OFF or WITH_ABSEIL omitted as an option. Run make. This will eventually fail with compile errors (the following is the first of many):

In file included from /home/jenkins/workspace/opentelemetry-cpp/opentelemetry-cpp-dist-rawhide-lr/build/BUILD/opentelemetry-cpp-1.16.0-build/opentelemetry-cpp-1.16.0/api/include/opentelemetry/nostd/./internal/absl/types/../utility/../base/internal/invoke.h:42,
                 from /home/jenkins/workspace/opentelemetry-cpp/opentelemetry-cpp-dist-rawhide-lr/build/BUILD/opentelemetry-cpp-1.16.0-build/opentelemetry-cpp-1.16.0/api/include/opentelemetry/nostd/./internal/absl/types/../utility/utility.h:50,
                 from /home/jenkins/workspace/opentelemetry-cpp/opentelemetry-cpp-dist-rawhide-lr/build/BUILD/opentelemetry-cpp-1.16.0-build/opentelemetry-cpp-1.16.0/api/include/opentelemetry/nostd/./internal/absl/types/variant.h:46,
                 from /home/jenkins/workspace/opentelemetry-cpp/opentelemetry-cpp-dist-rawhide-lr/build/BUILD/opentelemetry-cpp-1.16.0-build/opentelemetry-cpp-1.16.0/api/include/opentelemetry/nostd/variant.h:57,
                 from /home/jenkins/workspace/opentelemetry-cpp/opentelemetry-cpp-dist-rawhide-lr/build/BUILD/opentelemetry-cpp-1.16.0-build/opentelemetry-cpp-1.16.0/api/include/opentelemetry/common/attribute_value.h:10,
                 from /home/jenkins/workspace/opentelemetry-cpp/opentelemetry-cpp-dist-rawhide-lr/build/BUILD/opentelemetry-cpp-1.16.0-build/opentelemetry-cpp-1.16.0/api/include/opentelemetry/common/key_value_iterable.h:6,
                 from /home/jenkins/workspace/opentelemetry-cpp/opentelemetry-cpp-dist-rawhide-lr/build/BUILD/opentelemetry-cpp-1.16.0-build/opentelemetry-cpp-1.16.0/api/include/opentelemetry/common/key_value_iterable_view.h:9,
                 from /home/jenkins/workspace/opentelemetry-cpp/opentelemetry-cpp-dist-rawhide-lr/build/BUILD/opentelemetry-cpp-1.16.0-build/opentelemetry-cpp-1.16.0/api/include/opentelemetry/common/kv_properties.h:6,
                 from /home/jenkins/workspace/opentelemetry-cpp/opentelemetry-cpp-dist-rawhide-lr/build/BUILD/opentelemetry-cpp-1.16.0-build/opentelemetry-cpp-1.16.0/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_environment.h:6,
                 from /home/jenkins/workspace/opentelemetry-cpp/opentelemetry-cpp-dist-rawhide-lr/build/BUILD/opentelemetry-cpp-1.16.0-build/opentelemetry-cpp-1.16.0/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_client_options.h:6,
                 from /home/jenkins/workspace/opentelemetry-cpp/opentelemetry-cpp-dist-rawhide-lr/build/BUILD/opentelemetry-cpp-1.16.0-build/opentelemetry-cpp-1.16.0/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_client.h:14,
                 from /home/jenkins/workspace/opentelemetry-cpp/opentelemetry-cpp-dist-rawhide-lr/build/BUILD/opentelemetry-cpp-1.16.0-build/opentelemetry-cpp-1.16.0/exporters/otlp/src/otlp_grpc_client.cc:4:
/home/jenkins/workspace/opentelemetry-cpp/opentelemetry-cpp-dist-rawhide-lr/build/BUILD/opentelemetry-cpp-1.16.0-build/opentelemetry-cpp-1.16.0/api/include/opentelemetry/nostd/./internal/absl/types/../utility/../base/internal/../../meta/type_traits.h:81:12: error: parse error in template argument list
   81 |     : std::integral_constant<
      |            ^~~~~~~~~~~~~~~~~~
   82 |           bool, std::is_move_constructible<
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   83 |                     type_traits_internal::SingleMemberUnion<T>>::value &&
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   84 |                     absl::is_trivially_destructible<T>::value> {};
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jenkins/workspace/opentelemetry-cpp/opentelemetry-cpp-dist-rawhide-lr/build/BUILD/opentelemetry-cpp-1.16.0-build/opentelemetry-cpp-1.16.0/api/include/opentelemetry/nostd/./internal/absl/types/../utility/../base/internal/../../meta/type_traits.h:84:55: error: expected ‘{’ before ‘::’ token
   84 |                     absl::is_trivially_destructible<T>::value> {};
      |                                                       ^~

Image: registry.fedoraproject.org/fedora:rawhide Packages installed: git cmake make gcc-c++ rpm-build rpmlint createrepo_c tree zlib-static python3-requests libcurl-devel protobuf-devel protobuf-lite-devel json-devel c-ares-devel grpc-devel cmake command:

%cmake \
    -DBUILD_TESTING:BOOL=OFF \
    -DBUILD_SHARED_LIBS:BOOL=ON \
    -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON \
    -DWITH_JAEGER:BOOL=OFF \
    -DWITH_OTLP_HTTP:BOOL=ON \
    -DWITH_OTLP_GRPC:BOOL=ON \
    -DWITH_PROMETHEUS:BOOL=OFF \
    -DWITH_ZIPKIN:BOOL=ON \
    -DWITH_EXAMPLES:BOOL=OFF \
    -DOTELCPP_PROTO_PATH:PATH=%{_builddir}/%{name}-%{version}/third_party/opentelemetry-proto \
    -DOTELCPP_VERSIONED_LIBS:BOOL=ON
kpvdr commented 5 months ago

Dockerfile.tar.gz Dockerfile for build environment:

github-actions[bot] commented 2 months ago

This issue was marked as stale due to lack of activity.