-
Notifications
You must be signed in to change notification settings - Fork 3.9k
GH-48315: [C++] Use FetchContent for bundled CRC32C #48318
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
Conversation
|
@github-actions crossbow submit -g cpp |
|
Revision: e4ed6a0 Submitted crossbow builds: ursacomputing/crossbow @ actions-7215a8e6f9 |
|
@github-actions crossbow submit -g r |
|
Revision: e4ed6a0 Submitted crossbow builds: ursacomputing/crossbow @ actions-e9c7382c41 |
|
I have continued working on this but I am unsure we can make Abseil at that point is only configured and it tries to load the targets file due to the following on but the @kou do you have ideas for that? I'd love to get rid of all the manual target definitions for abseil but I am unsure what can we do without patching google-cloud-cpp or keeping it as |
|
If I apply a patch like on --- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -210,7 +210,11 @@ add_custom_target(google-cloud-cpp-protos)
add_custom_target(doxygen-docs)
add_custom_target(all-docfx)
-find_package(absl CONFIG REQUIRED)
+# Allow using absl from FetchContent (targets already exist)
+if(NOT TARGET absl::base)
+ find_package(absl CONFIG REQUIRED)
+endif()
+
if (GOOGLE_CLOUD_CPP_ENABLE_GRPC)
find_package(gRPC REQUIRED QUIET)
# `Protobuf_PROTOC_EXECUTABLE` is pretty standard. It has been in use by
--- a/cmake/IncludeNlohmannJson.cmake
+++ b/cmake/IncludeNlohmannJson.cmake
@@ -15,6 +15,11 @@
# ~~~
function (find_nlohmann_json)
+ # Allow using nlohmann_json from FetchContent (target already exists)
+ if(TARGET nlohmann_json::nlohmann_json)
+ return()
+ endif()
+
find_package(nlohmann_json CONFIG QUIET)
if (nlohmann_json_FOUND)
return()Is not strictly for this PR but wanted to share the full picture as the current PR is basicaly pre-work for the |
|
Could you try |
Thanks a lot @kou, that works as expected locally! that was much easier and better than my patch approach :) One day I'll finally learn these various CMake options. I've learnt a lot the last couple of years, I had never touched a line of CMake prior to working on Arrow, but things like this show me there's still a lot to learn. |
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
|
Could you push a change you tried? (I think that uses |
It does not seem necessary for Crc32c, at least locally, it is for Abseil and nlohmann-json. I have pushed a separate draft PR with all the google-cloud-cpp changes to exercise CI and to show you but I prefer this incremental approach so I can tackle problems individually. and the specific commit where |
|
Sorry, after some more testing on the mentioned PR it seems it is necessary for some scenarios. I am still fixing a couple of issues on the other PR. I'll add the |
kou
left a comment
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.
+1
Ah, sorry. I misunderstood.
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 CRC32C from
ExternalProjecttoFetchContent.We will be able to clean up installation once google-cloud-cpp is also migated.
Are these changes tested?
Yes, the changes are tested locally and on CI.
Are there any user-facing changes?
No