Skip to content

build: apply patch on Arrow so it can be used with older versions of CMake - #1029

Open
raulcd wants to merge 2 commits into
apache:mainfrom
raulcd:GH-1028
Open

raulcd wants to merge 2 commits into
apache:mainfrom
raulcd:GH-1028

Conversation

@raulcd

@raulcd raulcd commented Oct 16, 2026

Copy link
Copy Markdown
Member

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

We should fix upstream Arrow so it does not rely on arrow_SOURCE_DIR to allow older CMake builds.

Fixes #1028

@raulcd

raulcd commented Oct 16, 2026

Copy link
Copy Markdown
Member Author

@wgtmac I have tested this locally against a Dockerfile with 24.04 and CMake 3.28.3. As we seem to require cmake_minimum_required(VERSION 3.25) we might want to add a test for a lower CMake version?

I've opened the following issue to follow up on Arrow:

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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_DIR for 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)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread cmake_modules/IcebergThirdpartyToolchain.cmake Outdated
Copilot AI balanced review requested due to automatic review settings October 16, 2026 17:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment on lines 257 to +262
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)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

build: regression after #1021 — Arrow's arrow_SOURCE_DIR collides with FetchContent on CMake 3.28, breaks vendored Arrow build

2 participants