diff --git a/.github/workflows/cpp_extra.yml b/.github/workflows/cpp_extra.yml index 97dbadd25d5..83e6a5a1831 100644 --- a/.github/workflows/cpp_extra.yml +++ b/.github/workflows/cpp_extra.yml @@ -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 @@ -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 diff --git a/ci/scripts/cpp_build.sh b/ci/scripts/cpp_build.sh index 3a4431239f1..a7add01f624 100755 --- a/ci/scripts/cpp_build.sh +++ b/ci/scripts/cpp_build.sh @@ -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} diff --git a/ci/scripts/cpp_test.sh b/ci/scripts/cpp_test.sh index 3d88b6f1cd5..5825fbbc1b7 100755 --- a/ci/scripts/cpp_test.sh +++ b/ci/scripts/cpp_test.sh @@ -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 \ diff --git a/cpp/examples/parquet/meson.build b/cpp/examples/parquet/meson.build index 96e2711f323..c312c4cdc4d 100644 --- a/cpp/examples/parquet/meson.build +++ b/cpp/examples/parquet/meson.build @@ -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 diff --git a/cpp/meson.build b/cpp/meson.build index 81143ed1e28..b89b38509ac 100644 --- a/cpp/meson.build +++ b/cpp/meson.build @@ -31,6 +31,7 @@ project_args = [ '-Wno-stringop-overflow', '-Wno-aggressive-loop-optimizations', '-Wno-nonnull', + '/bigobj', ] c_compiler = meson.get_compiler('c') diff --git a/cpp/src/arrow/acero/meson.build b/cpp/src/arrow/acero/meson.build index c7a8bdb4ca6..4465a5ef8e2 100644 --- a/cpp/src/arrow/acero/meson.build +++ b/cpp/src/arrow/acero/meson.build @@ -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) @@ -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) diff --git a/cpp/src/arrow/compute/kernels/meson.build b/cpp/src/arrow/compute/kernels/meson.build index fb682443783..ac02e90c6d6 100644 --- a/cpp/src/arrow/compute/kernels/meson.build +++ b/cpp/src/arrow/compute/kernels/meson.build @@ -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) diff --git a/cpp/src/arrow/compute/meson.build b/cpp/src/arrow/compute/meson.build index fed699e1ca4..9873d4413d6 100644 --- a/cpp/src/arrow/compute/meson.build +++ b/cpp/src/arrow/compute/meson.build @@ -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, @@ -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: [ diff --git a/cpp/src/arrow/filesystem/meson.build b/cpp/src/arrow/filesystem/meson.build index 99c0905e3c6..9f030ebb81c 100644 --- a/cpp/src/arrow/filesystem/meson.build +++ b/cpp/src/arrow/filesystem/meson.build @@ -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) diff --git a/cpp/src/arrow/flight/flight_test.cc b/cpp/src/arrow/flight/flight_test.cc index 16a4909828b..611a48b8734 100644 --- a/cpp/src/arrow/flight/flight_test.cc +++ b/cpp/src/arrow/flight/flight_test.cc @@ -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()); diff --git a/cpp/src/arrow/flight/meson.build b/cpp/src/arrow/flight/meson.build index 9ffe3413dfc..aaadc10809e 100644 --- a/cpp/src/arrow/flight/meson.build +++ b/cpp/src/arrow/flight/meson.build @@ -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') @@ -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( @@ -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@', ], ) @@ -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 @@ -128,7 +164,7 @@ arrow_flight = library( ], dependencies: [ arrow_dep, - grpc_dep, + grpc_cpp_dep, protobuf_dep, abseil_sync_dep, thread_dep, @@ -136,15 +172,22 @@ arrow_flight = library( 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', @@ -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( diff --git a/cpp/src/arrow/io/meson.build b/cpp/src/arrow/io/meson.build index 93d024fbeac..8e5cff283ae 100644 --- a/cpp/src/arrow/io/meson.build +++ b/cpp/src/arrow/io/meson.build @@ -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], ) diff --git a/cpp/src/arrow/meson.build b/cpp/src/arrow/meson.build index 1872f96df6a..72d14e4a763 100644 --- a/cpp/src/arrow/meson.build +++ b/cpp/src/arrow/meson.build @@ -15,9 +15,66 @@ # specific language governing permissions and limitations # under the License. -dl_dep = dependency('dl') +if host_machine.system() == 'windows' + dl_dep = declare_dependency() +else + dl_dep = dependency('dl') +endif threads_dep = dependency('threads') +has_int128 = cpp_compiler.has_define('__SIZEOF_INT128__') +arrow_enable_threading = true +boost_deps = [] +needs_multiprecision = not has_int128 +needs_boost = needs_testing or needs_multiprecision + +if needs_boost + boost_modules = ['filesystem', 'system'] + if cpp_compiler.get_id() == 'msvc' + boost_modules += ['crc'] + endif + + if needs_multiprecision + boost_modules += ['multiprecision'] + endif + boost_dep = dependency('boost', modules: boost_modules, required: false) + + if boost_dep.found() + boost_deps = boost_dep + else + if cpp_compiler.get_id() == 'msvc' + # Threading support requires boost's asio library, which in turn requires the boost + # context library. Unfortunately, this does not appear possible to build + # via Meson's CMake wrapper with MSVC, as the generated subproject wrapper + # mixes up requiring the NASM assembler with the MASM assembler Windows provides + # See https://github.com/mesonbuild/meson/issues/14900 + warning( + ''' + Building Boost from source with MSVC requires the Arrow library to disable threading. + For optimal performance, please do a system install of Boost. + ''', + ) + arrow_enable_threading = false + endif + cmake = import('cmake') + boost_opt = cmake.subproject_options() + boost_opt.add_cmake_defines( + {'BOOST_INCLUDE_LIBRARIES': ';'.join(boost_modules)}, + ) + boost_proj = cmake.subproject('boost', options: boost_opt) + foreach boost_module : boost_modules + dep = boost_proj.dependency(f'boost_@boost_module@') + boost_deps += [dep] + endforeach + endif +endif + +if needs_multiprecision + int128_deps = [boost_deps] +else + int128_deps = [] +endif + arrow_components = { 'arrow_array': { 'sources': [ @@ -78,6 +135,7 @@ arrow_components = { 'compute/kernels/vector_selection_take_internal.cc', 'compute/kernels/vector_swizzle.cc', ], + 'dependencies': int128_deps, }, 'arrow_io': { 'sources': [ @@ -217,7 +275,7 @@ arrow_util_srcs = [ 'util/value_parsing.cc', ] -arrow_util_deps = [threads_dep] +arrow_util_deps = int128_deps + [threads_dep] if needs_brotli arrow_util_srcs += ['util/compression_brotli.cc'] @@ -245,7 +303,13 @@ endif if needs_snappy arrow_util_srcs += ['util/compression_snappy.cc'] - arrow_util_deps += dependency('snappy', 'Snappy') + # snappy does not export symbols, so MSVC requires a static lib + if cpp_compiler.get_id() == 'msvc' + snappy_dep = dependency('snappy', 'Snappy', static: true) + else + snappy_dep = dependency('snappy', 'Snappy') + endif + arrow_util_deps += snappy_dep endif if needs_zlib @@ -483,6 +547,11 @@ foreach key, val : arrow_components arrow_deps += val.get('dependencies', []) endforeach +arrow_lib_cpp_shared_args = ['-DARROW_EXPORTING'] +if needs_compute + arrow_lib_cpp_shared_args += ['-DARROW_COMPUTE_EXPORTING'] +endif + arrow_lib = library( 'arrow', sources: arrow_srcs, @@ -490,12 +559,22 @@ arrow_lib = library( dependencies: arrow_deps, install: true, gnu_symbol_visibility: 'inlineshidden', - cpp_shared_args: ['-DARROW_EXPORTING'], + c_args: ['-DURI_STATIC_BUILD'], + c_shared_args: ['-DARROW_EXPORTING'], + cpp_args: ['-DURI_STATIC_BUILD'], + cpp_shared_args: arrow_lib_cpp_shared_args, + cpp_static_args: ['-DARROW_STATIC'], ) +arrow_compile_args = [] +if get_option('default_library') == 'static' + arrow_compile_args += ['-DARROW_STATIC'] +endif + arrow_dep = declare_dependency( include_directories: [include_dir], link_with: arrow_lib, + compile_args: arrow_compile_args, ) meson.override_dependency('arrow', arrow_dep) @@ -552,15 +631,23 @@ if needs_compute arrow_compute_lib = library( 'arrow-compute', sources: arrow_compute_lib_sources, - dependencies: arrow_dep, + dependencies: [arrow_dep] + int128_deps, install: true, gnu_symbol_visibility: 'inlineshidden', cpp_shared_args: ['-DARROW_COMPUTE_EXPORTING'], + cpp_static_args: ['-DARROW_COMPUTE_STATIC'], ) + + arrow_compute_compile_args = [] + if get_option('default_library') == 'static' + arrow_compute_compile_args += ['-DARROW_COMPUTE_STATIC'] + endif + arrow_compute_dep = declare_dependency( link_with: arrow_compute_lib, include_directories: include_dir, dependencies: arrow_dep, + compile_args: arrow_compute_compile_args, ) meson.override_dependency('arrow-compute', arrow_compute_dep) else @@ -612,41 +699,43 @@ install_headers( ) if needs_testing - filesystem_dep = dependency( - 'boost', - modules: ['filesystem'], - required: false, - ) - if not filesystem_dep.found() - cmake = import('cmake') - boost_opt = cmake.subproject_options() - boost_opt.add_cmake_defines( - {'BOOST_INCLUDE_LIBRARIES': 'filesystem;system'}, - ) - boost_proj = cmake.subproject('boost', options: boost_opt) - filesystem_dep = boost_proj.dependency('boost_filesystem') - endif - gtest_dep = dependency('gtest') gtest_main_dep = dependency('gtest_main') gtest_dep = dependency('gtest') + gmock_main_dep = dependency('gmock_main') gmock_dep = dependency('gmock') else - filesystem_dep = disabler() gtest_dep = disabler() gtest_main_dep = disabler() gtest_dep = disabler() + gmock_main_dep = disabler() gmock_dep = disabler() endif if needs_testing - arrow_testing_lib = static_library( + arrow_testing_lib_deps = [arrow_dep, boost_deps] + + if host_machine.system() == 'windows' + winsock_dep = cpp_compiler.find_library('ws2_32') + arrow_testing_lib_deps += [winsock_dep] + endif + + arrow_testing_lib = library( 'arrow_testing', sources: arrow_testing_srcs, - dependencies: [arrow_dep, filesystem_dep, gmock_dep, gtest_dep], + dependencies: arrow_testing_lib_deps + [gmock_main_dep, rapidjson_dep], + cpp_shared_args: ['-DARROW_TESTING_EXPORTING'], + cpp_static_args: ['-DARROW_TESTING_STATIC'], ) - arrow_testing_dep = declare_dependency(link_with: [arrow_testing_lib]) + arrow_testing_compile_args = [] + if get_option('default_library') == 'static' + arrow_testing_compile_args += ['-DARROW_TESTING_STATIC'] + endif + arrow_testing_dep = declare_dependency( + link_with: [arrow_testing_lib], + compile_args: arrow_testing_compile_args, + ) meson.override_dependency('arrow-testing', arrow_testing_dep) else arrow_testing_dep = disabler() @@ -655,21 +744,13 @@ endif if needs_tests arrow_test_dep = declare_dependency( dependencies: [ - arrow_dep, arrow_testing_dep, - filesystem_dep, - gmock_dep, - gtest_main_dep, + arrow_testing_lib_deps, + gmock_main_dep, ], ) arrow_test_dep_no_main = declare_dependency( - dependencies: [ - arrow_dep, - arrow_testing_dep, - filesystem_dep, - gmock_dep, - gtest_dep, - ], + dependencies: [arrow_testing_dep, arrow_testing_lib_deps, gmock_dep], ) else arrow_test_dep = disabler() @@ -814,7 +895,14 @@ subdir('tensor') subdir('util') subdir('vendored') -gflags_dep = dependency('gflags', include_type: 'system') +gflags_base_dep = dependency('gflags', include_type: 'system') +if host_machine.system() == 'windows' + shlwapi_lib = cpp_compiler.find_library('shlwapi') + gflags_dep = declare_dependency(dependencies: [gflags_base_dep, shlwapi_lib]) +else + gflags_dep = gflags_base_dep +endif + if needs_integration or needs_tests subdir('integration') endif diff --git a/cpp/src/arrow/testing/meson.build b/cpp/src/arrow/testing/meson.build index 4d323319be5..4656b398293 100644 --- a/cpp/src/arrow/testing/meson.build +++ b/cpp/src/arrow/testing/meson.build @@ -48,6 +48,7 @@ foreach key, val : testing_tests key, sources: val['sources'], dependencies: [arrow_test_dep, val.get('dependencies', [])], + implicit_include_directories: false, # math.h may conflict with stdlib ) test(key, exc) endforeach @@ -57,7 +58,11 @@ if needs_tests and needs_filesystem 'arrow-filesystem-example', sources: ['examplefs.cc'], dependencies: [arrow_dep, gtest_dep], + implicit_include_directories: false, # math.h may conflict with stdlib + ) + arrow_filesystem_example_dep = declare_dependency( + link_with: arrow_filesystem_example, ) else - arrow_filesystem_example = disabler() + arrow_filesystem_example_dep = disabler() endif diff --git a/cpp/src/arrow/testing/process.cc b/cpp/src/arrow/testing/process.cc index e5632e47253..0e23eb193ec 100644 --- a/cpp/src/arrow/testing/process.cc +++ b/cpp/src/arrow/testing/process.cc @@ -356,4 +356,12 @@ Status Process::Execute() { return impl_->Execute(); } bool Process::IsRunning() { return impl_->IsRunning(); } uint64_t Process::pid() { return impl_->pid(); } + +bool Process::IsAvailable() { +#ifdef BOOST_PROCESS_AVAILABLE + return true; +#else + return false; +#endif +} } // namespace arrow::util diff --git a/cpp/src/arrow/testing/process.h b/cpp/src/arrow/testing/process.h index d4d2ae124f4..f23de3789d4 100644 --- a/cpp/src/arrow/testing/process.h +++ b/cpp/src/arrow/testing/process.h @@ -38,6 +38,7 @@ class ARROW_TESTING_EXPORT Process { Status Execute(); bool IsRunning(); uint64_t pid(); + static bool IsAvailable(); private: class Impl; diff --git a/cpp/src/arrow/util/meson.build b/cpp/src/arrow/util/meson.build index 2fbbedbb931..e08b257620d 100644 --- a/cpp/src/arrow/util/meson.build +++ b/cpp/src/arrow/util/meson.build @@ -53,13 +53,12 @@ conf_data.set('ARROW_ORC', false) conf_data.set('ARROW_PARQUET', needs_parquet) conf_data.set('ARROW_SUBSTRAIT', false) conf_data.set('ARROW_AZURE', false) -conf_data.set('ARROW_ENABLE_THREADING', true) +conf_data.set('ARROW_ENABLE_THREADING', arrow_enable_threading) conf_data.set('ARROW_GCS', false) conf_data.set('ARROW_HDFS', false) conf_data.set('ARROW_S3', false) conf_data.set('ARROW_USE_GLOG', false) -has_int128 = cpp_compiler.has_define('__SIZEOF_INT128__') conf_data.set('ARROW_USE_NATIVE_INT128', has_int128) conf_data.set('ARROW_WITH_BROTLI', needs_brotli) @@ -223,13 +222,26 @@ utility_test_srcs = [ 'value_parsing_test.cc', ] +arrow_utility_test_link_args = [] if host_machine.system() == 'windows' # This manifest enables long file paths on Windows 10+ # See https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#enable-long-paths-in-windows-10-version-1607-and-later if cpp_compiler.get_id() == 'msvc' - utility_test_srcs += ['io_util_test.manifest'] + arrow_utility_test_link_args += [ + '/MANIFEST:EMBED', + '/MANIFESTINPUT:' + join_paths( + meson.current_source_dir(), + 'io_util_test.manifest', + ), + ] else - utility_test_srcs += ['io_util_test.rc'] + arrow_utility_test_link_args += [ + '/MANIFEST:EMBED', + '/MANIFESTINPUT:' + join_paths( + meson.current_source_dir(), + 'io_util_test.rc', + ), + ] endif endif @@ -238,6 +250,7 @@ exc = executable( sources: utility_test_srcs, dependencies: arrow_test_dep_no_main, implicit_include_directories: false, + link_args: arrow_utility_test_link_args, ) test('arrow-utility-test', exc) @@ -273,7 +286,7 @@ foreach key, val : util_tests exc = executable( key, sources: val['sources'], - dependencies: [arrow_test_dep], + dependencies: arrow_test_dep, implicit_include_directories: false, ) test(key, exc) diff --git a/cpp/src/parquet/meson.build b/cpp/src/parquet/meson.build index e6ff43a0bae..c3f2b65ddb4 100644 --- a/cpp/src/parquet/meson.build +++ b/cpp/src/parquet/meson.build @@ -57,7 +57,14 @@ parquet_srcs = files( 'xxhasher.cc', ) -thrift_dep = dependency('thrift', allow_fallback: false, required: false) +thrift_dep = dependency( + 'thrift', + allow_fallback: false, + # pkg-config cannot be used with Thrift on Windows due to + # https://issues.apache.org/jira/browse/THRIFT-5894 + method: host_machine.system() == 'windows' ? 'cmake' : 'auto', + required: false, +) if not thrift_dep.found() cmake = import('cmake') thrift_opts = cmake.subproject_options() @@ -121,9 +128,18 @@ parquet_lib = library( sources: parquet_srcs, dependencies: parquet_deps, gnu_symbol_visibility: 'inlineshidden', + cpp_shared_args: ['-DPARQUET_EXPORTING'], + cpp_static_args: ['-DPARQUET_STATIC'], ) -parquet_dep = declare_dependency(link_with: parquet_lib) +parquet_compile_args = [] +if get_option('default_library') == 'static' + parquet_compile_args += ['-DPARQUET_STATIC'] +endif +parquet_dep = declare_dependency( + link_with: parquet_lib, + compile_args: parquet_compile_args, +) subdir('api') subdir('arrow') diff --git a/cpp/subprojects/liblzma.wrap b/cpp/subprojects/liblzma.wrap new file mode 100644 index 00000000000..4586635187b --- /dev/null +++ b/cpp/subprojects/liblzma.wrap @@ -0,0 +1,30 @@ +# 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 = xz-5.2.12 +source_url = http://tukaani.org/xz/xz-5.2.12.tar.xz +source_filename = xz-5.2.12.tar.xz +source_hash = f79a92b84101d19d76be833aecc93e68e56065b61ec737610964cd4f6c54ff2e +patch_filename = liblzma_5.2.12-3_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/liblzma_5.2.12-3/get_patch +patch_hash = bf9eb44c6ba8d5157d5fdcc35a3d5a7a9d409a6c4ae696122bbb9e2d9d12467a +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/liblzma_5.2.12-3/xz-5.2.12.tar.xz +wrapdb_version = 5.2.12-3 + +[provide] +liblzma = lzma_dep diff --git a/cpp/subprojects/proxy-libintl.wrap b/cpp/subprojects/proxy-libintl.wrap new file mode 100644 index 00000000000..1f351a75c27 --- /dev/null +++ b/cpp/subprojects/proxy-libintl.wrap @@ -0,0 +1,27 @@ +# 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 = proxy-libintl-0.4 +source_url = https://github.com/frida/proxy-libintl/archive/refs/tags/0.4.tar.gz +source_filename = proxy-libintl-0.4.tar.gz +source_hash = 13ef3eea0a3bc0df55293be368dfbcff5a8dd5f4759280f28e030d1494a5dffb +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/proxy-libintl_0.4-1/proxy-libintl-0.4.tar.gz +wrapdb_version = 0.4-1 + +[provide] +intl = intl_dep