Skip to content

GH-46141: Add flight directory to Meson configuration #46142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions cpp/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ project(
meson_version: '>=1.3.0',
default_options: [
'buildtype=release',
'c_std=c99',
'c_std=gnu11,c11',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I bumped this to C11 as that is what the CMake configuration uses, but it also appears that the c-ares dependency requires some POSIX extensions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Namely it appears that c-ares wants to include macros from <net/if.h> and looks for macros like CLOCK_MONOTONIC from time.h on non-windows platforms

'warning_level=2',
'cpp_std=c++17',
],
Expand Down Expand Up @@ -65,7 +65,8 @@ needs_s3 = get_option('s3').enabled()
needs_filesystem = get_option('filesystem').enabled() or needs_azure or needs_gcs or needs_hdfs or needs_s3
needs_integration = get_option('integration').enabled()
needs_tests = get_option('tests').enabled()
needs_ipc = get_option('ipc').enabled() or needs_tests or needs_benchmarks
need_flight = get_option('flight').enabled()
needs_ipc = get_option('ipc').enabled() or needs_tests or needs_benchmarks or needs_flight
needs_testing = get_option('testing').enabled() or needs_tests or needs_benchmarks or needs_integration
needs_json = get_option('json').enabled() or needs_testing

Expand Down
7 changes: 7 additions & 0 deletions cpp/meson.options
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ option(
)

option('json', type: 'feature', description: 'Build Arrow with JSON support')

option(
'flight',
type: 'feature',
description: 'Build the Arrow Flight RPC System (requires GRPC, Protocol Buffers)',
)

option('git_id', type: 'string')
option('git_description', type: 'string')

Expand Down
203 changes: 203 additions & 0 deletions cpp/src/arrow/flight/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
# 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.

install_headers(
[
'api.h',
'client_auth.h',
'client_cookie_middleware.h',
'client.h',
'client_middleware.h',
'client_tracing_middleware.h',
'middleware.h',
'otel_logging.h',
'pch.h',
'platform.h',
'server_auth.h',
'server.h',
'server_middleware.h',
'server_tracing_middleware.h',
'test_auth_handlers.h',
'test_definitions.h',
'test_flight_server.h',
'test_util.h',
'transport.h',
'transport_server.h',
'type_fwd.h',
'types_async.h',
'types.h',
'visibility.h',
],
subdir: 'arrow/flight',
)

grpc_dep = dependency('grpc++')
protobuf_dep = dependency('protobuf')
abseil_sync_dep = dependency('absl_synchronization')

fs = import('fs')
protoc = find_program('protoc')

flight_proto_path = fs.parent(meson.project_source_root()) / 'format'
flight_proto_files = custom_target(
'arrow-flight-proto-files',
input: [flight_proto_path / 'Flight.proto'],
output: ['Flight.pb.cc', 'Flight.pb.h'],
command: [
protoc,
'--proto_path=' + flight_proto_path,
'--cpp_out=' + meson.current_build_dir(),
'@INPUT@',
],
)

grpc_cpp_plugin = find_program('grpc_cpp_plugin')
flight_proto_grpc_files = custom_target(
'arrow-flight-proto-grpc-files',
input: [flight_proto_path / 'Flight.proto'],
output: ['Flight.grpc.pb.cc', 'Flight.grpc.pb.h'],
command: [
protoc,
'--proto_path=' + flight_proto_path,
'--grpc_out=' + meson.current_build_dir(),
'--plugin=protoc-gen-grpc=' + grpc_cpp_plugin.full_path(),
'@INPUT@',
],
)

arrow_flight_srcs = [
'client.cc',
'client_cookie_middleware.cc',
'client_tracing_middleware.cc',
'cookie_internal.cc',
'middleware.cc',
'serialization_internal.cc',
'server.cc',
'server_auth.cc',
'server_tracing_middleware.cc',
'transport.cc',
'transport_server.cc',
'transport/grpc/grpc_client.cc',
'transport/grpc/grpc_server.cc',
'transport/grpc/serialization_internal.cc',
'transport/grpc/protocol_grpc_internal.cc',
'transport/grpc/util_internal.cc',
'types.cc',
]

# if needs_telemetry
# arrow_flight_srcs += ['otel_logging.cc']
# endif

