diff --git a/ci/conda_env_cpp.txt b/ci/conda_env_cpp.txt index 24911fb35ac2..c6c507e8508c 100644 --- a/ci/conda_env_cpp.txt +++ b/ci/conda_env_cpp.txt @@ -40,7 +40,7 @@ make meson ninja nodejs>=16 -orc<2.1.0 +orc pkg-config python rapidjson diff --git a/cpp/examples/arrow/CMakeLists.txt b/cpp/examples/arrow/CMakeLists.txt index 82c075c51df1..7c31c4b29d06 100644 --- a/cpp/examples/arrow/CMakeLists.txt +++ b/cpp/examples/arrow/CMakeLists.txt @@ -126,6 +126,15 @@ if(ARROW_FLIGHT) EXTRA_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/helloworld.pb.cc" "${CMAKE_CURRENT_BINARY_DIR}/helloworld.grpc.pb.cc") + if(NOT MSVC) + # Work around absl::Mutex::Dtor ABI mismatch in debug builds against + # an NDEBUG-built Abseil. See absl_mutex_ndebug.h. + # Same issue as: + # https://github.com/apache/arrow/blob/d58f83f3131cb57ede40d99ac4d0978748d1a970/cpp/src/arrow/flight/transport/grpc/customize_grpc.h#L25-L59 + target_compile_options(flight-grpc-example + PRIVATE "SHELL:-include ${CMAKE_CURRENT_SOURCE_DIR}/absl_mutex_ndebug.h" + ) + endif() if(ARROW_FLIGHT_SQL) if(ARROW_BUILD_SHARED AND ARROW_GRPC_USE_SHARED) diff --git a/cpp/examples/arrow/absl_mutex_ndebug.h b/cpp/examples/arrow/absl_mutex_ndebug.h new file mode 100644 index 000000000000..6c6aa525313b --- /dev/null +++ b/cpp/examples/arrow/absl_mutex_ndebug.h @@ -0,0 +1,38 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#pragma once + +// Force-included into the flight-grpc-example sources (including the +// protoc-generated ones, which we can't edit). Same workaround as +// arrow/flight/transport/grpc/customize_grpc.h, added in GH-45885: +// Abseil built with NDEBUG (e.g. conda-forge) doesn't export +// Mutex::Dtor(), so debug TUs that inline ~Mutex() (via +// grpc::CompletionQueue) fail to link. +// See https://github.com/abseil/abseil-cpp/issues/1624 +// and https://github.com/conda-forge/abseil-cpp-feedstock/issues/104 +#if __has_include() +# ifndef NDEBUG +# define ARROW_EXAMPLE_NO_NDEBUG +# define NDEBUG +# endif +# include +# ifdef ARROW_EXAMPLE_NO_NDEBUG +# undef NDEBUG +# undef ARROW_EXAMPLE_NO_NDEBUG +# endif +#endif diff --git a/cpp/src/arrow/flight/flight_benchmark.cc b/cpp/src/arrow/flight/flight_benchmark.cc index aa6e16820efb..1783ed284192 100644 --- a/cpp/src/arrow/flight/flight_benchmark.cc +++ b/cpp/src/arrow/flight/flight_benchmark.cc @@ -282,7 +282,9 @@ Status DoSinglePerfRun(FlightClient* client, const FlightClientOptions client_op // Plan the query FlightDescriptor descriptor; descriptor.type = FlightDescriptor::CMD; - perf.SerializeToString(&descriptor.cmd); + if (!perf.SerializeToString(&descriptor.cmd)) { + return Status::Invalid("cannot serialize perf command"); + } ARROW_ASSIGN_OR_RAISE(auto plan, client->GetFlightInfo(call_options, descriptor)); @@ -307,7 +309,9 @@ Status DoSinglePerfRun(FlightClient* client, const FlightClientOptions client_op } perf::Token token; - token.ParseFromString(endpoint.ticket.ticket); + if (!token.ParseFromString(endpoint.ticket.ticket)) { + return Status::Invalid("cannot parse ticket"); + } const auto& result = test_loop(data_client, call_options, token, endpoint, stats); if (result.ok()) {