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] Failure to build with "no matching function for call to 'StrongPointer()'" #16868

Closed
veblush opened this issue May 16, 2024 · 1 comment
Assignees
Labels

Comments

@veblush
Copy link
Contributor

veblush commented May 16, 2024

What version of protobuf and what language are you using?

Protobuf commit 9f40411

What operating system (Linux, Windows, ...) and version?

Linux Debian 11 using Docker

What runtime / compiler are you using (e.g., python version or gcc version)

gcc 12

What did you do?

Build protoc using cmake

What did you expect to see

Successful build

What did you see instead?

Build failure with log

[ 53%] Building CXX object third_party/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/extension_set_heavy.cc.o
In file included from /var/local/git/grpc/third_party/protobuf/src/google/protobuf/extension_set.h:34,
                 from /var/local/git/grpc/third_party/protobuf/src/google/protobuf/descriptor.h:56,
                 from /var/local/git/grpc/third_party/protobuf/src/google/protobuf/compiler/parser.h:24,
                 from /var/local/git/grpc/third_party/protobuf/src/google/protobuf/compiler/parser.cc:14:
/var/local/git/grpc/third_party/protobuf/src/google/protobuf/port.h: In instantiation of 'void google::protobuf::internal::StrongReferenceToType() [with T = google::protobuf::UninterpretedOption]':
/var/local/git/grpc/third_party/protobuf/src/google/protobuf/message_lite.h:923:37:   required from 'const T* google::protobuf::DownCastToGenerated(const google::protobuf::MessageLite*) [with T = google::protobuf::UninterpretedOption]'
/var/local/git/grpc/third_party/protobuf/src/google/protobuf/message_lite.h:933:29:   required from 'T* google::protobuf::DownCastToGenerated(google::protobuf::MessageLite*) [with T = google::protobuf::UninterpretedOption]'
/var/local/git/grpc/third_party/protobuf/src/google/protobuf/compiler/parser.cc:1568:47:   required from here
/var/local/git/grpc/third_party/protobuf/src/google/protobuf/port.h:72:43: error: no matching function for call to 'StrongPointer()'
   72 |   return StrongPointer();
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/var/local/git/grpc/third_party/protobuf/src/google/protobuf/port.h:43:36: note: candidate: 'template void google::protobuf::internal::StrongPointer(T*)'
   43 | inline PROTOBUF_ALWAYS_INLINE void StrongPointer(T* var) {
      |                                    ^~~~~~~~~~~~~
/var/local/git/grpc/third_party/protobuf/src/google/protobuf/port.h:43:36: note:   template argument deduction/substitution failed:
/var/local/git/grpc/third_party/protobuf/src/google/protobuf/port.h:72:43: error: wrong number of template arguments (2, should be 1)
   72 |   return StrongPointer();
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/var/local/git/grpc/third_party/protobuf/src/google/protobuf/port.h:43:36: note: provided for 'template void google::protobuf::internal::StrongPointer(T*)'
   43 | inline PROTOBUF_ALWAYS_INLINE void StrongPointer(T* var) {
      |                                    ^~~~~~~~~~~~~
/var/local/git/grpc/third_party/protobuf/src/google/protobuf/port.h:54:36: note: candidate: 'template void google::protobuf::internal::StrongPointer()'
   54 | inline PROTOBUF_ALWAYS_INLINE void StrongPointer() {
      |                                    ^~~~~~~~~~~~~
/var/local/git/grpc/third_party/protobuf/src/google/protobuf/port.h:54:36: note:   template argument deduction/substitution failed:
/var/local/git/grpc/third_party/protobuf/src/google/protobuf/port.h:72:43: error: could not convert template argument 'ptr' from 'const google::protobuf::UninterpretedOption& (* const)()' to 'const google::protobuf::UninterpretedOption& (* const)()'
   72 |   return StrongPointer();
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~

Anything else we should know about your project / environment

  • You can check the PR catching this issue; [Deps] Protobuf at head grpc/grpc#36626
  • This test is running under this docker image; us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_artifact_protoc_aarch64:be8fc962f6a27ce976abecbda3dd02be4be5683d@sha256:a0f6b544c1b2fa75f73b26cb28281917153304e9df2789e93de0732494e6b651
@veblush veblush added the untriaged auto added to all issues by default when created. label May 16, 2024
@zhangskz zhangskz added c++ and removed untriaged auto added to all issues by default when created. labels May 16, 2024
@guldeMNI
Copy link

guldeMNI commented May 17, 2024

DEBUG: /home/mnidev/.cache/bazel/_bazel_mnidev/3c3a08606d72aa32889b958d96f38c5b/external/system_ruby/bundle.bzl:3:10: WARNING: no system ruby found for bundle
INFO: Analyzed 2 targets (173 packages loaded, 2259 targets configured).
ERROR: /home/mnidev/work/latest/protobuf/src/google/protobuf/compiler/BUILD.bazel:35:11: Compiling src/google/protobuf/compiler/parser.cc failed: (Exit 1): gcc failed: error executing CppCompile command (from target //src/google/protobuf/compiler:importer) /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++14' -MD -MF ... (remaining 55 arguments skipped)

Seeing this same issue. Think before commiting to main a CI test would have caught.
system:
C++
g++ (Ubuntu 11.4.0-1ubuntu122.04) 11.4.0
gcc (Ubuntu 11.4.0-1ubuntu1
22.04) 11.4.0
seems like compiler template issue - saw some notes on fixing this const pointer issue.

ERRORS:
bazel-out/k8-fastbuild/bin/src/google/protobuf/_virtual_includes/protobuf_lite/google/protobuf/message_lite.h:930:37: required from 'const T* google::protobuf::DownCastToGenerated(const google::protobuf::MessageLite*) [with T = google::protobuf::UninterpretedOption]'
bazel-out/k8-fastbuild/bin/src/google/protobuf/_virtual_includes/protobuf_lite/google/protobuf/message_lite.h:940:29: required from 'T* google::protobuf::DownCastToGenerated(google::protobuf::MessageLite*) [with T = google::protobuf::UninterpretedOption]'
src/google/protobuf/compiler/parser.cc:1568:47: required from here
bazel-out/k8-fastbuild/bin/src/google/protobuf/_virtual_includes/port/google/protobuf/port.h:72:43: error: no matching function for call to 'StrongPointer<const google::protobuf::UninterpretedOption& (* const)(), ptr>()'
72 | return StrongPointer<decltype(ptr), ptr>();
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
bazel-out/k8-fastbuild/bin/src/google/protobuf/_virtual_includes/port/google/protobuf/port.h:43:36: note: candidate: 'template void google::protobuf::internal::StrongPointer(T*)'
43 | inline PROTOBUF_ALWAYS_INLINE void StrongPointer(T* var) {
| ^~~~~~~~~~~~~
bazel-out/k8-fastbuild/bin/src/google/protobuf/_virtual_includes/port/google/protobuf/port.h:43:36: note: template argument deduction/substitution failed:
bazel-out/k8-fastbuild/bin/src/google/protobuf/_virtual_includes/port/google/protobuf/port.h:72:43: error: wrong number of template arguments (2, should be 1)
72 | return StrongPointer<decltype(ptr), ptr>();
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
bazel-out/k8-fastbuild/bin/src/google/protobuf/_virtual_includes/port/google/protobuf/port.h:43:36: note: provided for 'template void google::protobuf::internal::StrongPointer(T*)'
43 | inline PROTOBUF_ALWAYS_INLINE void StrongPointer(T* var) {
| ^~~~~~~~~~~~~
bazel-out/k8-fastbuild/bin/src/google/protobuf/_virtual_includes/port/google/protobuf/port.h:54:36: note: candidate: 'template<class T, T ptr> void google::protobuf::internal::StrongPointer()'
54 | inline PROTOBUF_ALWAYS_INLINE void StrongPointer() {
| ^~~~~~~~~~~~~
bazel-out/k8-fastbuild/bin/src/google/protobuf/_virtual_includes/port/google/protobuf/port.h:54:36: note: template argument deduction/substitution failed:
bazel-out/k8-fastbuild/bin/src/google/protobuf/_virtual_includes/port/google/protobuf/port.h:72:43: error: could not convert template argument 'ptr' from 'const google::protobuf::UninterpretedOption& (* const)()' to 'const google::protobuf::UninterpretedOption& (* const)()'
72 | return StrongPointer<decltype(ptr), ptr>();
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants