Skip to content

GH-53995: [C++] Fix building Arrow via FetchContent with older versions of CMake - #54573

Open
raulcd wants to merge 1 commit into
apache:mainfrom
raulcd:GH-53995
Open

raulcd wants to merge 1 commit into
apache:mainfrom
raulcd:GH-53995

Conversation

@raulcd

@raulcd raulcd commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

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:

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, please disclose below whether and how AI was used in this PR.

PR code and description written by:

  • Human
  • AI

I did use AI to initially find the root cause.

Reviewed before submission by:

  • Human
  • AI
  • Not reviewed

Copilot AI balanced review requested due to automatic review settings October 19, 2026 08:23
@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #53995 has been automatically assigned in GitHub to PR creator.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The narrowly scoped replacement uses an initialized source-directory variable and resolves the reported collision without identified regressions.

No open issues 🎉

What changed in this PR

Fixes Arrow C++ builds using FetchContent with older CMake versions by avoiding a source-directory variable collision.

Changes:

  • Uses ARROW_SOURCE_DIR to locate third-party files under the C++ source directory.
File Description
cpp/​cmake_modules/​ThirdpartyToolchain.cmake Replaces the FetchContent-shadowed source-directory variable.

Review effort: Balanced

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants