Skip to content

Commit 2b331bd

Browse files
committed
Use @pitrou solution to abseil symbol visibility issue
1 parent 3157818 commit 2b331bd

File tree

4 files changed

+45
-0
lines changed

4 files changed

+45
-0
lines changed

cpp/examples/arrow/flight_grpc_example.cc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,27 @@
2222
#include <arrow/api.h>
2323
#include <arrow/flight/api.h>
2424
#include <gflags/gflags.h>
25+
26+
// HACK: Workaround absl::Mutex ABI incompatibility by making sure the
27+
// non-debug version of Abseil is included
28+
// (https://github.com/conda-forge/abseil-cpp-feedstock/issues/104,
29+
// https://github.com/abseil/abseil-cpp/issues/1624)
30+
31+
#if __has_include(<absl/synchronization/mutex.h>)
32+
33+
# ifndef NDEBUG
34+
# define ARROW_NO_NDEBUG
35+
# define NDEBUG
36+
# endif
37+
38+
# include <absl/synchronization/mutex.h>
39+
40+
# ifdef ARROW_NO_NDEBUG
41+
# undef NDEBUG
42+
# endif
43+
44+
#endif
45+
2546
#include <grpc++/grpc++.h>
2647

2748
#include "examples/arrow/helloworld.grpc.pb.h"

cpp/src/arrow/flight/transport/grpc/customize_grpc.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,26 @@
2020
#include <limits>
2121
#include <memory>
2222

23+
// HACK: Workaround absl::Mutex ABI incompatibility by making sure the
24+
// non-debug version of Abseil is included
25+
// (https://github.com/conda-forge/abseil-cpp-feedstock/issues/104,
26+
// https://github.com/abseil/abseil-cpp/issues/1624)
27+
28+
#if __has_include(<absl/synchronization/mutex.h>)
29+
30+
# ifndef NDEBUG
31+
# define ARROW_NO_NDEBUG
32+
# define NDEBUG
33+
# endif
34+
35+
# include <absl/synchronization/mutex.h>
36+
37+
# ifdef ARROW_NO_NDEBUG
38+
# undef NDEBUG
39+
# endif
40+
41+
#endif
42+
2343
#include "arrow/flight/platform.h"
2444
#include "arrow/flight/type_fwd.h"
2545
#include "arrow/flight/visibility.h"

cpp/src/arrow/flight/transport/grpc/grpc_client.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
#include <unordered_map>
2929
#include <utility>
3030

31+
#include "arrow/flight/transport/grpc/customize_grpc.h"
32+
3133
#include <grpcpp/grpcpp.h>
3234
#include <grpcpp/support/client_callback.h>
3335
#if defined(GRPC_NAMESPACE_FOR_TLS_CREDENTIALS_OPTIONS)

cpp/src/arrow/flight/transport/grpc/grpc_server.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
#include <unordered_map>
2626
#include <utility>
2727

28+
#include "arrow/flight/transport/grpc/customize_grpc.h"
29+
2830
#include <grpcpp/grpcpp.h>
2931

3032
#include "arrow/buffer.h"

0 commit comments

Comments
 (0)