diff --git a/cpp/examples/arrow/flight_grpc_example.cc b/cpp/examples/arrow/flight_grpc_example.cc index 1e706560818..3aea91dadae 100644 --- a/cpp/examples/arrow/flight_grpc_example.cc +++ b/cpp/examples/arrow/flight_grpc_example.cc @@ -22,6 +22,27 @@ #include #include #include + +// HACK: Workaround absl::Mutex ABI incompatibility by making sure the +// non-debug version of Abseil is included +// (https://github.com/conda-forge/abseil-cpp-feedstock/issues/104, +// https://github.com/abseil/abseil-cpp/issues/1624) + +#if __has_include() + +# ifndef NDEBUG +# define ARROW_NO_NDEBUG +# define NDEBUG +# endif + +# include + +# ifdef ARROW_NO_NDEBUG +# undef NDEBUG +# endif + +#endif + #include #include "examples/arrow/helloworld.grpc.pb.h" diff --git a/cpp/src/arrow/flight/transport/grpc/customize_grpc.h b/cpp/src/arrow/flight/transport/grpc/customize_grpc.h index 153aa5ae1da..7836f7c161d 100644 --- a/cpp/src/arrow/flight/transport/grpc/customize_grpc.h +++ b/cpp/src/arrow/flight/transport/grpc/customize_grpc.h @@ -20,6 +20,26 @@ #include #include +// HACK: Workaround absl::Mutex ABI incompatibility by making sure the +// non-debug version of Abseil is included +// (https://github.com/conda-forge/abseil-cpp-feedstock/issues/104, +// https://github.com/abseil/abseil-cpp/issues/1624) + +#if __has_include() + +# ifndef NDEBUG +# define ARROW_NO_NDEBUG +# define NDEBUG +# endif + +# include + +# ifdef ARROW_NO_NDEBUG +# undef NDEBUG +# endif + +#endif + #include "arrow/flight/platform.h" #include "arrow/flight/type_fwd.h" #include "arrow/flight/visibility.h" diff --git a/cpp/src/arrow/flight/transport/grpc/grpc_client.cc b/cpp/src/arrow/flight/transport/grpc/grpc_client.cc index 0f489fd1657..6cf3242b070 100644 --- a/cpp/src/arrow/flight/transport/grpc/grpc_client.cc +++ b/cpp/src/arrow/flight/transport/grpc/grpc_client.cc @@ -28,6 +28,8 @@ #include #include +#include "arrow/flight/transport/grpc/customize_grpc.h" + #include #include #if defined(GRPC_NAMESPACE_FOR_TLS_CREDENTIALS_OPTIONS) diff --git a/cpp/src/arrow/flight/transport/grpc/grpc_server.cc b/cpp/src/arrow/flight/transport/grpc/grpc_server.cc index 28fc736aa00..3cc854b58fe 100644 --- a/cpp/src/arrow/flight/transport/grpc/grpc_server.cc +++ b/cpp/src/arrow/flight/transport/grpc/grpc_server.cc @@ -25,6 +25,8 @@ #include #include +#include "arrow/flight/transport/grpc/customize_grpc.h" + #include #include "arrow/buffer.h"