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

[BUILD] Build break using protoc 3.14 #3209

Closed
marcalff opened this issue Dec 17, 2024 · 0 comments · Fixed by #3211
Closed

[BUILD] Build break using protoc 3.14 #3209

marcalff opened this issue Dec 17, 2024 · 0 comments · Fixed by #3211
Assignees
Labels
bug Something isn't working triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@marcalff
Copy link
Member

[ 70%] Building CXX object exporters/otlp/CMakeFiles/otlp_recordable_test.dir/test/otlp_recordable_test.cc.o
In file included from /usr/include/gtest/gtest.h:62,
                 from /home/malff/CODE/MARC_GITHUB/opentelemetry-cpp/exporters/otlp/test/otlp_recordable_test.cc:4:
/home/malff/CODE/MARC_GITHUB/opentelemetry-cpp/exporters/otlp/test/otlp_recordable_test.cc: In member function ‘virtual void opentelemetry::v2::exporter::otlp::OtlpRecordable_SetInstrumentationScopeWithAttributes_Test::TestBody()’:
/home/malff/CODE/MARC_GITHUB/opentelemetry-cpp/exporters/otlp/test/otlp_recordable_test.cc:139:40: error: ‘const class opentelemetry::proto::common::v1::AnyValue’ has no member named ‘has_string_value’; did you mean ‘set_string_value’?
  139 |   ASSERT_TRUE(proto_attributes.value().has_string_value());
      |                                        ^~~~~~~~~~~~~~~~
make[2]: *** [exporters/otlp/CMakeFiles/otlp_recordable_test.dir/build.make:76: exporters/otlp/CMakeFiles/otlp_recordable_test.dir/test/otlp_recordable_test.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:6262: exporters/otlp/CMakeFiles/otlp_recordable_test.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

The issue with this line:

ASSERT_TRUE(proto_attributes.value().has_string_value());

is that has_string_value() was added only in protoc 3.15, and this breaks with protoc 3.14.

Now Proto3 Oneof fields have "has" methods for checking their presence in
C++.

The break can be seen also in CI in the include-what-you-use logs:

[ 76%] Building CXX object exporters/otlp/CMakeFiles/otlp_recordable_test.dir/test/otlp_recordable_test.cc.o
/home/runner/work/opentelemetry-cpp/opentelemetry-cpp/exporters/otlp/test/otlp_recordable_test.cc:139:40: error: no member named 'has_string_value' in 'opentelemetry::proto::common::v1::AnyValue'
  ASSERT_TRUE(proto_attributes.value().has_string_value());
              ~~~~~~~~~~~~~~~~~~~~~~~~ ^
@marcalff marcalff added the bug Something isn't working label Dec 17, 2024
@github-actions github-actions bot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Dec 17, 2024
@marcalff marcalff self-assigned this Dec 17, 2024
@marcalff marcalff added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant