Skip to content

[C++] Building Arrow via FetchContent can fail with versions older than CMake 3.30 #53995

Closed

Description

@raulcd

Describe the bug, including details regarding any error messages, version, and platform.

As seen on the iceberg-cpp report here:

Building Arrow via FetchContent on iceberg with older CMake fails. This is because:

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.

See the PR I did here with the patch:

Component(s)

C++

Activity

  1. raulcd commented on Oct 16, 2026

    @raulcd
    MemberAuthor

    @kou what do you think about this, the patch I apply there seems to fix the issues:

    --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake
    +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake
    @@ -365,7 +365,7 @@
     # ----------------------------------------------------------------------
     # Thirdparty versions, environment variables, source URLs
    
    -set(THIRDPARTY_DIR "${arrow_SOURCE_DIR}/thirdparty")
    +set(THIRDPARTY_DIR "${ARROW_SOURCE_DIR}/thirdparty")
    
     add_library(arrow::flatbuffers INTERFACE IMPORTED)
     target_include_directories(arrow::flatbuffers
  2. kou commented on Oct 16, 2026

    @kou
    Member

    +1

    Let's apply the change in apache/arrow too.

  3. added a commit that references this issue on Oct 29, 2026
  4. added this to the 27.0.0 milestone on Oct 29, 2026
  5. kou commented on Oct 29, 2026

    @kou
    Member

    Issue resolved by pull request 54573
    #54573

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions