Skip to content

Commit eddb36a

Browse files
committed
GH-46141: Add flight directory to Meson configuration
1 parent 327aca6 commit eddb36a

File tree

10 files changed

+480
-2
lines changed

10 files changed

+480
-2
lines changed

cpp/meson.build

+3-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ project(
2424
meson_version: '>=1.3.0',
2525
default_options: [
2626
'buildtype=release',
27-
'c_std=c99',
27+
'c_std=gnu11,c11',
2828
'warning_level=2',
2929
'cpp_std=c++17',
3030
],
@@ -62,7 +62,8 @@ needs_hdfs = get_option('hdfs')
6262
needs_filesystem = false or needs_hdfs
6363
needs_integration = get_option('integration')
6464
needs_tests = get_option('tests')
65-
needs_ipc = get_option('ipc') or needs_tests or needs_benchmarks
65+
needs_flight = get_option('flight')
66+
needs_ipc = get_option('ipc') or needs_tests or needs_benchmarks or needs_flight
6667
needs_testing = get_option('testing') or needs_tests or needs_benchmarks or needs_integration
6768
needs_json = get_option('json') or needs_testing
6869

cpp/meson.options

+7
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ option(
5757
value: false,
5858
)
5959

60+
option(
61+
'flight',
62+
type: 'boolean',
63+
description: 'Build the Arrow Flight RPC System (requires GRPC, Protocol Buffers)',
64+
value: false,
65+
)
66+
6067
option(
6168
'git_id',
6269
type: 'string',

cpp/src/arrow/flight/meson.build

+198
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
install_headers(
19+
[
20+
'api.h',
21+
'client_auth.h',
22+
'client_cookie_middleware.h',
23+
'client.h',
24+
'client_middleware.h',
25+
'client_tracing_middleware.h',
26+
'middleware.h',
27+
'otel_logging.h',
28+
'pch.h',
29+
'platform.h',
30+
'server_auth.h',
31+
'server.h',
32+
'server_middleware.h',
33+
'server_tracing_middleware.h',
34+
'test_auth_handlers.h',
35+
'test_definitions.h',
36+
'test_flight_server.h',
37+
'test_util.h',
38+
'transport.h',
39+
'transport_server.h',
40+
'type_fwd.h',
41+
'types_async.h',
42+
'types.h',
43+
'visibility.h',
44+
],
45+
subdir: 'arrow/flight',
46+
)
47+
48+
grpc_dep = dependency('grpc++')
49+
protobuf_dep = dependency('protobuf')
50+
abseil_sync_dep = dependency('absl_synchronization')
51+
52+
fs = import('fs')
53+
protoc = find_program('protoc')
54+
55+
flight_proto_path = fs.parent(meson.project_source_root()) / 'format'
56+
flight_proto_files = custom_target(
57+
'arrow-flight-proto-files',
58+
input: [flight_proto_path / 'Flight.proto'],
59+
output: ['Flight.pb.cc', 'Flight.pb.h'],
60+
command: [
61+
protoc,
62+
'--proto_path=' + flight_proto_path,
63+
'--cpp_out=' + meson.current_build_dir(),
64+
'@INPUT@',
65+
],
66+
)
67+
68+
grpc_cpp_plugin = find_program('grpc_cpp_plugin')
69+
flight_proto_grpc_files = custom_target(
70+
'arrow-flight-proto-grpc-files',
71+
input: [flight_proto_path / 'Flight.proto'],
72+
output: ['Flight.grpc.pb.cc', 'Flight.grpc.pb.h'],
73+
command: [
74+
protoc,
75+
'--proto_path=' + flight_proto_path,
76+
'--grpc_out=' + meson.current_build_dir(),
77+
'--plugin=protoc-gen-grpc=' + grpc_cpp_plugin.full_path(),
78+
'@INPUT@',
79+
],
80+
)
81+
82+
arrow_flight_srcs = [
83+
'client.cc',
84+
'client_cookie_middleware.cc',
85+
'client_tracing_middleware.cc',
86+
'cookie_internal.cc',
87+
'middleware.cc',
88+
'serialization_internal.cc',
89+
'server.cc',
90+
'server_auth.cc',
91+
'server_tracing_middleware.cc',
92+
'transport.cc',
93+
'transport_server.cc',
94+
'transport/grpc/grpc_client.cc',
95+
'transport/grpc/grpc_server.cc',
96+
'transport/grpc/serialization_internal.cc',
97+
'transport/grpc/protocol_grpc_internal.cc',
98+
'transport/grpc/util_internal.cc',
99+
'types.cc',
100+
]
101+
102+
# if needs_telemetry
103+
# arrow_flight_srcs += ['otel_logging.cc']
104+
# endif
105+
106+
arrow_flight = library(
107+
'arrow-flight',
108+
# We intentionally index flight_proto_grpc_files[1] so as to avoid
109+
# adding 'Flight.grpc.pb.cc' to the sources. This is required
110+
# because protocol_grpc_internal.cc includes the source file
111+
# directly; using as a source here will cause a ODR violation
112+
sources: arrow_flight_srcs + [
113+
flight_proto_files,
114+
flight_proto_grpc_files[1],
115+
],
116+
dependencies: [arrow_dep, grpc_dep, protobuf_dep, abseil_sync_dep],
117+
cpp_args: '-DARROW_FLIGHT_EXPORTING',
118+
)
119+
120+
arrow_flight_dep = declare_dependency(
121+
link_with: arrow_flight,
122+
dependencies: [grpc_dep, protobuf_dep, abseil_sync_dep],
123+
)
124+
125+
if needs_testing
126+
arrow_flight_testing_lib = library(
127+
'arrow-flight-testing',
128+
sources: [
129+
'test_auth_handlers.cc',
130+
'test_definitions.cc',
131+
'test_flight_server.cc',
132+
'test_util.cc',
133+
],
134+
dependencies: [arrow_test_dep, arrow_flight_dep],
135+
)
136+
137+
arrow_flight_test_dep = declare_dependency(
138+
link_with: arrow_flight_testing_lib,
139+
dependencies: [arrow_flight_dep],
140+
)
141+
else
142+
arrow_flight_test_dep = disabler()
143+
endif
144+
145+
flight_tests = ['flight_internals_test', 'flight_test']
146+
foreach flight_test : flight_tests
147+
test_name = '@0@'.format(flight_test.replace('_', '-'))
148+
exc = executable(
149+
test_name,
150+
sources: ['@[email protected]'.format(flight_test)],
151+
dependencies: [arrow_test_dep, arrow_flight_test_dep],
152+
)
153+
test(test_name, exc)
154+
endforeach
155+
156+
# Build test server for unit tests or benchmarks
157+
if needs_tests or needs_benchmarks
158+
executable(
159+
'flight-test-server',
160+
sources: ['test_server.cc'],
161+
dependencies: [
162+
arrow_dep,
163+
arrow_flight_test_dep,
164+
gtest_dep,
165+
gmock_dep,
166+
gflags_dep,
167+
],
168+
)
169+
endif
170+
171+
if needs_benchmarks
172+
# Perf server for benchmarks
173+
flight_proto_files = custom_target(
174+
'arrow-flight-benchmark-perf-proto-files',
175+
input: ['perf.proto'],
176+
output: ['perf.pb.cc', 'perf.pb.h'],
177+
command: [
178+
protoc,
179+
'--proto_path=' + meson.current_source_dir(),
180+
'--cpp_out=' + meson.current_build_dir(),
181+
'@INPUT@',
182+
],
183+
)
184+
185+
executable(
186+
'arrow-flight-perf-server',
187+
sources: ['perf_server.cc'] + flight_proto_files,
188+
dependencies: [arrow_dep, arrow_flight_test_dep, gtest_dep, gflags_dep],
189+
)
190+
191+
executable(
192+
'arrow-flight-benchmark',
193+
sources: ['flight_benchmark.cc'] + flight_proto_files,
194+
dependencies: [arrow_dep, arrow_flight_test_dep, gflags_dep],
195+
)
196+
endif
197+
198+
# TODO: SQL support can be implemented after compute, acero, parquet, substrait

cpp/src/arrow/meson.build

+4
Original file line numberDiff line numberDiff line change
@@ -554,3 +554,7 @@ endif
554554
if needs_csv
555555
subdir('csv')
556556
endif
557+
558+
if needs_flight
559+
subdir('flight')
560+
endif

cpp/subprojects/abseil-cpp.wrap

+125
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
[wrap-file]
19+
directory = abseil-cpp-20240722.0
20+
source_url = https://github.com/abseil/abseil-cpp/releases/download/20240722.0/abseil-cpp-20240722.0.tar.gz
21+
source_filename = abseil-cpp-20240722.0.tar.gz
22+
source_hash = f50e5ac311a81382da7fa75b97310e4b9006474f9560ac46f54a9967f07d4ae3
23+
patch_filename = abseil-cpp_20240722.0-3_patch.zip
24+
patch_url = https://wrapdb.mesonbuild.com/v2/abseil-cpp_20240722.0-3/get_patch
25+
patch_hash = 12dd8df1488a314c53e3751abd2750cf233b830651d168b6a9f15e7d0cf71f7b
26+
source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/abseil-cpp_20240722.0-3/abseil-cpp-20240722.0.tar.gz
27+
wrapdb_version = 20240722.0-3
28+
29+
[provide]
30+
absl_base = absl_base_dep
31+
absl_container = absl_container_dep
32+
absl_debugging = absl_debugging_dep
33+
absl_log = absl_log_dep
34+
absl_flags = absl_flags_dep
35+
absl_hash = absl_hash_dep
36+
absl_crc = absl_crc_dep
37+
absl_numeric = absl_numeric_dep
38+
absl_profiling = absl_profiling_dep
39+
absl_random = absl_random_dep
40+
absl_status = absl_status_dep
41+
absl_strings = absl_strings_dep
42+
absl_synchronization = absl_synchronization_dep
43+
absl_time = absl_time_dep
44+
absl_types = absl_types_dep
45+
absl_algorithm_container = absl_base_dep
46+
absl_any_invocable = absl_base_dep
47+
absl_bad_any_cast_impl = absl_types_dep
48+
absl_bad_optional_access = absl_types_dep
49+
absl_bad_variant_access = absl_types_dep
50+
absl_bind_front = absl_base_dep
51+
absl_city = absl_hash_dep
52+
absl_civil_time = absl_time_dep
53+
absl_cleanup = absl_base_dep
54+
absl_cord = absl_strings_dep
55+
absl_cord_internal = absl_strings_dep
56+
absl_cordz_functions = absl_strings_dep
57+
absl_cordz_handle = absl_strings_dep
58+
absl_cordz_info = absl_strings_dep
59+
absl_cordz_sample_token = absl_strings_dep
60+
absl_core_headers = absl_base_dep
61+
absl_crc32c = absl_crc_dep
62+
absl_debugging_internal = absl_debugging_dep
63+
absl_demangle_internal = absl_debugging_dep
64+
absl_die_if_null = absl_log_dep
65+
absl_examine_stack = absl_debugging_dep
66+
absl_exponential_biased = absl_profiling_dep
67+
absl_failure_signal_handler = absl_debugging_dep
68+
absl_flags_commandlineflag = absl_flags_dep
69+
absl_flags_commandlineflag_internal = absl_flags_dep
70+
absl_flags_config = absl_flags_dep
71+
absl_flags_internal = absl_flags_dep
72+
absl_flags_marshalling = absl_flags_dep
73+
absl_flags_parse = absl_flags_dep
74+
absl_flags_private_handle_accessor = absl_flags_dep
75+
absl_flags_program_name = absl_flags_dep
76+
absl_flags_reflection = absl_flags_dep
77+
absl_flags_usage = absl_flags_dep
78+
absl_flags_usage_internal = absl_flags_dep
79+
absl_flat_hash_map = absl_container_dep
80+
absl_flat_hash_set = absl_container_dep
81+
absl_function_ref = absl_base_dep
82+
absl_graphcycles_internal = absl_synchronization_dep
83+
absl_hashtablez_sampler = absl_container_dep
84+
absl_inlined_vector = absl_container_dep
85+
absl_int128 = absl_numeric_dep
86+
absl_leak_check = absl_debugging_dep
87+
absl_log_initialize = absl_log_dep
88+
absl_log_internal_check_op = absl_log_dep
89+
absl_log_internal_message = absl_log_dep
90+
absl_log_severity = absl_base_dep
91+
absl_low_level_hash = absl_hash_dep
92+
absl_memory = absl_base_dep
93+
absl_optional = absl_types_dep
94+
absl_periodic_sampler = absl_profiling_dep
95+
absl_random_bit_gen_ref = absl_random_dep
96+
absl_random_distributions = absl_random_dep
97+
absl_random_internal_distribution_test_util = absl_random_dep
98+
absl_random_internal_platform = absl_random_dep
99+
absl_random_internal_pool_urbg = absl_random_dep
100+
absl_random_internal_randen = absl_random_dep
101+
absl_random_internal_randen_hwaes = absl_random_dep
102+
absl_random_internal_randen_hwaes_impl = absl_random_dep
103+
absl_random_internal_randen_slow = absl_random_dep
104+
absl_random_internal_seed_material = absl_random_dep
105+
absl_random_random = absl_random_dep
106+
absl_random_seed_gen_exception = absl_random_dep
107+
absl_random_seed_sequences = absl_random_dep
108+
absl_raw_hash_set = absl_container_dep
109+
absl_raw_logging_internal = absl_base_dep
110+
absl_scoped_set_env = absl_base_dep
111+
absl_span = absl_types_dep
112+
absl_spinlock_wait = absl_base_dep
113+
absl_stacktrace = absl_debugging_dep
114+
absl_statusor = absl_status_dep
115+
absl_str_format = absl_strings_dep
116+
absl_str_format_internal = absl_strings_dep
117+
absl_strerror = absl_base_dep
118+
absl_string_view = absl_strings_dep
119+
absl_strings_internal = absl_strings_dep
120+
absl_symbolize = absl_debugging_dep
121+
absl_throw_delegate = absl_base_dep
122+
absl_time_zone = absl_time_dep
123+
absl_type_traits = absl_base_dep
124+
absl_utility = absl_base_dep
125+
absl_variant = absl_types_dep

cpp/subprojects/aws-c-s3.wrap

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
[wrap-file]
19+
source_url = https://github.com/awslabs/aws-c-s3/archive/${ARROW_AWS_C_S3_BUILD_VERSION}.tar.gz
20+
source_filename = azure-sdk-for-cpp-azure-identity_1.9.0.tar.gz
21+
source_hash = 97065bfc971ac8df450853ce805f820f52b59457bd7556510186a1569502e4a1
22+
directory = azure-sdk-for-cpp-azure-identity_1.9.0.tar.gz
23+
method = cmake

0 commit comments

Comments
 (0)