Skip to content

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

Open

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.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions