-
Notifications
You must be signed in to change notification settings - Fork 3.9k
GH-48317: [C++] Use FetchContent for bundled google-cloud-cpp #48333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
0fd9cd1 to
85620d2
Compare
|
@github-actions crossbow submit -g cpp |
|
Revision: 70b632a Submitted crossbow builds: ursacomputing/crossbow @ actions-67f847b9c4 |
|
@github-actions crossbow submit -g r |
|
Revision: 70b632a Submitted crossbow builds: ursacomputing/crossbow @ actions-83a12e40e9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Google Cloud seems to unconditionally install when being built. There's no way of disabling installation as far as I know. This means that both google cloud headers, *.pc files and some of its dependencies seem to be pulled on the RPM packages.
The only way I've found to bypass that is to patch Google cloud so it's not installed via adding a new flag GOOGLE_CLOUD_CPP_ENABLE_INSTALL and set it to OFF to disable installation.
@kou any idea of something I could try?
The existing Linux-packaging CI failures are unrelated are happening on main.
|
@github-actions crossbow submit -g cpp -g r |
|
Revision: 67bcadf Submitted crossbow builds: ursacomputing/crossbow @ actions-fc1a19f010 |
|
@github-actions crossbow submit -g r |
|
Revision: 4ed4bbb Submitted crossbow builds: ursacomputing/crossbow @ actions-b5803cb2be |
|
Could you try this? diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index 28e984f95d..ffc0e17f75 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -3293,9 +3293,12 @@ function(build_crc32c_once)
set(CRC32C_BUILD_TESTS OFF)
set(CRC32C_BUILD_BENCHMARKS OFF)
set(CRC32C_USE_GLOG OFF)
- set(CRC32C_INSTALL OFF)
fetchcontent_makeavailable(crc32c)
+ if(CMAKE_VERSION VERSION_LESS 3.28)
+ set_property(DIRECTORY ${crc32_SOURCE_DIR} PROPERTY EXCLUDE_FROM_ALL TRUE)
+ endif()
+
# Create alias target for consistency (crc32c exports as Crc32c::crc32c when installed)
if(NOT TARGET Crc32c::crc32c)
add_library(Crc32c::crc32c ALIAS crc32c)
@@ -3429,13 +3432,17 @@ function(build_google_cloud_cpp_storage)
set(GOOGLE_CLOUD_CPP_ENABLE_WERROR OFF)
set(GOOGLE_CLOUD_CPP_WITH_MOCKS OFF)
# Disable installation when embedded via FetchContent
- set(GOOGLE_CLOUD_CPP_ENABLE_INSTALL OFF)
+ # set(GOOGLE_CLOUD_CPP_ENABLE_INSTALL OFF)
set(BUILD_TESTING OFF)
# Unity build causes some build errors.
set(CMAKE_UNITY_BUILD FALSE)
fetchcontent_makeavailable(google_cloud_cpp)
+ if(CMAKE_VERSION VERSION_LESS 3.28)
+ set_property(DIRECTORY ${google_cloud_cpp_SOURCE_DIR} PROPERTY EXCLUDE_FROM_ALL TRUE)
+ endif()
+
# Remove unused directories to save build directory storage.
# 141MB -> 79MB
file(REMOVE_RECURSE "${google_cloud_cpp_SOURCE_DIR}/ci") |
|
The problem is that it stills tries to install them and as we are not installing absl those can't be found. If I install abseil the problem is that those are bundled (along with crc32c and google cloud cpp) on the libarrow_bundled libraries. |
|
We need to execute |
|
@github-actions crossbow submit -g r -g cpp |
|
Revision: 08c3294 Submitted crossbow builds: ursacomputing/crossbow @ actions-b3910c6580 |
…NS for google-cloud
|
@github-actions crossbow submit -g r |
|
Revision: eab1602 Submitted crossbow builds: ursacomputing/crossbow @ actions-f854cdd15a |
|
@github-actions crossbow submit -g r -g cpp |
|
Revision: 736f045 Submitted crossbow builds: ursacomputing/crossbow @ actions-551409b403 |
Rationale for this change
As a follow up of requiring a minimum CMake version >= 3.25 we discussed moving our dependencies from ExternalProject to FetchContent. This can simplify our third party dependency management.
What changes are included in this PR?
The general change is moving google-cloud-cpp from
ExternalProjecttoFetchContentand some cleanup to required dependencies that don't require double-installation anymore like Absl and CRC32CAre these changes tested?
Yes, the changes are tested locally and on CI.
Are there any user-facing changes?
No