Skip to content
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
74 changes: 74 additions & 0 deletions .github/workflows/cpp_extra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ jobs:
- image: conda-cpp
run-options: >-
-e ARROW_USE_MESON=ON
-e MESON_SETUP_ARGS="-Dauto_features=enabled -Dfuzzing=disabled -Dgcs=disabled -Ds3=disabled"
runs-on: ubuntu-latest
title: AMD64 Ubuntu Meson
# TODO: We should remove this "continue-on-error: true" once GH-47207 is resolved
Expand Down Expand Up @@ -258,3 +259,76 @@ jobs:
- jni-macos
uses: ./.github/workflows/report_ci.yml
secrets: inherit

meson-windows:
needs: check-labels
name: AMD64 Windows Meson
runs-on: windows-2022
if: needs.check-labels.outputs.ci-extra == 'true'
timeout-minutes: 60
steps:
- name: Checkout Arrow
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
submodules: recursive
- uses: conda-incubator/setup-miniconda@835234971496cad1653abb28a638a281cf32541f # v3.2.0
with:
channels: conda-forge
conda-remove-defaults: "true"
environment-file: ci/conda_env_cpp.txt
- name: Download Timezone Database
shell: bash
run: ci/scripts/download_tz_database.sh
- name: Install ccache
shell: bash
run: |
ci/scripts/install_ccache.sh 4.6.3 /usr
- name: Setup ccache
shell: bash
run: |
ci/scripts/ccache_setup.sh
- name: ccache info
id: ccache-info
shell: bash
run: |
echo "cache-dir=$(ccache --get-config cache_dir)" >> $GITHUB_OUTPUT
- name: Cache ccache
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ${{ steps.ccache-info.outputs.cache-dir }}
key: cpp-ccache-windows-meson-${{ env.CACHE_VERSION }}-${{ hashFiles('cpp/**') }}
restore-keys: cpp-ccache-windows-meson-${{ env.CACHE_VERSION }}-
env:
# We can invalidate the current cache by updating this.
CACHE_VERSION: "2025-08-21"
- name: Setup Python
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: 3
- name: Install Meson
run: |
python3 -m pip install meson
- name: Build
shell: bash
env:
ARROW_USE_MESON: ON
ARROW_HOME: C:\arrow-dist
MESON_SETUP_ARGS: "
--vsenv
--force-fallback-for=grpc++
-Dauto_features=enabled
-Dfuzzing=disabled
-Dgcs=disabled
-Ds3=disabled
-Dazure=disabled"
run: |
ci/scripts/cpp_build.sh $(pwd) $(pwd)/build
- name: Test
shell: bash
env:
ARROW_USE_MESON: ON
run: |
# For ORC
export TZDIR=/c/msys64/usr/share/zoneinfo
ci/scripts/cpp_test.sh $(pwd) $(pwd)/build
5 changes: 1 addition & 4 deletions ci/scripts/cpp_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,7 @@ if [ "${ARROW_USE_MESON:-OFF}" = "ON" ]; then
--prefix=${MESON_PREFIX:-${ARROW_HOME}} \
--buildtype=${ARROW_BUILD_TYPE:-debug} \
--pkg-config-path="${CONDA_PREFIX}/lib/pkgconfig/" \
-Dauto_features=enabled \
-Dfuzzing=disabled \
-Dgcs=disabled \
-Ds3=disabled \
${MESON_SETUP_ARGS} \
. \
${source_dir}

Expand Down
2 changes: 2 additions & 0 deletions ci/scripts/cpp_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,11 @@ fi
if [ "${ARROW_USE_MESON:-OFF}" = "ON" ]; then
ARROW_BUILD_EXAMPLES=OFF # TODO: Remove this
meson test \
--max-lines=0 \
--no-rebuild \
--print-errorlogs \
--suite arrow \
--timeout-multiplier=10 \
"$@"
else
ctest \
Expand Down
18 changes: 12 additions & 6 deletions cpp/examples/parquet/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,19 @@ if needs_parquet_encryption
'sources': files('low_level_api/encryption_reader_writer.cc'),
'include_dir': include_directories('low_level_api'),
},
'parquet-encryption-example-all-crypto-options': {
'sources': files(
'low_level_api/encryption_reader_writer_all_crypto_options.cc',
),
'include_dir': include_directories('low_level_api'),
},
}

if cpp_compiler.get_id() != 'msvc'
# https://github.com/apache/arrow/issues/47598
example_execs += {
'parquet-encryption-example-all-crypto-options': {
'sources': files(
'low_level_api/encryption_reader_writer_all_crypto_options.cc',
),
'include_dir': include_directories('low_level_api'),
},
}
endif
endif

foreach key, val : example_execs
Expand Down
1 change: 1 addition & 0 deletions cpp/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ project_args = [
'-Wno-stringop-overflow',
'-Wno-aggressive-loop-optimizations',
'-Wno-nonnull',
'/bigobj',
]

c_compiler = meson.get_compiler('c')
Expand Down
11 changes: 9 additions & 2 deletions cpp/src/arrow/acero/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,19 @@ arrow_acero_lib = library(
sources: arrow_acero_srcs,
dependencies: [arrow_compute_dep, arrow_dep, threads_dep],
gnu_symbol_visibility: 'inlineshidden',
cpp_shared_args: ['-DARROW_ACERO_EXPORTING'],
cpp_static_args: ['-DARROW_ACERO_STATIC'],
)

arrow_acero_compile_args = []
if get_option('default_library') == 'static'
arrow_acero_compile_args += ['-DARROW_ACERO_STATIC']
endif

arrow_acero_dep = declare_dependency(
dependencies: [arrow_compute_dep],
link_with: [arrow_acero_lib],
compile_args: arrow_acero_compile_args,
)
meson.override_dependency('arrow-acero', arrow_acero_dep)

Expand Down Expand Up @@ -141,8 +149,7 @@ foreach key, val : arrow_acero_benchmarks
dependencies: [
arrow_acero_dep,
arrow_compute_test_dep,
arrow_benchmark_dep,
gmock_dep,
benchmark_main_dep,
],
)
benchmark(key, exc)
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/compute/kernels/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ endforeach
exc = executable(
'arrow-compute-aggregate-test',
sources: ['aggregate_test.cc'] + kernel_testing_srcs,
dependencies: [arrow_compute_test_dep, filesystem_dep],
dependencies: [arrow_compute_test_dep, boost_deps],
)
test('arrow-compute-aggregate-test', exc)

Expand Down
4 changes: 2 additions & 2 deletions cpp/src/arrow/compute/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ endif
# Define arrow_compute_core_testing object library for common test files requiring
# only core compute. No extra kernels are required.
if needs_testing
arrow_compute_core_test_lib = library(
arrow_compute_core_test_lib = static_library(
'arrow-compute-core-testing',
sources: files('test_util_internal.cc'),
dependencies: arrow_test_dep,
Expand All @@ -64,7 +64,7 @@ endif

# Define arrow_compute_testing object library for test files requiring extra kernels.
if needs_testing and needs_compute
arrow_compute_testing_lib = library(
arrow_compute_testing_lib = static_library(
'arrow-compute-testing',
sources: files('test_env.cc'),
dependencies: [
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/filesystem/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ test_cpp_arg = '-DARROW_FILESYSTEM_EXAMPLE_LIBPATH="@0@"'.format(
exc = executable(
'arrow-filesystem-test',
sources: ['filesystem_test.cc', 'localfs_test.cc'],
dependencies: [arrow_test_dep],
dependencies: [arrow_test_dep, arrow_filesystem_example_dep],
cpp_args: test_cpp_arg,
)
test('arrow-filesystem-test', exc)
Expand Down
4 changes: 4 additions & 0 deletions cpp/src/arrow/flight/flight_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ ARROW_FLIGHT_TEST_ASYNC_CLIENT(GrpcAsyncClientTest);
// Ad-hoc gRPC-specific tests

TEST(TestFlight, ConnectUri) {
if (!util::Process::IsAvailable()) {
GTEST_SKIP() << "This test requires Boost.Process to run";
}

TestServer server("flight-test-server");
ASSERT_OK(server.Start());
ASSERT_TRUE(server.IsRunning());
Expand Down
70 changes: 57 additions & 13 deletions cpp/src/arrow/flight/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,30 @@ install_headers(
subdir: 'arrow/flight',
)

grpc_dep = dependency('grpc++')
# Due to the Meson bug in https://github.com/mesonbuild/meson/issues/14905
# we need to special how the grpc_cpp_plugin resolution is handled
# when found on the system versus when built as a subproject
# On Windows we always need to use a subproject, because Meson cannot
# accurately detect if the system provides a shared/static library, and the
# shared grpc files do not export symbols properly
if host_machine.system() == 'windows'
has_system_grpc = false
else
grpc_cpp_dep = dependency('grpc++', allow_fallback: false, required: false)
has_system_grpc = grpc_cpp_dep.found()
endif
if not has_system_grpc
grpc_opts = []
if cpp_compiler.get_id() == 'msvc'
grpc_opts += [
'openssl:asm=disabled', # asm cannot compile on Windows
're2:default_library=static', # re2 does not export symbols
]
endif
grpc_subproject = subproject('grpc', default_options: grpc_opts)
grpc_cpp_dep = grpc_subproject.get_variable('grpcpp_dep')
endif

protobuf_dep = dependency('protobuf')
abseil_sync_dep = dependency('absl_synchronization')

Expand All @@ -53,19 +76,26 @@ protoc = find_program('protoc')

flight_proto_path = fs.parent(meson.project_source_root()) / 'format'

# gRPC as of 1.59.0 may only be statically linked on Windows. Unfortunately, both arrow_flight
# and the arrow_flight tests need to link against gRPC, so if arrow_flight lib is shared
# it will cause an ODR violation when subsequently building tests
needs_static_flight = host_machine.system() == 'windows' or get_option(
'default_library',
) == 'static'

# To ensure messages from proto files are created correctly, we need to
# pass in dllexport_decl=<...> . Unfortunately, it doesn't appear that we
# can just pass in dllexport_decl=ARROW_FLIGHT_EXPORT, as the visibility
# macro won't be easily available to the generated proto file. See also
# https://github.com/protocolbuffers/protobuf/issues/19422
if cpp_compiler.get_id() == 'msvc'
if get_option('default_library') != 'static'
if needs_static_flight
proto_visibility = ''
else
if cpp_compiler.get_id() == 'msvc'
proto_visibility = 'dllexport_decl=__declspec(dllexport):'
else
proto_visibility = ''
proto_visibility = 'dllexport_decl=__attribute__((visibility("default"))):'
endif
else
proto_visibility = 'dllexport_decl=__attribute__((visibility("default"))):'
endif

flight_proto_files = custom_target(
Expand All @@ -81,16 +111,22 @@ flight_proto_files = custom_target(
)

grpc_cpp_plugin = find_program('grpc_cpp_plugin')
if has_system_grpc
grpc_cpp_plugin_input = grpc_cpp_plugin.full_path()
else
grpc_cpp_plugin_input = grpc_cpp_plugin
endif

flight_proto_grpc_files = custom_target(
'arrow-flight-proto-grpc-files',
input: [flight_proto_path / 'Flight.proto'],
input: [grpc_cpp_plugin_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@',
'--plugin=protoc-gen-grpc=@INPUT0@',
'@INPUT1@',
],
)

Expand All @@ -116,7 +152,7 @@ arrow_flight_srcs = [

thread_dep = dependency('threads')

arrow_flight = library(
arrow_flight = build_target(
'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
Expand All @@ -128,23 +164,30 @@ arrow_flight = library(
],
dependencies: [
arrow_dep,
grpc_dep,
grpc_cpp_dep,
protobuf_dep,
abseil_sync_dep,
thread_dep,
],
cpp_shared_args: ['-DARROW_FLIGHT_EXPORTING'],
cpp_static_args: ['-DARROW_FLIGHT_STATIC'],
gnu_symbol_visibility: 'inlineshidden',
target_type: needs_static_flight ? 'static_library' : 'library',
)

arrow_flight_compile_args = []
if needs_static_flight
arrow_flight_compile_args += ['-DARROW_FLIGHT_STATIC']
endif

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

if needs_testing
arrow_flight_testing_lib = library(
arrow_flight_testing_lib = build_target(
'arrow-flight-testing',
sources: [
'test_auth_handlers.cc',
Expand All @@ -156,6 +199,7 @@ if needs_testing
cpp_shared_args: ['-DARROW_FLIGHT_EXPORTING'],
cpp_static_args: ['-DARROW_FLIGHT_STATIC'],
gnu_symbol_visibility: 'inlineshidden',
target_type: needs_static_flight ? 'static_library' : 'library',
)

arrow_flight_test_dep = declare_dependency(
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/io/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if needs_hdfs
exc = executable(
'arrow-io-hdfs-test',
sources: 'hdfs_test.cc',
dependencies: [arrow_test_dep, filesystem_dep],
dependencies: [arrow_test_dep, boost_deps],
implicit_include_directories: false,
include_directories: [hdfs_incdir],
)
Expand Down
Loading
Loading