Skip to content

[BUG] rapids_cpm_find(... DOWNLOAD_ONLY ON) writes an empty find_package redirect #1113

Open

Description

@bdice

Describe the bug
Since #1089, rapids_cpm_find translates DOWNLOAD_ONLY into SOURCE_SUBDIR .rapids-cmake-download-only/<name>. CPM only skips writing its find_package redirect when DOWNLOAD_ONLY is set, so every download-only package now gets an empty <name>-config.cmake stub in CMAKE_FIND_PACKAGE_REDIRECTS_DIR. Every later find_package(<name>) in the build reports the package as found but defines no targets, including calls made by other projects' package configs.

This breaks Velox with cuDF enabled: cuDF fetches xxhash with DOWNLOAD_ONLY, and FBThrift's config later calls find_package(Xxhash MODULE) expecting its own FindXxhash.cmake to create Xxhash::xxhash. The stub answers instead and generation fails (facebookincubator/velox#19909). The same applies to cuDF's dlpack, and rapids_cpm_bs_thread_pool (which passes the placeholder SOURCE_SUBDIR directly) also writes a bs_thread_pool stub.

Steps/Code to reproduce bug

include(${rapids-cmake-dir}/cpm/init.cmake)
include(${rapids-cmake-dir}/cpm/find.cmake)
rapids_cpm_init()

set(CPM_DOWNLOAD_dlpack ON)
rapids_cpm_find(dlpack 1.3
                CPM_ARGS
                GIT_REPOSITORY https://github.com/dmlc/dlpack.git
                GIT_TAG v1.3
                DOWNLOAD_ONLY ON)

# Exists on 26.10+, absent before #1089
message(STATUS "${CMAKE_FIND_PACKAGE_REDIRECTS_DIR}/dlpack-config.cmake")

Expected behavior
DOWNLOAD_ONLY packages don't register a find_package redirect, as before #1089. A later find_package(<name> MODULE) should still reach the caller's own Find<name>.cmake.

Environment details (please complete the following information):

  • rapids-cmake 26.10 and main
  • CMake 4.x

Additional context
xref NVIDIA/cudf#25124, which works around this for xxhash only. rapids_cpm_cccl already suppresses the redirect the same way (#997).

Activity

  1. added
    bugSomething isn't working
    on Nov 6, 2026
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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions