This is an automated email from the ASF dual-hosted git repository.
kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new bbb3d48000 GH-46147: [C++] Implement GCS support in Meson (#47568)
bbb3d48000 is described below
commit bbb3d48000d98b5cec868a417734422b4c9a6976
Author: William Ayd <[email protected]>
AuthorDate: Sun Nov 9 07:44:48 2025 -0500
GH-46147: [C++] Implement GCS support in Meson (#47568)
### Rationale for this change
This continues adding features to the Meson configuration (azure is already
implemented)
### What changes are included in this PR?
System-provided GCS can be leveraged to build optional GCS features. Note
that this does not support Meson to automatically download GCS - GCS is a
rather complicated CMake project and does not work well in the Meson/CMake
subproject bridge. Another PR will have to implement that, due to its
complexity (or ideally a Meson wrap for GCS is created)
### Are these changes tested?
Yes
### Are there any user-facing changes?
No
* GitHub Issue: #46147
Authored-by: Will Ayd <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
---
ci/scripts/cpp_build.sh | 1 -
cpp/src/arrow/meson.build | 48 +++++++++++++++++++++++++++++++++++++++++-
cpp/src/arrow/util/meson.build | 2 +-
3 files changed, 48 insertions(+), 3 deletions(-)
diff --git a/ci/scripts/cpp_build.sh b/ci/scripts/cpp_build.sh
index eb4291bafb..2f02f8c149 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 8887da9174..43050aa159 100644
--- a/cpp/src/arrow/meson.build
+++ b/cpp/src/arrow/meson.build
@@ -410,7 +410,53 @@ 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 bce4de21b9..0c49abc9b9 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)