Hi folks,

I'm not familiar yet with all of the details of how Protobuf is set up to be 
built and included or whether there's a subtle difference between the CMake 
targets (headers vs cc sources), but we've recently gone and started touching 
some of the Protobuf types from a C++ header and are seeing build issues 
stemming from Protobuf-internal symbols/macros not being properly in scope.

Working with /cpp/src/arrow/flight/sql/client.h we've included 
"arrow/flight/sql/FlightSql.pb.h" (this may itself be an issue, but using 
<google/protobuf/any.pb.g was not exposing generated types from sql/FlightSql), 
and we're seeing the following:

[1/4] Building CXX object 
src/arrow/flight/sql/CMakeFiles/arrow_flight_sql_objlib.dir/client.cc.o
FAILED: src/arrow/flight/sql/CMakeFiles/arrow_flight_sql_objlib.dir/client.cc.o
/opt/homebrew/bin/ccache /Library/Developer/CommandLineTools/usr/bin/c++ 
-DARROW_EXTRA_ERROR_CONTEXT -DARROW_FLIGHT_SQL_EXPORTING -DARROW_HAVE_NEON 
-DARROW_WITH_RE2 -DARROW_WITH_TIMING_TESTS -DARROW_WITH_ZLIB 
-DGRPC_NAMESPACE_FOR_TLS_CREDENTIALS_OPTIONS=grpc::experimental 
-DGRPC_USE_CERTIFICATE_VERIFIER -DGRPC_USE_TLS_CHANNEL_CREDENTIALS_OPTIONS 
-DURI_STATIC_BUILD 
-I/Users/pauln/bq/git/arrow/cpp/session-managemen-build-debug/src 
-I/Users/pauln/bq/git/arrow/cpp/src 
-I/Users/pauln/bq/git/arrow/cpp/src/generated -isystem /opt/homebrew/include 
-isystem /Users/pauln/bq/git/arrow/cpp/thirdparty/flatbuffers/include -isystem 
/Users/pauln/bq/git/arrow/cpp/thirdparty/hadoop/include -isystem 
/opt/homebrew/opt/openssl@1.1/include -isystem 
/Users/pauln/bq/git/arrow/cpp/session-managemen-build-debug/jemalloc_ep-prefix/src
 -fno-aligned-new  -Qunused-arguments -fcolor-diagnostics  -Wall -Wextra 
-Wdocumentation -Wshorten-64-to-32 -Wno-missing-braces -Wno-unused-parameter 
-Wno-constant-logical-operand -Wno-return-stack-address 
-Wno-unknown-warning-option -Wno-pass-failed -march=armv8-a  -g -Werror -O0 
-ggdb -arch arm64 -isysroot 
/Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk -fPIC -std=c++17 -MD 
-MT src/arrow/flight/sql/CMakeFiles/arrow_flight_sql_objlib.dir/client.cc.o -MF 
src/arrow/flight/sql/CMakeFiles/arrow_flight_sql_objlib.dir/client.cc.o.d -o 
src/arrow/flight/sql/CMakeFiles/arrow_flight_sql_objlib.dir/client.cc.o -c 
/Users/pauln/bq/git/arrow/cpp/src/arrow/flight/sql/client.cc
In file included from 
/Users/pauln/bq/git/arrow/cpp/src/arrow/flight/sql/client.cc:22:
In file included from 
/Users/pauln/bq/git/arrow/cpp/src/arrow/flight/sql/client.h:24:
/Users/pauln/bq/git/arrow/cpp/session-managemen-build-debug/src/arrow/flight/sql/FlightSql.pb.h:47:3:
 error: expected expression
  static const uint32_t offsets[];
  ^
/Users/pauln/bq/git/arrow/cpp/session-managemen-build-debug/src/arrow/flight/sql/FlightSql.pb.h:46:32:
 error: variable has incomplete type 'struct ARROW_FLIGHT_SQL_EXPORT'
struct ARROW_FLIGHT_SQL_EXPORT TableStruct_FlightSql_2eproto {
                               ^
/Users/pauln/bq/git/arrow/cpp/session-managemen-build-debug/src/arrow/flight/sql/FlightSql.pb.h:46:8:
 note: forward declaration of 'ARROW_FLIGHT_SQL_EXPORT'
struct ARROW_FLIGHT_SQL_EXPORT TableStruct_FlightSql_2eproto {
       ^
/Users/pauln/bq/git/arrow/cpp/session-managemen-build-debug/src/arrow/flight/sql/FlightSql.pb.h:49:73:
 error: no member named 'DescriptorTable' in namespace 
'google::protobuf::internal'
ARROW_FLIGHT_SQL_EXPORT extern const 
::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable 
descriptor_table_FlightSql_2eproto;
                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/Users/pauln/bq/git/arrow/cpp/session-managemen-build-debug/src/arrow/flight/sql/FlightSql.pb.h:49:88:
 error: expected ';' after top level declarator
ARROW_FLIGHT_SQL_EXPORT extern const 
::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable 
descriptor_table_FlightSql_2eproto;
[...]


Any insight or suggestions are welcome here!

Cheers
Paul

Reply via email to