arrow_flight = library(
'arrow-flight',
# We intentionally index flight_proto_grpc_files[1] so as to avoid
# adding 'Flight.grpc.pb.cc' to the sources. This is required
# because protocol_grpc_internal.cc includes the source file
# directly; using as a source here will cause a ODR violation
sources: arrow_flight_srcs + [
flight_proto_files,
flight_proto_grpc_files[1],
],
dependencies: [arrow_dep, grpc_dep, protobuf_dep, abseil_sync_dep],
cpp_args: '-DARROW_FLIGHT_EXPORTING',
)

arrow_flight_dep = declare_dependency(
link_with: arrow_flight,
dependencies: [grpc_dep, protobuf_dep, abseil_sync_dep],
)

if needs_testing
arrow_flight_testing_lib = library(
'arrow-flight-testing',
sources: [
'test_auth_handlers.cc',
'test_definitions.cc',
'test_flight_server.cc',
'test_util.cc',
],
dependencies: [arrow_test_dep, arrow_flight_dep],
)

arrow_flight_test_dep = declare_dependency(
link_with: arrow_flight_testing_lib,
dependencies: [arrow_flight_dep],
)
else
arrow_flight_test_dep = disabler()
endif

flight_tests = ['flight_internals_test', 'flight_test']
foreach flight_test : flight_tests
test_name = '@0@'.format(flight_test.replace('_', '-'))
exc = executable(
test_name,
sources: [
'@[email protected]'.format(flight_test),
# flight_internals_test.cc transitively includes Flight.grpc.pb.h
# so we must declare that here to avoid a race condition
flight_proto_grpc_files[1],
],
dependencies: [arrow_test_dep, arrow_flight_test_dep],
)
test(test_name, exc)
endforeach

# Build test server for unit tests or benchmarks
if needs_tests or needs_benchmarks
executable(
'flight-test-server',
sources: ['test_server.cc'],
dependencies: [
arrow_dep,
arrow_flight_test_dep,
gtest_dep,
gmock_dep,
gflags_dep,
],
)
endif

if needs_benchmarks
# Perf server for benchmarks
flight_proto_files = custom_target(
'arrow-flight-benchmark-perf-proto-files',
input: ['perf.proto'],
output: ['perf.pb.cc', 'perf.pb.h'],
command: [
protoc,
'--proto_path=' + meson.current_source_dir(),
'--cpp_out=' + meson.current_build_dir(),
'@INPUT@',
],
)

executable(
'arrow-flight-perf-server',
sources: ['perf_server.cc'] + flight_proto_files,
dependencies: [arrow_dep, arrow_flight_test_dep, gtest_dep, gflags_dep],
)

executable(
'arrow-flight-benchmark',
sources: ['flight_benchmark.cc'] + flight_proto_files,
dependencies: [arrow_dep, arrow_flight_test_dep, gflags_dep],
)
endif

# TODO: SQL support can be implemented after compute, acero, parquet, substrait
4 changes: 4 additions & 0 deletions cpp/src/arrow/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -624,3 +624,7 @@ endif
if needs_filesystem
subdir('filesystem')
endif

if needs_flight
subdir('flight')
endif
125 changes: 125 additions & 0 deletions cpp/subprojects/abseil-cpp.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# 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.

[wrap-file]
directory = abseil-cpp-20240722.0
source_url = https://github.com/abseil/abseil-cpp/releases/download/20240722.0/abseil-cpp-20240722.0.tar.gz
source_filename = abseil-cpp-20240722.0.tar.gz
source_hash = f50e5ac311a81382da7fa75b97310e4b9006474f9560ac46f54a9967f07d4ae3
patch_filename = abseil-cpp_20240722.0-3_patch.zip
patch_url = https://wrapdb.mesonbuild.com/v2/abseil-cpp_20240722.0-3/get_patch
patch_hash = 12dd8df1488a314c53e3751abd2750cf233b830651d168b6a9f15e7d0cf71f7b
source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/abseil-cpp_20240722.0-3/abseil-cpp-20240722.0.tar.gz
wrapdb_version = 20240722.0-3

