Skip to content

GH-50868: [C++][CI] Suppress deprecated Abseil API warnings for GCS on macOS - #50887

Merged
kou merged 21 commits into
apache:mainfrom
hiroyuki-sato:topic/abseil-build-on-macos
Aug 19, 2026
Merged

GH-50868: [C++][CI] Suppress deprecated Abseil API warnings for GCS on macOS#50887
kou merged 21 commits into
apache:mainfrom
hiroyuki-sato:topic/abseil-build-on-macos

Conversation

@hiroyuki-sato

@hiroyuki-sato hiroyuki-sato commented Aug 16, 2026

Copy link
Copy Markdown
Collaborator

Rationale for this change

Around August 10, 2026, the ARM64 macOS GLib & Ruby job in this project started failing.

The failure appears to have been caused by the Abseil version used when building the bundled google-cloud-cpp on macOS being updated to 20260526.0.

https://github.com/Homebrew/homebrew-core/blob/3decf2e9073cb08af3b4d5be7623f333f41fa3cc/Formula/a/abseil.rb

In Abseil LTS 20260526.0, many polyfill types and related APIs provided for pre-C++17 environments were marked as deprecated. Users are encouraged to migrate to the corresponding C++ standard library APIs.

https://github.com/abseil/abseil-cpp/releases/tag/20260526.0

The build failure occurs at the following code in google-cloud-cpp:

/Users/runner/work/arrow/arrow/build/cpp/_deps/google_cloud_cpp-src/google/cloud/stream_range.h:208:11: error: 'visit<UnpackVariant, std::variant<google::cloud::Status, google::cloud::storage::ObjectMetadata>>' is deprecated [-Werror,-Wdeprecated-declarations]
  208 |     absl::visit(UnpackVariant{*this}, std::move(v));
      |           ^

absl::visit has not been removed, but using it with Abseil 20260526.0 produces a deprecation warning. This would normally remain a warning, but Apache Arrow's CI uses -Werror, which causes the deprecation warning to be treated as a compilation error.

For C++17 and later, using std::visit is recommended:

std::visit(UnpackVariant{*this}, std::move(v));

However, absl::visit is still used in the latest google-cloud-cpp source.

https://github.com/googleapis/google-cloud-cpp/blob/main/google/cloud/stream_range.h#L206-L208

A fundamental fix will likely be required in google-cloud-cpp.

What changes are included in this PR?

  • Add -Wno-error=deprecated-declarations to avoid build failures caused by deprecation warnings.
  • Skip the red-arrow-flight tests on macOS because they currently fail. This will be addressed in a separate issue.

Are these changes tested?

Yes.

Are there any user-facing changes?

No.

@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #50886 has been automatically assigned in GitHub to PR creator.

@github-actions github-actions Bot added the awaiting review Awaiting review label Aug 16, 2026
@hiroyuki-sato hiroyuki-sato changed the title GH-50886: Use bundled Abseil in macOS CI to avoid deprecation errors GH-50886: [C++][CI] Use bundled Abseil in macOS CI to avoid deprecation errors Aug 16, 2026
@hiroyuki-sato

Copy link
Copy Markdown
Collaborator Author

Someone is referencing abseil/20260526.0 ex) protobuf or grpc, something
https://github.com/apache/arrow/actions/runs/31952314361/job/95177575907#step:12:1153

@hiroyuki-sato

hiroyuki-sato commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator Author

Build passed

diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml
index 2794d55ba8..afdc115287 100644
--- a/.github/workflows/ruby.yml
+++ b/.github/workflows/ruby.yml
@@ -158,6 +158,8 @@ jobs:
       ARROW_WITH_SNAPPY: ON
       ARROW_WITH_ZLIB: ON
       ARROW_WITH_ZSTD: ON
+      absl_SOURCE: BUNDLED
+      ARROW_DEPENDENCY_SOURCE: BUNDLED
     steps:
       - name: Checkout Arrow
         uses: actions/checkout@v7

@hiroyuki-sato hiroyuki-sato changed the title GH-50886: [C++][CI] Use bundled Abseil in macOS CI to avoid deprecation errors GH-50868: [C++][CI] Use bundled Abseil in macOS CI to avoid deprecation errors Aug 17, 2026
@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #50868 has been automatically assigned in GitHub to PR creator.

@hiroyuki-sato

hiroyuki-sato commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator Author

I believe the two CI failures are unrelated to this PR.

I tried the following three approaches. Approaches 1 and 3 worked, while approach 2 failed to build.
Thank you @kou

The current PR implements approach 3.

1. Use the bundled Abseil

  • Use the bundled Abseil 20250127.0 for the ARM64 macOS GLib & Ruby build.
  • Skip the red-arrow-flight tests on macOS because they fail.

With this approach, a bit more work is needed because Protobuf and gRPC still appear to use the Homebrew version of Abseil.

diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml
index 2794d55ba8..370a161e6d 100644
--- a/.github/workflows/ruby.yml
+++ b/.github/workflows/ruby.yml
@@ -158,6 +158,14 @@ jobs:
       ARROW_WITH_SNAPPY: ON
       ARROW_WITH_ZLIB: ON
       ARROW_WITH_ZSTD: ON
+      absl_SOURCE: BUNDLED
     steps:
       - name: Checkout Arrow
         uses: actions/checkout@v7
diff --git a/c_glib/test/flight-sql/test-client.rb b/c_glib/test/flight-sql/test-client.rb
index 631eb3d542..1ed7f7e6e4 100644
--- a/c_glib/test/flight-sql/test-client.rb
+++ b/c_glib/test/flight-sql/test-client.rb
@@ -23,7 +23,7 @@ class TestFlightSQLClient < Test::Unit::TestCase
     @server = nil
     omit("Arrow Flight SQL is required") unless defined?(ArrowFlightSQL)
     omit("Unstable on Windows") if Gem.win_platform?
-    omit("Unstable on x86_64 macOS") if /x86_64-darwin/.match?(RUBY_PLATFORM)
+    omit("Unstable on macOS") if /darwin/.match?(RUBY_PLATFORM)
     @server = Helper::FlightSQLServer.new
     host = "127.0.0.1"
     location = ArrowFlight::Location.new("grpc://#{host}:0")

2. Pass compiler flags

I couldn't get this approach to build, so I abandoned it.

diff --git a/cpp/src/arrow/filesystem/gcsfs.cc b/cpp/src/arrow/filesystem/gcsfs.cc
index ffeba9eadc..b7b13aff7d 100644
--- a/cpp/src/arrow/filesystem/gcsfs.cc
+++ b/cpp/src/arrow/filesystem/gcsfs.cc
@@ -353,7 +353,9 @@ class GcsFileSystem::Impl {
     // "Directory" convention, so if there is at least one object that
     // matches the prefix we assume it is a directory.
     std::string canonical = internal::EnsureTrailingSlash(path.object);
+    ARROW_SUPPRESS_DEPRECATION_WARNING
     auto list_result = client_.ListObjects(path.bucket, gcs::Prefix(canonical));
+    ARROW_UNSUPPRESS_DEPRECATION_WARNING

     for (auto&& object_metadata : list_result) {
       if (!object_metadata) {

Log: https://github.com/apache/arrow/actions/runs/32109702985/job/95626278831

3. Change the compiler flags only when building the GCS-related components

This is the approach implemented in the current PR.

diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt
index 2569b9bcd4..39b3bb5ac1 100644
--- a/cpp/src/arrow/CMakeLists.txt
+++ b/cpp/src/arrow/CMakeLists.txt
@@ -983,6 +983,13 @@ if(ARROW_FILESYSTEM)
                                              "-Wno-documentation;-Wno-documentation-deprecated-sync"
       )
     endif()
+    # Workaround deprecated Abseil APIs used by google-cloud-cpp on macOS
+    # https://github.com/apache/arrow/issues/50868
+    if(APPLE)
+      set_property(SOURCE filesystem/gcsfs.cc filesystem/gcsfs_internal.cc
+                   APPEND
+                   PROPERTY COMPILE_OPTIONS "-Wno-error=deprecated-declarations")
+    endif()
   endif()
   if(ARROW_HDFS)
     list(APPEND ARROW_FILESYSTEM_SRCS filesystem/hdfs.cc)

@hiroyuki-sato hiroyuki-sato changed the title GH-50868: [C++][CI] Use bundled Abseil in macOS CI to avoid deprecation errors GH-50868: [C++][CI] Suppress deprecated Abseil API warnings for GCS on macOS Aug 19, 2026
@hiroyuki-sato
hiroyuki-sato force-pushed the topic/abseil-build-on-macos branch from 4e859a3 to 2e5cc60 Compare August 19, 2026 12:00
@hiroyuki-sato

Copy link
Copy Markdown
Collaborator Author

rebased for re-run CI.

@hiroyuki-sato
hiroyuki-sato requested a review from kou as a code owner August 19, 2026 12:58
@hiroyuki-sato

Copy link
Copy Markdown
Collaborator Author

Tes Ruby failed re-applied skip red-arrow-flight test on macOS.

@kou kou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Comment thread cpp/src/arrow/CMakeLists.txt Outdated
@github-actions github-actions Bot added Component: GLib awaiting merge Awaiting merge and removed awaiting review Awaiting review labels Aug 19, 2026
@kou
kou merged commit 6b429a0 into apache:main Aug 19, 2026
59 of 62 checks passed
@kou kou removed the awaiting merge Awaiting merge label Aug 19, 2026
@conbench-apache-arrow

Copy link
Copy Markdown

After merging your PR, Conbench analyzed the 3 benchmarking runs that have been run so far on merge-commit 6b429a0.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 4 possible false positives for unstable benchmarks that are known to sometimes produce them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants