Skip to content
New issue

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

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

Already on GitHub? # to your account

grpc 1.53.0 causing absl string_view errors #2075

Closed
compoundradius opened this issue Mar 27, 2023 · 2 comments
Closed

grpc 1.53.0 causing absl string_view errors #2075

compoundradius opened this issue Mar 27, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@compoundradius
Copy link

Describe your environment Describe any aspect of your environment relevant to the problem, including your platform, build system, version numbers of installed dependencies, etc. If you're reporting a problem with a specific version of a library in this repo, please check whether the problem has been fixed on main branch.

Steps to reproduce
Describe exactly how to reproduce the error. Include a code sample if applicable.

git clone --recurse-submodules -b v1.8.2 --depth 1 --shallow-submodules https://github.com/open-telemetry/opentelemetry-cpp && \
    cd opentelemetry-cpp && \
    CC="clang-16" CXX="clang++-16" cmake -S . -B build -GNinja \
    -DWITH_OTLP=ON \
    -DWITH_BENCHMARK=OFF \
    -DOPENTELEMETRY_INSTALL=ON \
    -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=mold" \
    -DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=mold" \
    -DCMAKE_MODULE_LINKER_FLAGS="-fuse-ld=mold" && \
    cmake --build build && \
    cmake --install build 

What is the expected behavior?
What did you expect to see?
Successful compilation.

NOTE: grpc version 1.52.1 and opentelemetry-cpp 1.8.2 work properly together.
grpc 1.53.0 and opentelemetry-cpp 1.82 the following error occurs.

What is the actual behavior?
What did you see instead?

[44/308] Building CXX object CMakeFiles/opentelemetry_proto.dir/generated/third_party/opentelemetry-proto/opentelemetry/proto/collector/metrics/v1/metrics_service.grpc.pb.cc.o
FAILED: CMakeFiles/opentelemetry_proto.dir/generated/third_party/opentelemetry-proto/opentelemetry/proto/collector/metrics/v1/metrics_service.grpc.pb.cc.o 
/usr/bin/clang++-16 -DENABLE_TEST -I/opentelemetry-cpp/build/generated/third_party/opentelemetry-proto -I/opentelemetry-cpp/api/include -I/opentelemetry-cpp/sdk/include -I/opentelemetry-cpp/sdk -I/opentelemetry-cpp/ext/include -Wno-error=deprecated-declarations -Wno-type-limits -Wno-deprecated-declarations -Wno-unused-parameter -std=gnu++11 -MD -MT CMakeFiles/opentelemetry_proto.dir/generated/third_party/opentelemetry-proto/opentelemetry/proto/collector/metrics/v1/metrics_service.grpc.pb.cc.o -MF CMakeFiles/opentelemetry_proto.dir/generated/third_party/opentelemetry-proto/opentelemetry/proto/collector/metrics/v1/metrics_service.grpc.pb.cc.o.d -o CMakeFiles/opentelemetry_proto.dir/generated/third_party/opentelemetry-proto/opentelemetry/proto/collector/metrics/v1/metrics_service.grpc.pb.cc.o -c /opentelemetry-cpp/build/generated/third_party/opentelemetry-proto/opentelemetry/proto/collector/metrics/v1/metrics_service.grpc.pb.cc
In file included from /opentelemetry-cpp/build/generated/third_party/opentelemetry-proto/opentelemetry/proto/collector/metrics/v1/metrics_service.grpc.pb.cc:6:
In file included from /opentelemetry-cpp/build/generated/third_party/opentelemetry-proto/opentelemetry/proto/collector/metrics/v1/metrics_service.grpc.pb.h:25:
In file included from /usr/local/include/grpcpp/generic/async_generic_service.h:24:
In file included from /usr/local/include/grpcpp/impl/server_callback_handlers.h:24:
In file included from /usr/local/include/grpcpp/server_context.h:34:
In file included from /usr/local/include/grpcpp/impl/call_op_set.h:32:
In file included from /usr/local/include/grpcpp/client_context.h:47:
In file included from /usr/local/include/grpcpp/impl/sync.h:30:
In file included from /usr/local/include/absl/synchronization/mutex.h:67:
In file included from /usr/local/include/absl/base/const_init.h:25:
In file included from /usr/local/include/absl/base/config.h:86:
/usr/local/include/absl/base/policy_checks.h:79:2: error: "C++ versions less than C++14 are not supported."
#error "C++ versions less than C++14 are not supported."

....

/usr/local/include/absl/time/civil_time.h:489:27: error: no type named 'string_view' in namespace 'absl'
bool ParseCivilTime(absl::string_view s, CivilSecond* c);
                    ~~~~~~^
/usr/local/include/absl/time/civil_time.h:490:27: error: no type named 'string_view' in namespace 'absl'
bool ParseCivilTime(absl::string_view s, CivilMinute* c);
                    ~~~~~~^
/usr/local/include/absl/time/civil_time.h:491:27: error: no type named 'string_view' in namespace 'absl'
bool ParseCivilTime(absl::string_view s, CivilHour* c);
                    ~~~~~~^
/usr/local/include/absl/time/civil_time.h:492:27: error: no type named 'string_view' in namespace 'absl'
bool ParseCivilTime(absl::string_view s, CivilDay* c);
                    ~~~~~~^
/usr/local/include/absl/time/civil_time.h:493:27: error: no type named 'string_view' in namespace 'absl'
bool ParseCivilTime(absl::string_view s, CivilMonth* c);
                    ~~~~~~^
/usr/local/include/absl/time/civil_time.h:494:27: error: no type named 'string_view' in namespace 'absl'
bool ParseCivilTime(absl::string_view s, CivilYear* c);
                    ~~~~~~^
/usr/local/include/absl/time/civil_time.h:509:34: error: no type named 'string_view' in namespace 'absl'
bool ParseLenientCivilTime(absl::string_view s, CivilSecond* c);
                           ~~~~~~^
/usr/local/include/absl/time/civil_time.h:510:34: error: no type named 'string_view' in namespace 'absl'
bool ParseLenientCivilTime(absl::string_view s, CivilMinute* c);
                           ~~~~~~^
/usr/local/include/absl/time/civil_time.h:511:34: error: no type named 'string_view' in namespace 'absl'
bool ParseLenientCivilTime(absl::string_view s, CivilHour* c);
                           ~~~~~~^
/usr/local/include/absl/time/civil_time.h:512:34: error: no type named 'string_view' in namespace 'absl'
bool ParseLenientCivilTime(absl::string_view s, CivilDay* c);
                           ~~~~~~^
/usr/local/include/absl/time/civil_time.h:513:34: error: no type named 'string_view' in namespace 'absl'
bool ParseLenientCivilTime(absl::string_view s, CivilMonth* c);
                           ~~~~~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]

Additional context
Add any other context about the problem here.

@compoundradius compoundradius added the bug Something isn't working label Mar 27, 2023
@lalitb
Copy link
Member

lalitb commented Mar 27, 2023

Looking into this error:

/usr/local/include/absl/base/policy_checks.h:79:2: error: "C++ versions less than C++14 are not supported."

clang-16 supports C++14. Did you try building with -DCMAKE_CXX_STANDARD=14 option?
But not sure if this will fix the absl string_view error.

@compoundradius
Copy link
Author

Resovled with:

-DABSL_PROPAGATE_CXX_STD=ON \
-DCMAKE_CXX_STANDARD=14 \

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

No branches or pull requests

2 participants