Skip to content

[BUG] Java JNI build fails with CMake 4.0.7 due to Arrow/RapidJSON cmake_minimum_required compatibility #22540

Closed

Description

@pxLi

Describe the bug

After #22492 moved cuDF to require CMake 4, the cuDF Java JNI native build started failing on release/26.06 and main.

The failure appears to be caused by a third-party CMake compatibility issue in Arrow's RapidJSON dependency when running with CMake 4.0.7. Arrow calls find_package(RapidJSON), which loads RapidJSONConfig.cmake containing an old cmake_minimum_required policy version that CMake 4 no longer accepts.

Steps/Code to reproduce bug
Run the cuDF Java JNI native build on main after #22492 with CMake 4.0.7.

The build reaches Arrow 21.0.0 dependency configuration and fails while resolving RapidJSON:

-- Building using CMake version: 4.0.7
-- Arrow version: 21.0.0 (full: '21.0.0')
-- ARROW_RAPIDJSON_BUILD_VERSION: 232389d4f1012dddec4ef84861face2d2ba85709
...
CMake Error at .../RapidJSONConfig.cmake:3 (cmake_minimum_required):
  Compatibility with CMake < 3.5 has been removed from CMake.

  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.

  Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.
Call Stack (most recent call first):
  .../_deps/arrow-src/cpp/cmake_modules/FindRapidJSONAlt.cmake:29 (find_package)
  .../_deps/arrow-src/cpp/cmake_modules/ThirdpartyToolchain.cmake:291 (find_package)
  .../_deps/arrow-src/cpp/cmake_modules/ThirdpartyToolchain.cmake:2505 (resolve_dependency)
  .../_deps/arrow-src/cpp/CMakeLists.txt:511 (include)

Environment overview

  • Environment location: Docker / Jenkins CI
  • Method of cuDF install: from source
    • If method of install is [Docker], provide docker pull & docker run commands used: TODO

Known build context from the failing log:

cuDF branch: main
CMake: 4.0.7
Arrow: 21.0.0
RapidJSON version from Arrow config: 232389d4f1012dddec4ef84861face2d2ba85709
Build path: cuDF Java JNI native build

Additional context

This started after #22492, which updated cuDF to require CMake 4.

Activity

  1. added
    bug
    on May 18, 2026
  2. pxLi commented on May 18, 2026

    @pxLi
    MemberAuthor

    cc @mythrocks can you help check this one? thanks

  3. davidwendt commented on May 18, 2026

    @davidwendt
    Contributor
  4. KyleFromNVIDIA commented on May 18, 2026

    @KyleFromNVIDIA
    Member

    Where are the failed JNI builds? I don't see them at all in GitHub Actions.

    the cuDF Java JNI native build started failing on release/26.06

    This is very surprising to me. My branch didn't target release/26.06, only main. I don't see how it could be affecting release.

  5. pmattione-nvidia commented on May 18, 2026

    @pmattione-nvidia
    Contributor

    Sent a link to a failed build in a private chat

  6. mythrocks commented on May 18, 2026

    @mythrocks
    Contributor

    I realize that @KyleFromNVIDIA is working on this. I have not been able to repro this failure locally, with spark-rapids-jni/main and cudf/main. I wonder if @KyleFromNVIDIA has had better luck.

  7. KyleFromNVIDIA commented on May 18, 2026

    @KyleFromNVIDIA
    Member

    Can confirm that I have reproduced it locally - the key is to run java/ci/build-in-docker.sh with a true argument. Investigating root cause now.

  8. KyleFromNVIDIA commented on May 18, 2026

    @KyleFromNVIDIA
    Member

    Arrow is using an old pre-release version of RapidJSON that contains a long-since merged PR that they need. However, that pinned version is from a couple years ago. The latest commit includes the PR that they need, along with a fix to their generated CMake config file that would fix this issue.

    I would recommend adding a local patch to Arrow that updates RapidJSON to the latest ToT. We should also upstream that change to Arrow.

  9. KyleFromNVIDIA commented on May 19, 2026

    @KyleFromNVIDIA
    Member

    The release/26.06 failure is happening because Jenkins CI is using the image built from main, which includes CMake 4.0.7, to build release/26.06.

  10. KyleFromNVIDIA commented on May 19, 2026

    @KyleFromNVIDIA
    Member

    I've opened #22582 to fix this.

  11. KyleFromNVIDIA commented on May 19, 2026

    @KyleFromNVIDIA
    Member

    As a side note, whatever CI process you're doing in Jenkins should probably be a job in cudf CI too, so that we can catch things like this more quickly.

  12. davidwendt commented on May 19, 2026

    @davidwendt
    Contributor

    As a side note, whatever CI process you're doing in Jenkins should probably be a job in cudf CI too, so that we can catch things like this more quickly.

    I disagree with this. I feel the current process caught it in a timely manner. I don't want to add more jobs to cudf's already fragile CI.

  13. kou commented on May 20, 2026

    @kou

    @pxLi Could you share the content of RapidJSONConfig.cmake you used? I'm reviewing the upstream patch: apache/arrow#49993

    FYI: My RapidJSONConfig.cmake installed by (rapidjson-dev https://packages.debian.org/sid/rapidjson-dev ) doesn't have cmake_minimum_required():

    get_filename_component(RAPIDJSON_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
    set(RAPIDJSON_INCLUDE_DIRS "/usr/include")
    message(STATUS "RapidJSON found. Headers: ${RAPIDJSON_INCLUDE_DIRS}")
  14. KyleFromNVIDIA commented on May 20, 2026

    @KyleFromNVIDIA
    Member

    Here is the config file generated by the RapidJSON pin that Arrow is using (232389d4f1012dddec4ef84861face2d2ba85709):

    ################################################################################
    # CMake minimum version required
    cmake_minimum_required(VERSION 3.0)
    
    ################################################################################
    # RapidJSON source dir
    set( RapidJSON_SOURCE_DIR "/home/kyedwards/development/arrow/build/src/rapidjson_ep")
    
    ################################################################################
    # RapidJSON build dir
    set( RapidJSON_DIR "/home/kyedwards/development/arrow/build/src/rapidjson_ep-build")
    
    ################################################################################
    # Compute paths
    get_filename_component(RapidJSON_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
    
    set( RapidJSON_INCLUDE_DIR  "${RapidJSON_SOURCE_DIR}/include" )
    set( RapidJSON_INCLUDE_DIRS  "${RapidJSON_SOURCE_DIR}/include" )
    message(STATUS "RapidJSON found. Headers: ${RapidJSON_INCLUDE_DIRS}")
    
    if(NOT TARGET rapidjson)
      add_library(rapidjson INTERFACE IMPORTED)
      set_property(TARGET rapidjson PROPERTY
        INTERFACE_INCLUDE_DIRECTORIES ${RapidJSON_INCLUDE_DIRS})
    endif()

    Notice the cmake_minimum_required() on line 3.

  15. KyleFromNVIDIA commented on May 20, 2026

    @KyleFromNVIDIA
    Member

    See my explanation of the bug at apache/arrow#48801 (comment).

  16. kou commented on May 21, 2026

    @kou

    Thanks.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions