open-telemetry / open-telemetry/opentelemetry-cpp

Internal abseil code compile error on gcc 14

Open
#2,723 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Stale triage/accepted
Dominant language
C++
Stars
1.4k
Forks
632
Avg merge
1d 13h
Merged PRs (30d)
75

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the CMake build on Fedora with GCC 14, with WITH_ABSEIL omitted and no abseil packages installed. Read api/include/opentelemetry/nostd/internal/absl/meta/type_traits.h around the reported template error and compare the internal-abseil path with the external-package workaround. Done means the internal-abseil build completes successfully under GCC 14.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp, fedora
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.