[provide]
absl_base = absl_base_dep
absl_container = absl_container_dep
absl_debugging = absl_debugging_dep
absl_log = absl_log_dep
absl_flags = absl_flags_dep
absl_hash = absl_hash_dep
absl_crc = absl_crc_dep
absl_numeric = absl_numeric_dep
absl_profiling = absl_profiling_dep
absl_random = absl_random_dep
absl_status = absl_status_dep
absl_strings = absl_strings_dep
absl_synchronization = absl_synchronization_dep
absl_time = absl_time_dep
absl_types = absl_types_dep
absl_algorithm_container = absl_base_dep
absl_any_invocable = absl_base_dep
absl_bad_any_cast_impl = absl_types_dep
absl_bad_optional_access = absl_types_dep
absl_bad_variant_access = absl_types_dep
absl_bind_front = absl_base_dep
absl_city = absl_hash_dep
absl_civil_time = absl_time_dep
absl_cleanup = absl_base_dep
absl_cord = absl_strings_dep
absl_cord_internal = absl_strings_dep
absl_cordz_functions = absl_strings_dep
absl_cordz_handle = absl_strings_dep
absl_cordz_info = absl_strings_dep
absl_cordz_sample_token = absl_strings_dep
absl_core_headers = absl_base_dep
absl_crc32c = absl_crc_dep
absl_debugging_internal = absl_debugging_dep
absl_demangle_internal = absl_debugging_dep
absl_die_if_null = absl_log_dep
absl_examine_stack = absl_debugging_dep
absl_exponential_biased = absl_profiling_dep
absl_failure_signal_handler = absl_debugging_dep
absl_flags_commandlineflag = absl_flags_dep
absl_flags_commandlineflag_internal = absl_flags_dep
absl_flags_config = absl_flags_dep
absl_flags_internal = absl_flags_dep
absl_flags_marshalling = absl_flags_dep
absl_flags_parse = absl_flags_dep
absl_flags_private_handle_accessor = absl_flags_dep
absl_flags_program_name = absl_flags_dep
absl_flags_reflection = absl_flags_dep
absl_flags_usage = absl_flags_dep
absl_flags_usage_internal = absl_flags_dep
absl_flat_hash_map = absl_container_dep
absl_flat_hash_set = absl_container_dep
absl_function_ref = absl_base_dep
absl_graphcycles_internal = absl_synchronization_dep
absl_hashtablez_sampler = absl_container_dep
absl_inlined_vector = absl_container_dep
absl_int128 = absl_numeric_dep
absl_leak_check = absl_debugging_dep
absl_log_initialize = absl_log_dep
absl_log_internal_check_op = absl_log_dep
absl_log_internal_message = absl_log_dep
absl_log_severity = absl_base_dep
absl_low_level_hash = absl_hash_dep
absl_memory = absl_base_dep
absl_optional = absl_types_dep
absl_periodic_sampler = absl_profiling_dep
absl_random_bit_gen_ref = absl_random_dep
absl_random_distributions = absl_random_dep
absl_random_internal_distribution_test_util = absl_random_dep
absl_random_internal_platform = absl_random_dep
absl_random_internal_pool_urbg = absl_random_dep
absl_random_internal_randen = absl_random_dep
absl_random_internal_randen_hwaes = absl_random_dep
absl_random_internal_randen_hwaes_impl = absl_random_dep
absl_random_internal_randen_slow = absl_random_dep
absl_random_internal_seed_material = absl_random_dep
absl_random_random = absl_random_dep
absl_random_seed_gen_exception = absl_random_dep
absl_random_seed_sequences = absl_random_dep
absl_raw_hash_set = absl_container_dep
absl_raw_logging_internal = absl_base_dep
absl_scoped_set_env = absl_base_dep
absl_span = absl_types_dep
absl_spinlock_wait = absl_base_dep
absl_stacktrace = absl_debugging_dep
absl_statusor = absl_status_dep
absl_str_format = absl_strings_dep
absl_str_format_internal = absl_strings_dep
absl_strerror = absl_base_dep
absl_string_view = absl_strings_dep
absl_strings_internal = absl_strings_dep
absl_symbolize = absl_debugging_dep
absl_throw_delegate = absl_base_dep
absl_time_zone = absl_time_dep
absl_type_traits = absl_base_dep
absl_utility = absl_base_dep
absl_variant = absl_types_dep
23 changes: 23 additions & 0 deletions cpp/subprojects/aws-c-s3.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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.

[wrap-file]
source_url = https://github.com/awslabs/aws-c-s3/archive/${ARROW_AWS_C_S3_BUILD_VERSION}.tar.gz
source_filename = azure-sdk-for-cpp-azure-identity_1.9.0.tar.gz
source_hash = 97065bfc971ac8df450853ce805f820f52b59457bd7556510186a1569502e4a1
directory = azure-sdk-for-cpp-azure-identity_1.9.0.tar.gz
method = cmake
Loading
Loading