GH-55440: [C++] Move bundled google-cloud-cpp libraries #55319
<!--
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.
-->
Thanks for opening a pull request!
This pull request has been automatically converted to a draft because its title doesn't match Arrow's required format.
If this is not a minor PR, could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose
Opening GitHub issues ahead of time contributes to the Openness of the Apache Arrow project.
Then could you also rename the pull request title in the following format?
GH-${GITHUB_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}
or
MINOR: [${COMPONENT}] ${SUMMARY}
After updating the title, you can mark the pull request as ready for review.
See also:
Other pull requests
Contribution Guidelines - Contributing Overview
As found in https://github.com/apache/arrow/pull/55317#issuecomment-6506137683, the following PR
caused
C++ Extra job AMD64 Debian SIMD Level NONE to start failing on 28 Oct
https://github.com/apache/arrow/actions/runs/40608463298/job/122553847383#step:6:5030
[100%] Linking CXX executable arrow-example-s3-static
/usr/bin/ld: /usr/local/lib/libarrow_bundled_dependencies.a(log.cc.o): in function `google::cloud::v3_2::(anonymous namespace)::Timestamp::Timestamp(std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > > const&)':
/build/cpp/_deps/google_cloud_cpp-src/google/cloud/log.cc:41:(.text+0x29): undefined reference to `absl::debian7::FromChrono(std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > > const&)'
/usr/bin/ld: /usr/local/lib/libarrow_bundled_dependencies.a(log.cc.o): in function `google::cloud::v3_2::(anonymous namespace)::operator<<(std::ostream&, google::cloud::v3_2::(anonymous namespace)::Timestamp const&)':
/build/cpp/_deps/google_cloud_cpp-src/google/cloud/log.cc:47:(.text+0x9f): undefined reference to `absl::debian7::FormatTime[abi:cxx11](absl::debian7::string_view, absl::debian7::Time, absl::debian7::TimeZone)'
/usr/bin/ld: /usr/local/lib/libarrow_bundled_dependencies.a(log.cc.o): in function `absl::debian7::UTCTimeZone()':
/usr/include/absl/time/time.h:1277:(.text._ZN4absl7debian711UTCTimeZoneEv[_ZN4absl7debian711UTCTimeZoneEv]+0x9): undefined reference to `absl::debian7::time_internal::cctz::utc_time_zone()'
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/arrow-example-s3-static.dir/build.make:144: arrow-example-s3-static] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:122: CMakeFiles/arrow-example-s3-static.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2
And also test-debian-13-cpp-amd64 is failing since 29 Oct 2026 the same way:
https://github.com/ursacomputing/crossbow/actions/runs/40825143204/job/123286357741#step:7:5014
[100%] Linking CXX executable arrow-example-s3-static
/usr/bin/ld: /usr/local/lib/libarrow_bundled_dependencies.a(log.cc.o): in function `google::cloud::v3_2::(anonymous namespace)::Timestamp::Timestamp(std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > > const&)':
/build/cpp/_deps/google_cloud_cpp-src/google/cloud/log.cc:41:(.text+0x29): undefined reference to `absl::debian7::FromChrono(std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > > const&)'
/usr/bin/ld: /usr/local/lib/libarrow_bundled_dependencies.a(log.cc.o): in function `google::cloud::v3_2::(anonymous namespace)::operator<<(std::ostream&, google::cloud::v3_2::(anonymous namespace)::Timestamp const&)':
/build/cpp/_deps/google_cloud_cpp-src/google/cloud/log.cc:47:(.text+0x9f): undefined reference to `absl::debian7::FormatTime[abi:cxx11](absl::debian7::string_view, absl::debian7::Time, absl::debian7::TimeZone)'
/usr/bin/ld: /usr/local/lib/libarrow_bundled_dependencies.a(log.cc.o): in function `absl::debian7::UTCTimeZone()':
/usr/include/absl/time/time.h:1277:(.text._ZN4absl7debian711UTCTimeZoneEv[_ZN4absl7debian711UTCTimeZoneEv]+0x9): undefined reference to `absl::debian7::time_internal::cctz::utc_time_zone()'
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/arrow-example-s3-static.dir/build.make:144: arrow-example-s3-static] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:122: CMakeFiles/arrow-example-s3-static.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2
@github-actions crossbow submit test-debian-13-cpp-amd64
Revision: 2476a34c43bef79ae4620e3ee33aea16d93eb323
Submitted crossbow builds: ursacomputing/crossbow @ actions-1fd9f52c9c
|Task|Status|
|----|------|
|test-debian-13-cpp-amd64||
:warning: GitHub issue #55440 has been automatically assigned in GitHub to PR creator.
@tadeja, I remembered about this issue now and was trying to find whether it was already fixed or not. Can I help with anything?
@github-actions crossbow submit test-debian-13-cpp-amd64
Revision: d1528240edaa9ffb75729ffd034a457cc6a82ffa
Submitted crossbow builds: ursacomputing/crossbow @ actions-b7baa33877
|Task|Status|
|----|------|
|test-debian-13-cpp-amd64||
@github-actions crossbow submit r-binary-packages test-r-offline-maximal test-debian-13-cpp-amd64
Revision: 2e189b372c5d3c5e72a8bb9a976fac835543373d
Submitted crossbow builds: ursacomputing/crossbow @ actions-4af363edcb
|Task|Status|
|----|------|
|r-binary-packages||
|test-debian-13-cpp-amd64||
|test-r-offline-maximal||
Adding this archive unconditionally breaks Windows R builds using pre-split binaries: those distributions contain the SDK in libarrow_bundled_dependencies.a and have no libarrow_gcs_bundled_dependencies.a, so the linker fails with cannot find -larrow_gcs_bundled_dependencies. tools/nixlibs.R still accepts pre-downloaded binaries (ARROW_DOWNLOADED_BINARIES/RWINLIB_LOCAL) and selects the latest available nightly independently of this checkout. Please add this flag only when the selected binary distribution contains the new archive, as the Unix configure path already does.
<!-- ccr-overview-v2 -->
🟡 Changes recommended
The unconditional GCS archive link flag breaks Windows R builds using pre-split binaries that lack the archive, so it must be conditional on the selected distribution’s contents.
<details open>
<summary><strong>1 open issue</strong></summary>
</details>
<details>
<summary><strong>What changed in this PR</strong></summary>
This PR addresses the static-linking regression introduced when GCS moved into its own Arrow library. It separates bundled Google Cloud SDK archives from core Arrow dependencies and adds static-link checks.
Changes:
| File | Description |
| ---- | ----------- |
| r/configure.win | Add the GCS bundled archive to Windows binary link flags. |
| r/configure | Detect the GCS bundled archive for fallback linking. |
| dev/tasks/linux-packages/apache-arrow/yum/arrow.spec.in | Include GCS static archives in RPM development packages. |
| dev/tasks/linux-packages/apache-arrow/debian/libarrow-gcs-dev.install | Include GCS static archives in Debian development packages. |
| cpp/src/arrow/CMakeLists.txt | Build and install the GCS dependency archive and update link metadata. |
| cpp/src/arrow/ArrowGcsConfig.cmake.in | Expose the bundled GCS archive and its dependencies to installed consumers. |
| cpp/src/arrow/ArrowConfig.cmake.in | Propagate bundled archive dependencies and macOS framework requirements. |
| cpp/examples/minimal_build/README.md | Document static filesystem example options. |
| cpp/examples/minimal_build/example.cc | Exercise GCS filesystem construction. |
| cpp/examples/minimal_build/CMakeLists.txt | Add GCS-only and combined static-link targets. |
| cpp/cmake_modules/ThirdpartyToolchain.cmake | Track bundled GCS libraries separately and add CoreFoundation link metadata. |
| ci/scripts/cpp_test.sh | Check S3 independently, then build and run static filesystem examples. |
</details>
<sub>Review effort: Balanced</sub>
<!-- ccr-overview-v2 -->
🟢 Approval recommended
No active review issues are identified for the GCS dependency archive separation and related static-linking and packaging updates.
No open issues 🎉
<details>
<summary><strong>1 resolved since last review</strong></summary>
</details>
<sub>Review effort: Balanced</sub>
@github-actions crossbow submit r-binary-packages test-r-offline-maximal test-debian-13-cpp-amd64
Revision: 04198cfb9fcc0ad62787f322eda9f032bcec6b1e
Submitted crossbow builds: ursacomputing/crossbow @ actions-788d5c7556
|Task|Status|
|----|------|
|r-binary-packages||
|test-debian-13-cpp-amd64||
|test-r-offline-maximal||
<!-- ccr-overview-v2 -->
🟢 Approval recommended
No active review issues are reported for the GCS static-link dependency changes.
No open issues 🎉
<sub>Review effort: Balanced</sub>
@github-actions crossbow submit test-r-offline-maximal
Revision: 04198cfb9fcc0ad62787f322eda9f032bcec6b1e
Submitted crossbow builds: ursacomputing/crossbow @ actions-f295c03c10
|Task|Status|
|----|------|
|test-r-offline-maximal||
<!-- ccr-overview-v2 -->
🟢 Approval recommended
No active review issues are recorded for the GCS dependency archive separation.
No open issues 🎉
<sub>Review effort: Balanced</sub>
@github-actions crossbow submit test-debian-13-cpp-amd64
Revision: 57f6da7b56fddc68922f6e42dd03707a74549ccf
Submitted crossbow builds: ursacomputing/crossbow @ actions-8209b2703a
|Task|Status|
|----|------|
|test-debian-13-cpp-amd64||
@github-actions crossbow submit test-ubuntu-22.04-cpp-bundled test-ubuntu-24.04-cpp-gcc-13-bundled
Revision: 57f6da7b56fddc68922f6e42dd03707a74549ccf
Submitted crossbow builds: ursacomputing/crossbow @ actions-2f1460b1ff
|Task|Status|
|----|------|
|test-ubuntu-22.04-cpp-bundled||
|test-ubuntu-24.04-cpp-gcc-13-bundled||
@raulcd, @kou this is finally ready for a review now.
All failing 3 C++ jobs and R job look unrelated (appear on other PRs too).
I am still trying to get my head around why this is an issue but
list(PREPEND ARROW_BUNDLED_STATIC_LIBS ${AWSSDK_LINK_LIBRARIES})
isn't and we don't seem to require an
ARROW_S3_BUNDLED_STATIC_LIBSshouldn't we require ARROW_EXAMPLE_S3_STATIC_CHECK here too? I am not sure the if is covering this.
Could you keep this list in alphabetical order?
-DARROW_EXAMPLE_GCS_STATIC_CHECK=ON \
-DARROW_EXAMPLE_S3_STATIC_CHECK=ON \
+1
I've opened https://github.com/apache/arrow/issues/55583 to clean up ArrowConfig.cmake.in.
ok, as this is green and fixes a real issue I think we should merge. We should probably create ARROW_S3_BUNDLED_STATIC_LIBS as this might be just coincidence that is not currently failing but we can do that afterwards.
Approved these changes.
I think that we should fix this before we merge this.
@github-actions crossbow submit test-debian-13-cpp-amd64 test-ubuntu-22.04-cpp-bundled test-ubuntu-24.04-cpp-gcc-13-bundled
<!-- ccr-overview-v2 -->
🟢 Approval recommended
No active review issues were identified for the change separating bundled GCS dependencies from Arrow’s core archive.
No open issues 🎉
<sub>Review effort: Balanced</sub>
Revision: 3b04d01166543bad8d135f97e8fbff941d318109
Submitted crossbow builds: ursacomputing/crossbow @ actions-b0e1ebe2bb
|Task|Status|
|----|------|
|test-debian-13-cpp-amd64||
|test-ubuntu-22.04-cpp-bundled||
|test-ubuntu-24.04-cpp-gcc-13-bundled||
Fixed, latest commit commit 3b04d01
Oh, sorry, I didn't use your change... Thank you for this!
Tentatively created this one
Approved these changes.
kou
tadeja
Rationale for this change
Fix #55440. This is a follow-up to #54905. Bundled
google-cloud-cppremained inlibarrow_bundled_dependencies.a, which broke static linking of non-GCS consumers such asarrow-example-s3-static.What changes are included in this PR?
google-cloud-cppinto a newlibarrow_gcs_bundled_dependencieslibrary, linked viaArrowGcs::arrow_gcs_staticandarrow-gcs.pc.cpp/examples/minimal_build.arrow_gcs_bundled_dependenciesinbuilding.rstAre these changes tested?
Yes. The new minimal_build static-link checks in CI C++ (
ARM64 macOS 26 C++or 15-intel C++ ...) and C++ Extra (AMD64 Debian SIMD Level NONEorAMD64 Alpine Linux...) and crossbowtest-debian-13-cpp-amd64Are there any user-facing changes?
Yes. Static builds with bundled
google-cloud-cppinstall a newlibarrow_gcs_bundled_dependencieslibrary.CMake and pkg-config users get it automatically, others must link it after
arrow_gcs.Was AI used for this PR?
In accordance to the AI generation guidelines, please disclose below whether and how AI was used in this PR.
PR code and description written by:
Reviewed before submission by: