From 2d8aaf95a6c1fd8c27af9c8293f57ea5ba148283 Mon Sep 17 00:00:00 2001 From: Will Ayd Date: Mon, 15 Sep 2025 15:14:50 -0400 Subject: [PATCH 1/3] GH-46147: [C++] Implement GCS support in Meson --- ci/scripts/cpp_build.sh | 1 - cpp/src/arrow/meson.build | 47 +++++++++++++++++++++++++++++++++- cpp/src/arrow/util/meson.build | 2 +- 3 files changed, 47 insertions(+), 3 deletions(-) diff --git a/ci/scripts/cpp_build.sh b/ci/scripts/cpp_build.sh index eb4291bafbd..2f02f8c1496 100755 --- a/ci/scripts/cpp_build.sh +++ b/ci/scripts/cpp_build.sh @@ -146,7 +146,6 @@ if [ "${ARROW_USE_MESON:-OFF}" = "ON" ]; then --pkg-config-path="${CONDA_PREFIX}/lib/pkgconfig/" \ -Dauto_features=enabled \ -Dfuzzing=disabled \ - -Dgcs=disabled \ -Ds3=disabled \ . \ ${source_dir} diff --git a/cpp/src/arrow/meson.build b/cpp/src/arrow/meson.build index 8887da9174c..bc69583698d 100644 --- a/cpp/src/arrow/meson.build +++ b/cpp/src/arrow/meson.build @@ -410,7 +410,52 @@ if needs_filesystem endif if needs_gcs - error('gcs filesystem support is not yet implemented in Meson') + arrow_filesystem_srcs += files( + 'filesystem/gcsfs.cc', + 'filesystem/gcsfs_internal.cc', + ) + + gcs_common_dep = dependency( + 'google_cloud_cpp_common', + allow_fallback: false, + required: false, + ) + gcs_rest_internal_dep = dependency( + 'google_cloud_cpp_rest_internal', + allow_fallback: false, + required: false, + ) + gcs_storage_dep = dependency( + 'google_cloud_cpp_storage', + allow_fallback: false, + required: false, + ) + + if not (gcs_common_dep.found() + and gcs_rest_internal_dep.found() + and gcs_storage_dep.found() +) + error( + ''' +The Arrow Meson configuration requires that google_cloud_cpp_common, +google_cloud_cpp_rest_internal, and google_cloud_cpp_storage be provided +by the host system, but these could not be found. Subproject fallback is +not implemented. + +Ensure that you have all of these components installed on your system, or +disable Arrow gcs support with -Dgcs=disabled. + ''', + ) + endif + + gcs_dep = declare_dependency( + dependencies: [ + gcs_common_dep, + gcs_rest_internal_dep, + gcs_storage_dep, + ], + ) + arrow_filesystem_deps += [gcs_dep] endif if needs_hdfs diff --git a/cpp/src/arrow/util/meson.build b/cpp/src/arrow/util/meson.build index bce4de21b94..0c49abc9b9f 100644 --- a/cpp/src/arrow/util/meson.build +++ b/cpp/src/arrow/util/meson.build @@ -54,7 +54,7 @@ conf_data.set('ARROW_PARQUET', needs_parquet) conf_data.set('ARROW_SUBSTRAIT', needs_substrait) conf_data.set('ARROW_AZURE', false) conf_data.set('ARROW_ENABLE_THREADING', true) -conf_data.set('ARROW_GCS', false) +conf_data.set('ARROW_GCS', needs_gcs) conf_data.set('ARROW_HDFS', false) conf_data.set('ARROW_S3', false) conf_data.set('ARROW_USE_GLOG', false) From 03fe7502778ed71994c112af9f6c258cebed133c Mon Sep 17 00:00:00 2001 From: Will Ayd Date: Thu, 18 Sep 2025 12:51:40 -0400 Subject: [PATCH 2/3] Add absl_time_zone_dep to GCS --- cpp/src/arrow/meson.build | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cpp/src/arrow/meson.build b/cpp/src/arrow/meson.build index bc69583698d..36d8d62a3db 100644 --- a/cpp/src/arrow/meson.build +++ b/cpp/src/arrow/meson.build @@ -455,7 +455,9 @@ disable Arrow gcs support with -Dgcs=disabled. gcs_storage_dep, ], ) - arrow_filesystem_deps += [gcs_dep] + + absl_time_zone_dep = dependency('absl_time_zone') + arrow_filesystem_deps += [gcs_dep, absl_time_zone_dep] endif if needs_hdfs From 2fc1541e4243d9d921e49addaba4c8473074ebb5 Mon Sep 17 00:00:00 2001 From: Will Ayd Date: Thu, 18 Sep 2025 16:21:33 -0400 Subject: [PATCH 3/3] Try without explicit absl_time_zone dependency --- cpp/src/arrow/meson.build | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cpp/src/arrow/meson.build b/cpp/src/arrow/meson.build index 36d8d62a3db..43050aa1597 100644 --- a/cpp/src/arrow/meson.build +++ b/cpp/src/arrow/meson.build @@ -456,8 +456,7 @@ disable Arrow gcs support with -Dgcs=disabled. ], ) - absl_time_zone_dep = dependency('absl_time_zone') - arrow_filesystem_deps += [gcs_dep, absl_time_zone_dep] + arrow_filesystem_deps += [gcs_dep] endif if needs_hdfs