GH-50868: [C++][CI] Suppress deprecated Abseil API warnings for GCS on macOS - #50887
Conversation
|
|
|
Someone is referencing |
|
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 |
|
|
7f60408 to
ba7d8b6
Compare
|
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. The current PR implements approach 3. 1. Use the bundled Abseil
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 flagsI 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 componentsThis 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) |
4e859a3 to
2e5cc60
Compare
|
rebased for re-run CI. |
|
Tes Ruby failed re-applied skip |
|
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. |
Rationale for this change
Around August 10, 2026, the
ARM64 macOS GLib & Rubyjob 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:
absl::visithas not been removed, but using it with Abseil20260526.0produces 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::visitis recommended:However,
absl::visitis 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?
-Wno-error=deprecated-declarationsto avoid build failures caused by deprecation warnings.Are these changes tested?
Yes.
Are there any user-facing changes?
No.