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

1.15.0 release build failed to build with protobuf 26.1 #2643

Open
chenrui333 opened this issue Apr 22, 2024 · 9 comments
Open

1.15.0 release build failed to build with protobuf 26.1 #2643

chenrui333 opened this issue Apr 22, 2024 · 9 comments
Labels
Stale triage/needs-information Indicates an issue needs more information in order to work on it.

Comments

@chenrui333
Copy link

👋 trying to build the latest release, but run into some build issue. The error log is as below:

error build log
/opt/homebrew/Library/Homebrew/shims/mac/super/clang++ -DPROTOBUF_USE_DLLS -Dopentelemetry_proto_EXPORTS -I/tmp/opentelemetry-cpp-20240422-40679-8q5ewu/opentelemetry-cpp-1.15.0/build/generated/third_party/opentelemetry-proto -I/tmp/opentelemetry-cpp-20240422-40679-8q5ewu/opentelemetry-cpp-1.15.0/api/include -I/tmp/opentelemetry-cpp-20240422-40679-8q5ewu/opentelemetry-cpp-1.15.0/sdk/include -I/tmp/opentelemetry-cpp-20240422-40679-8q5ewu/opentelemetry-cpp-1.15.0/sdk -I/tmp/opentelemetry-cpp-20240422-40679-8q5ewu/opentelemetry-cpp-1.15.0/ext/include -O3 -DNDEBUG -std=gnu++17 -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -fPIC -Wno-error=deprecated-declarations -Wno-type-limits -Wno-deprecated-declarations -Wno-unused-parameter -MD -MT CMakeFiles/opentelemetry_proto.dir/generated/third_party/opentelemetry-proto/opentelemetry/proto/collector/trace/v1/trace_service.pb.cc.o -MF CMakeFiles/opentelemetry_proto.dir/generated/third_party/opentelemetry-proto/opentelemetry/proto/collector/trace/v1/trace_service.pb.cc.o.d -o CMakeFiles/opentelemetry_proto.dir/generated/third_party/opentelemetry-proto/opentelemetry/proto/collector/trace/v1/trace_service.pb.cc.o -c /tmp/opentelemetry-cpp-20240422-40679-8q5ewu/opentelemetry-cpp-1.15.0/build/generated/third_party/opentelemetry-proto/opentelemetry/proto/collector/trace/v1/trace_service.pb.cc
In file included from /tmp/opentelemetry-cpp-20240422-40679-8q5ewu/opentelemetry-cpp-1.15.0/build/generated/third_party/opentelemetry-proto/opentelemetry/proto/common/v1/common.pb.cc:5:
In file included from /tmp/opentelemetry-cpp-20240422-40679-8q5ewu/opentelemetry-cpp-1.15.0/build/generated/third_party/opentelemetry-proto/opentelemetry/proto/common/v1/common.pb.h:23:
In file included from /opt/homebrew/include/google/protobuf/generated_message_tctable_decl.h:23:
In file included from /opt/homebrew/include/google/protobuf/parse_context.h:27:
/opt/homebrew/include/google/protobuf/implicit_weak_message.h:44:33: error: no type named 'InternalVisibility' in namespace 'google::protobuf::internal'
  ImplicitWeakMessage(internal::InternalVisibility, Arena* arena)
                      ~~~~~~~~~~^
In file included from /tmp/opentelemetry-cpp-20240422-40679-8q5ewu/opentelemetry-cpp-1.15.0/build/generated/third_party/opentelemetry-proto/opentelemetry/proto/resource/v1/resource.pb.cc:5:
In file included from /tmp/opentelemetry-cpp-20240422-40679-8q5ewu/opentelemetry-cpp-1.15.0/build/generated/third_party/opentelemetry-proto/opentelemetry/proto/resource/v1/resource.pb.h:23:
In file included from /opt/homebrew/include/google/protobuf/generated_message_tctable_decl.h:23:
In file included from /opt/homebrew/include/google/protobuf/parse_context.h:27:
/opt/homebrew/include/google/protobuf/implicit_weak_message.h:44:33: error: no type named 'InternalVisibility' in namespace 'google::protobuf::internal'
  ImplicitWeakMessage(internal::InternalVisibility, Arena* arena)
                      ~~~~~~~~~~^
/opt/homebrew/include/google/protobuf/implicit_weak_message.h:59:9: error: unknown type name 'ClassData'
  const ClassData* GetClassData() const final {
        ^
/opt/homebrew/include/google/protobuf/implicit_weak_message.h:74:40: error: non-virtual member function marked 'override' hides virtual member function
  MessageLite* New(Arena* arena) const override {
                                       ^
/opt/homebrew/include/google/protobuf/message_lite.h:83:24: note: hidden overloaded virtual function 'google::protobuf::MessageLite::New' declared here: different number of parameters (0 vs 1)
  virtual MessageLite* New() const = 0;
                       ^
/opt/homebrew/include/google/protobuf/implicit_weak_message.h:59:9: error: unknown type name 'ClassData'
  const ClassData* GetClassData() const final {
        ^
/opt/homebrew/include/google/protobuf/implicit_weak_message.h:74:40: error: non-virtual member function marked 'override' hides virtual member function
  MessageLite* New(Arena* arena) const override {
                                       ^
/opt/homebrew/include/google/protobuf/message_lite.h:83:24: note: hidden overloaded virtual function 'google::protobuf::MessageLite::New' declared here: different number of parameters (0 vs 1)
  virtual MessageLite* New() const = 0;
                       ^

full build log, https://github.com/Homebrew/homebrew-core/actions/runs/8775690834/job/24083917227?pr=169703
relates to Homebrew/homebrew-core#169703

@github-actions github-actions bot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Apr 22, 2024
@marcalff
Copy link
Member

See related:

@marcalff
Copy link
Member

marcalff commented Apr 22, 2024

See related:

* [Test build: protobuf 26.1 #2644](https://github.com/open-telemetry/opentelemetry-cpp/pull/2644)

So, this test build was done to try to reproduce the issue.

The problem is that the build fails to install grpc after protobuf, so that the compiling opentelemetry-cpp with protobuf 26.1 is not even attempted.

In short, the test build is inconclusive, it fails for a different reason.

@marcalff
Copy link
Member

Looking at the original error reported, the compiler complains about a protobuf declaration found in protobuf related code ... Nothing related to opentelemetry-cpp.

In particular:

/opt/homebrew/include/google/protobuf/implicit_weak_message.h:44:33: error: no type named 'InternalVisibility' in namespace 'google::protobuf::internal'
  ImplicitWeakMessage(internal::InternalVisibility, Arena* arena)

is an issue with protobuf.

I would suspect there are multiple versions of protobuf installed on the machine used to perform the build.

@marcalff marcalff added the triage/needs-information Indicates an issue needs more information in order to work on it. label Apr 22, 2024
@marcalff
Copy link
Member

Please indicate which version is used for:

  • abseil
  • protobuf
  • grpc (if used)

and indicate the compiling options used in CMake.

@marcalff marcalff removed the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Apr 22, 2024
@chenrui333
Copy link
Author

abseil: 20240116.2
protobuf 26.1
grpc 1.62.2

this is the full cmake build

==> cmake -S . -B build -DCMAKE_CXX_STANDARD=17 -DCMAKE_INSTALL_RPATH=@loader_path/../lib -DBUILD_TESTING=OFF -DWITH_ELASTICSEARCH=ON -DWITH_EXAMPLES=OFF -DWITH_JAEGER=OFF -DWITH_METRICS_PREVIEW=ON -DWITH_OTLP_GRPC=ON -DWITH_OTLP_HTTP=ON -DWITH_ABSEIL=ON -DWITH_PROMETHEUS=ON -DCMAKE_INSTALL_PREFIX=/opt/homebrew/Cellar/opentelemetry-cpp/1.15.0 -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=ON -DFETCHCONTENT_FULLY_DISCONNECTED=ON -Wno-dev -DBUILD_TESTING=OFF -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk

@owent
Copy link
Member

owent commented Apr 26, 2024

I found the versions of utf8_range in protobuf v26 and gRPC 1.62 are different and the headers with same name will be conflict with each other. I'm trying to create a small patch for gRPC to support this situation.

If there are any further results, I will post them here.

@chenrui333
Copy link
Author

Thanks @owent!

@owent
Copy link
Member

owent commented Apr 29, 2024

I use this patch file for gRPC v1.62.2 and it works now.

diff --git a/third_party/upb/upb/wire/internal/decode.h b/third_party/upb/upb/wire/internal/decode.h
index a058ecb..770c8a2 100644
--- a/third_party/upb/upb/wire/internal/decode.h
+++ b/third_party/upb/upb/wire/internal/decode.h
@@ -17,7 +17,7 @@
 #include "upb/message/internal/message.h"
 #include "upb/wire/decode.h"
 #include "upb/wire/eps_copy_input_stream.h"
-#include "utf8_range.h"
+#include "../utf8_range/utf8_range.h"
 
 // Must be last.
 #include "upb/port/def.inc"

This works on Windows, Linux with clang and gcc, macOS, Android and iOS.

Another problem is that the files /opt/homebrew/lib/cmake/OpenSSL/* in macOS environment of github action are invalid and will broke find_package(OpenSSL). I use [ -e /opt/homebrew/lib/cmake/OpenSSL ] && rm -rf /opt/homebrew/lib/cmake/OpenSSL to remove them and it then works.

They are all not the problems of otel-cpp.

More details can be found here: https://github.com/owent/cmake-toolset/actions/runs/8877326057

Hope it's helpful.

Copy link

github-actions bot commented Jul 1, 2024

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

@github-actions github-actions bot added the Stale label Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale triage/needs-information Indicates an issue needs more information in order to work on it.
Projects
None yet
Development

No branches or pull requests

3 participants