You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[C++] Add support for Protobuf 23.2 on non-Windows #35987
We can't resolve google::protobuf::internal::ThreadSafeArena::thread_cache_ with Protobuf 23.2 on non-Windows:
/Applications/Xcode_14.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../release/libarrow.a(util_avx2.cc.o) has no symbols
ld: illegal thread local variable reference to regular symbol __ZN6google8protobuf8internal15ThreadSafeArena13thread_cache_E for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Homebrew is only effected for now.
So I think that we can choose "2. Use bundled (old) Protobuf" (-DProtobuf_SOURCE=BUNDLED) and it's not a 12.0.1 release blocker.
I have a feeling that this might not be backported to the 23.x series because it's effectively an ABI break. Perhaps I'm wrong though. Anyway, in conda-forge, we set PROTOBUF_USE_DLLS also on unix to solve this.
Homebrew is only effected for now. So I think that we can choose "2. Use bundled (old) Protobuf" (-DProtobuf_SOURCE=BUNDLED) and it's not a 12.0.1 release blocker.
I am trying to run the verification tasks for MacOS from my fork:
/var/folders/dl/2sqc_b2s20vfy540jn97pz8h0000gn/T/arrow-HEAD.XXXXX.vQ2csunE/cpp-build/src/arrow/flight/Flight.pb.h:17:2: error: This file was generated by an older version of protoc which is
#error This file was generated by an older version of protoc which is
^
/var/folders/dl/2sqc_b2s20vfy540jn97pz8h0000gn/T/arrow-HEAD.XXXXX.vQ2csunE/cpp-build/src/arrow/flight/Flight.pb.h:18:2: error: incompatible with your Protocol Buffer headers. Please
#error incompatible with your Protocol Buffer headers. Please
^
/var/folders/dl/2sqc_b2s20vfy540jn97pz8h0000gn/T/arrow-HEAD.XXXXX.vQ2csunE/cpp-build/src/arrow/flight/Flight.pb.h:19:2: error: regenerate this file with a newer version of protoc.
#error regenerate this file with a newer version of protoc.
^
/var/folders/dl/2sqc_b2s20vfy540jn97pz8h0000gn/T/arrow-HEAD.XXXXX.vQ2csunE/cpp-build/src/arrow/flight/Flight.pb.h:147:30: error: no type named 'ConstStringParam' in namespace 'google::protobuf'
::PROTOBUF_NAMESPACE_ID::ConstStringParam name, FlightDescriptor_DescriptorType* value) {
~~~~~~~~~~~~~~~~~~~~~~~~~^
/var/folders/dl/2sqc_b2s20vfy540jn97pz8h0000gn/T/arrow-HEAD.XXXXX.vQ2csunE/cpp-build/src/arrow/flight/Flight.pb.h:256:35: error: no type named 'StringPiece' in namespace 'google::protobuf'
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
~~~~~~~~~~~~~~~~~~~~~~~~~^
/var/folders/dl/2sqc_b2s20vfy540jn97pz8h0000gn/T/arrow-HEAD.XXXXX.vQ2csunE/cpp-build/src/arrow/flight/Flight.pb.h:221:5: error: use of undeclared identifier 'GOOGLE_DCHECK'
GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
^
/var/folders/dl/2sqc_b2s20vfy540jn97pz8h0000gn/T/arrow-HEAD.XXXXX.vQ2csunE/cpp-build/src/arrow/flight/Flight.pb.h:257:12: error: cannot initialize return object of type 'int' with an lvalue of type 'const char [39]'
return "arrow.flight.protocol.HandshakeRequest";
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/var/folders/dl/2sqc_b2s20vfy540jn97pz8h0000gn/T/arrow-HEAD.XXXXX.vQ2csunE/cpp-build/src/arrow/flight/Flight.pb.h:420:35: error: no type named 'StringPiece' in namespace 'google::protobuf'
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
~~~~~~~~~~~~~~~~~~~~~~~~~^
/var/folders/dl/2sqc_b2s20vfy540jn97pz8h0000gn/T/arrow-HEAD.XXXXX.vQ2csunE/cpp-build/src/arrow/flight/Flight.pb.h:385:5: error: use of undeclared identifier 'GOOGLE_DCHECK'
GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
^
[ 38%] Building CXX object src/arrow/acero/CMakeFiles/arrow_acero_objlib.dir/accumulation_queue.cc.o
/var/folders/dl/2sqc_b2s20vfy540jn97pz8h0000gn/T/arrow-HEAD.XXXXX.vQ2csunE/cpp-build/src/arrow/flight/Flight.pb.h:421:12: error: cannot initialize return object of type 'int' with an lvalue of type 'const char [40]'
return "arrow.flight.protocol.HandshakeResponse";
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/var/folders/dl/2sqc_b2s20vfy540jn97pz8h0000gn/T/arrow-HEAD.XXXXX.vQ2csunE/cpp-build/src/arrow/flight/Flight.pb.h:584:35: error: no type named 'StringPiece' in namespace 'google::protobuf'
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
~~~~~~~~~~~~~~~~~~~~~~~~~^
/var/folders/dl/2sqc_b2s20vfy540jn97pz8h0000gn/T/arrow-HEAD.XXXXX.vQ2csunE/cpp-build/src/arrow/flight/Flight.pb.h:549:5: error: use of undeclared identifier 'GOOGLE_DCHECK'
GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
^
/var/folders/dl/2sqc_b2s20vfy540jn97pz8h0000gn/T/arrow-HEAD.XXXXX.vQ2csunE/cpp-build/src/arrow/flight/Flight.pb.h:585:12: error: cannot initialize return object of type 'int' with an lvalue of type 'const char [32]'
return "arrow.flight.protocol.BasicAuth";
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/var/folders/dl/2sqc_b2s20vfy540jn97pz8h0000gn/T/arrow-HEAD.XXXXX.vQ2csunE/cpp-build/src/arrow/flight/Flight.pb.h:738:35: error: no type named 'StringPiece' in namespace 'google::protobuf'
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
~~~~~~~~~~~~~~~~~~~~~~~~~^
/var/folders/dl/2sqc_b2s20vfy540jn97pz8h0000gn/T/arrow-HEAD.XXXXX.vQ2csunE/cpp-build/src/arrow/flight/Flight.pb.h:717:5: error: use of undeclared identifier 'GOOGLE_DCHECK'
GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
^
/var/folders/dl/2sqc_b2s20vfy540jn97pz8h0000gn/T/arrow-HEAD.XXXXX.vQ2csunE/cpp-build/src/arrow/flight/Flight.pb.h:739:12: error: cannot initialize return object of type 'int' with an lvalue of type 'const char [28]'
return "arrow.flight.protocol.Empty";
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/var/folders/dl/2sqc_b2s20vfy540jn97pz8h0000gn/T/arrow-HEAD.XXXXX.vQ2csunE/cpp-build/src/arrow/flight/Flight.pb.h:871:35: error: no type named 'StringPiece' in namespace 'google::protobuf'
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
~~~~~~~~~~~~~~~~~~~~~~~~~^
/var/folders/dl/2sqc_b2s20vfy540jn97pz8h0000gn/T/arrow-HEAD.XXXXX.vQ2csunE/cpp-build/src/arrow/flight/Flight.pb.h:836:5: error: use of undeclared identifier 'GOOGLE_DCHECK'
GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
^
/var/folders/dl/2sqc_b2s20vfy540jn97pz8h0000gn/T/arrow-HEAD.XXXXX.vQ2csunE/cpp-build/src/arrow/flight/Flight.pb.h:872:12: error: cannot initialize return object of type 'int' with an lvalue of type 'const char [33]'
return "arrow.flight.protocol.ActionType";
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
# ARROW-15495: Protobuf/gRPC must come from the same source
message(STATUS"Forcing gRPC_SOURCE to Protobuf_SOURCE (${Protobuf_SOURCE})")
set(gRPC_SOURCE "${Protobuf_SOURCE}")
endif()
And remove them from the Brewfile
I think that this is needed. (Or we run brew uninstall protobuf abseil grpc.)
FYI: We can specify -DProtobuf_SOURCE=BUNDLED without changing our verification script by ARROW_CMAKE_OPTIONS="-DProtobuf_SOURCE=BUNDLED dev/release/verify-release-candidate.sh ...`.
Homebrew is only effected for now. So I think that we can choose "2. Use bundled (old) Protobuf" (-DProtobuf_SOURCE=BUNDLED) and it's not a 12.0.1 release blocker.
Hi @kou, since only Homebrew is affected. Why not simply change protobuf to protobuf@21 in our brewfile?
We don't need something because the problem was happen in upstream and it was fixed in upstream.
(We may want to reject Protobuf versions that have this problem explicitly.)
Activity
kou commentedon Jun 8, 2023
Homebrew is only effected for now.
So I think that we can choose "2. Use bundled (old) Protobuf" (
-DProtobuf_SOURCE=BUNDLED) and it's not a 12.0.1 release blocker.kou commentedon Jun 8, 2023
protocolbuffers/protobuf#12699 is also related.
[-][C++] Add support for Protobuf 23.2.0 on non-Windows[/-][+][C++] Add support for Protobuf 23.2 on non-Windows[/+]h-vetinari commentedon Jun 8, 2023
I opened a very similar issue just ahead of you: #35986 ;-)
h-vetinari commentedon Jun 8, 2023
I have a feeling that this might not be backported to the 23.x series because it's effectively an ABI break. Perhaps I'm wrong though. Anyway, in conda-forge, we set
PROTOBUF_USE_DLLSalso on unix to solve this.kou commentedon Jun 8, 2023
I saw it but I think that it's a different problem. :-)
I think that it's one of workarounds.
raulcd commentedon Jun 8, 2023
I am trying to run the verification tasks for MacOS from my fork:
Adding the following patch on top of the
release-12.0.1-rc1branch:And I am getting some failures on protobuf:
Examples:
https://github.com/ursacomputing/crossbow/actions/runs/5210265087/jobs/9401119933
https://github.com/ursacomputing/crossbow/actions/runs/5210265256/jobs/9401120122
assignUser commentedon Jun 8, 2023
The error above is weird as that file is created in the cmake using protoc https://github.com/apache/arrow/blob/main/cpp/src/arrow/flight/CMakeLists.txt#L80
Maybe a system version is also found and used?
kou commentedon Jun 8, 2023
I think so too. It looks like system Protobuf and bundled Protobuf are mixed. But it's strange... Our build process uses absolute path for
protoc:https://github.com/ursacomputing/crossbow/actions/runs/5210265087/jobs/9401119933#step:4:322
raulcd commentedon Jun 8, 2023
It seems ti was GRPC. It should work if we use:
And remove them from the Brewfile as seen on this testing PR: #35995
So probably not a blocker for the 12.0.1 release?
kou commentedon Jun 9, 2023
I think that
-DgRPC_SOURCE=BUNDLEDis needless because we always use the same_SOURCEfor Protobuf and gRPC:arrow/cpp/cmake_modules/ThirdpartyToolchain.cmake
Lines 4080 to 4084 in 0bbfe98
I think that this is needed. (Or we run
brew uninstall protobuf abseil grpc.)FYI: We can specify
-DProtobuf_SOURCE=BUNDLEDwithout changing our verification script byARROW_CMAKE_OPTIONS="-DProtobuf_SOURCE=BUNDLEDdev/release/verify-release-candidate.sh ...`.I think that this is not a blocker.
js8544 commentedon Jun 10, 2023
Hi @kou, since only Homebrew is affected. Why not simply change protobuf to protobuf@21 in our brewfile?
kou commentedon Jun 10, 2023
Oh, I didn't notice it!
It's not a real fix but it'll work as a workaround for now.
Could you open a pull request for the workaround?
1 remaining item
GH-35987: [C++] Pin brew protobuf version to 21 (#36029)
kou commentedon Jun 11, 2023
Reopen this because #36029 is a workaround.
apacheGH-35987: [C++] Use old Protobuf and gRPC on macOS + Homebrew
raulcd commentedon Jun 15, 2023
@kou @js8544 from my understanding this fix on homebrew should allow us to unpin the versions of protobuf and grpc, right?
Homebrew/homebrew-core#133623
js8544 commentedon Jun 15, 2023
It probably does! I'll open a PR to try this.
js8544 commentedon Jun 15, 2023
Well, #36013 is still causing errors: https://github.com/apache/arrow/actions/runs/5277136967/jobs/9544769123?pr=36087. I'll try again once #36016 is merged.
GH-35987: [C++] Unpin brew protobuf version (#36087)
kou commentedon Jun 16, 2023
We don't need something because the problem was happen in upstream and it was fixed in upstream.
(We may want to reject Protobuf versions that have this problem explicitly.)