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

Protobuf 3.21.4 is compiled instead of using system protobuf #10112

Closed
karteekmurthys opened this issue Jun 7, 2024 · 5 comments
Closed

Protobuf 3.21.4 is compiled instead of using system protobuf #10112

karteekmurthys opened this issue Jun 7, 2024 · 5 comments
Assignees
Labels
bug Something isn't working triage Newly created issue that needs attention.

Comments

@karteekmurthys
Copy link
Collaborator

Bug description

Building latest velox on mac is causing this issue:

FAILED: _deps/protobuf-build/CMakeFiles/libprotobuf.dir/src/google/protobuf/generated_message_tctable_lite.cc.o 
ccache /Library/Developer/CommandLineTools/usr/bin/c++ -DFOLLY_HAVE_INT128_T=1 -DGOOGLE_PROTOBUF_CMAKE_BUILD -DHAVE_ZLIB -I/Users/karteek/workspace/kart-presto/presto-native-execution/. -I/Users/karteek/workspace/kart-presto/presto-native-execution/velox -I/Users/karteek/workspace/kart-presto/presto-native-execution/velox/velox/external/xxhash -I/Users/karteek/workspace/kart-presto/presto-native-execution/_build/debug/velox -I/Users/karteek/workspace/kart-presto/presto-native-execution/_build/debug -I/Users/karteek/workspace/kart-presto/presto-native-execution/_build/debug/_deps/protobuf-build -I/Users/karteek/workspace/kart-presto/presto-native-execution/_build/debug/_deps/protobuf-src/src -isystem /opt/homebrew/include -isystem /Users/karteek/velox/deps/include -isystem /opt/homebrew/opt/openssl@1.1/include -isystem /Users/karteek/velox/deps/include/proxygen -mcpu=apple-m1+crc -std=c++17 -fvisibility=hidden -fvisibility=hidden -fvisibility-inlines-hidden -Werror -Wno-nullability-completeness -Wno-deprecated-declarations -Wreorder -mcpu=apple-m1+crc -std=c++17 -fvisibility=hidden -fvisibility=hidden -fvisibility-inlines-hidden -D USE_VELOX_COMMON_BASE -D HAS_UNCAUGHT_EXCEPTIONS -Wall -Wextra -Wno-unused        -Wno-unused-parameter        -Wno-sign-compare        -Wno-ignored-qualifiers        -Wno-range-loop-analysis          -Wno-mismatched-tags          -Wno-nullability-completeness -g -std=c++11 -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.2.sdk -fPIC -MD -MT _deps/protobuf-build/CMakeFiles/libprotobuf.dir/src/google/protobuf/generated_message_tctable_lite.cc.o -MF _deps/protobuf-build/CMakeFiles/libprotobuf.dir/src/google/protobuf/generated_message_tctable_lite.cc.o.d -o _deps/protobuf-build/CMakeFiles/libprotobuf.dir/src/google/protobuf/generated_message_tctable_lite.cc.o -c /Users/karteek/workspace/kart-presto/presto-native-execution/_build/debug/_deps/protobuf-src/src/google/protobuf/generated_message_tctable_lite.cc
In file included from /Users/karteek/workspace/kart-presto/presto-native-execution/_build/debug/_deps/protobuf-src/src/google/protobuf/generated_message_tctable_lite.cc:36:
/Users/karteek/workspace/kart-presto/presto-native-execution/_build/debug/_deps/protobuf-src/src/google/protobuf/generated_message_tctable_impl.h:256:1: error: function declared 'noreturn' should not return [-Werror,-Winvalid-noreturn]
}
^
/Users/karteek/workspace/kart-presto/presto-native-execution/_build/debug/_deps/protobuf-src/src/google/protobuf/generated_message_tctable_lite.cc:57:15: note: in instantiation of function template specialization 'google::protobuf::internal::AlignFail<4UL>' requested here
template void AlignFail<4>(uintptr_t);
              ^
}
^
/Users/karteek/workspace/kart-presto/presto-native-execution/_build/debug/_deps/protobuf-src/src/google/protobuf/generated_message_tctable_impl.h:384:7: note: in instantiation of function template specialization 'google::protobuf::internal::AlignFail<1UL>' requested here
      AlignFail<alignof(T)>(reinterpret_cast<uintptr_t>(target));
      ^
/Users/karteek/workspace/kart-presto/presto-native-execution/_build/debug/_deps/protobuf-src/src/google/protobuf/generated_message_tctable_lite.cc:1515:5: note: in instantiation of function template specialization 'google::protobuf::internal::TcParser::RefAt<bool>' requested here
    RefAt<bool>(msg, entry.offset) = static_cast<bool>(tmp);

We brew install protobuf@21 in our setup scripts but we build protobuf 3.21.4 due to this change: #9072

It marks the version to beEXACT 3.21.4. Removing EXACT term seem to help the issue.

@czentgr Thanks for pointing this out.

System information

macOS.

Relevant logs

No response

@karteekmurthys karteekmurthys added bug Something isn't working triage Newly created issue that needs attention. labels Jun 7, 2024
@karteekmurthys karteekmurthys self-assigned this Jun 7, 2024
@assignUser
Copy link
Collaborator

I can't say anything with regards to the pinned version and if deviating from it could cause issues @kgpai ?
But in regards to the issue:
error: function declared 'noreturn' should not return [-Werror,-Winvalid-noreturn]
There should be no -Werror in the cxxflags at that point and I have built velox with that config to test and the build does not fail.

Are you building this as part of another project or do you have -Werror in your global env?

@karteekmurthys
Copy link
Collaborator Author

I'm building in the Prestissimo context and I am not adding any explicit compiler flags. AFAIK we install protobuf as part of our mac setup and expect it to be found by CMAKE. Since it is pinned EXACT 3.21.4 and scripts install latest 3.21 we are forced to build in Prestissimo.

@assignUser
Copy link
Collaborator

It's prestissimo https://github.com/prestodb/presto/blob/master/presto-native-execution/CMakeLists.txt#L31-L33 @majetideepak that should be moved to L191 after the velox include to prevent this error.

Since it is pinned EXACT 3.21.4 and scripts install latest 3.21 we are forced to build in Prestissimo.

As I said before I don't know if this is ok to change but am not strictly opposed :)

@majetideepak
Copy link
Collaborator

should be moved to L191 after the velox include to prevent this error.

Fixed here prestodb/presto#22966

@assignUser
Copy link
Collaborator

The PR in presto fixing this is merged so I am closing this issue.

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 Newly created issue that needs attention.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants