Repository navigation
build: apply patch on Arrow so it can be used with older versions of CMake - #1029
Conversation
|
@wgtmac I have tested this locally against a Dockerfile with 24.04 and CMake I've opened the following issue to follow up on Arrow: |
There was a problem hiding this comment.
🟡 Changes recommended
Tool validation can reject installed-Arrow builds, and the Git fallback can silently leave vendored Arrow unpatched.
2 open findings
What changed in this PR
Fixes the vendored Arrow configuration failure on older CMake versions described in #1028.
Changes:
- Adds an Arrow patch using
ARROW_SOURCE_DIRfor third-party paths. - Integrates patch application into FetchContent, with a Git fallback.
| File | Description |
|---|---|
| cmake_modules/IcebergThirdpartyToolchain.cmake | Adds patch-tool selection and FetchContent patching. |
| cmake_modules/arrow-thirdparty-dir.patch | Corrects Arrow’s third-party source directory reference. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| else() | ||
| find_program(GIT git) | ||
| if(GIT) | ||
| set(ARROW_PATCH_COMMAND ${GIT} apply) |
There was a problem hiding this comment.
This is basically the same approach we take at Arrow, I don't think it's true, I've applied with both git apply and patch.
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
2 open findings
1 resolved since last review
🧠 Review effort: Lite
| fetchcontent_declare(Arrow | ||
| ${FC_DECLARE_COMMON_OPTIONS} | ||
| URL ${ARROW_SOURCE_URL} | ||
| URL_HASH "SHA256=${ICEBERG_ARROW_BUILD_SHA256_CHECKSUM}" | ||
| SOURCE_SUBDIR | ||
| cpp | ||
| FIND_PACKAGE_ARGS | ||
| CONFIG) | ||
| PATCH_COMMAND ${ARROW_PATCH_COMMAND} SOURCE_SUBDIR cpp | ||
| FIND_PACKAGE_ARGS CONFIG) |
…ns of CMake (#54573) ### Rationale for this change For older versions of CMake the variable `arrow_SOURCE_DIR` is overriden by FetchContent's one because `project(arrow)` sets it as a cache variable while FetchContent sets a normal variable with precedence. Arrow can't find `thirdparty/versions.txt` because it is pointing to the tarball root instead of the cpp subfolder. See policy https://cmake.org/cmake/help/latest/policy/CMP0180.html This has been tested and found at Iceberg-cpp here: - apache/iceberg-cpp#1029 ### What changes are included in this PR? Use `ARROW_SOURCE_DIR` instead of `arrow_SOURCE_DIR` so FetchContent's `arrow_SOURCE_DIR` does not have precedence. ### Are these changes tested? Yes locally on the iceberg PR on Ubuntu 24.04. ### Are there any user-facing changes? No ### Was AI used for this PR? In accordance to the [AI generation guidelines](https://arrow.apache.org/docs/dev/developers/overview.html#ai-generated-code), please disclose below whether and how AI was used in this PR. **PR code and description written by:** - [x] Human - [ ] AI I did use AI to initially find the root cause. **Reviewed before submission by:** - [x] Human - [ ] AI - [ ] Not reviewed * GitHub Issue: #53995 Authored-by: Raúl Cumplido <raulcd@apache.org> Signed-off-by: Sutou Kouhei <kou@clear-code.com>


For older versions of CMake the variable
arrow_SOURCE_DIRis overriden by FetchContent's one becauseproject(arrow)sets it as a cache variable while FetchContent sets a normal variable with precedence. Arrow can't findthirdparty/versions.txtbecause it is pointing to the tarball root instead of thecppsubfolder. See policy https://cmake.org/cmake/help/latest/policy/CMP0180.htmlWe should fix upstream Arrow so it does not rely on
arrow_SOURCE_DIRto allow older CMake builds.Fixes #1028