From 2a2c63dd2b07b34679d57dc59bb1c45ec5080615 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Thu, 22 Aug 2024 10:44:41 -0400 Subject: [PATCH] Reduce cpm tests network usage (#683) Updated some of the cpm tests to not clone `cccl` as it has the largest size, but instead using lighter repos. Also re-evaluated which tests exactly need `NO_CPM_CACHE` to reduce network traffic. Authors: - Robert Maynard (https://github.com/robertmaynard) Approvers: - Bradley Dice (https://github.com/bdice) URL: https://github.com/rapidsai/rapids-cmake/pull/683 --- testing/cpm/CMakeLists.txt | 8 +++--- .../cpm/cpm_find-patch-command/CMakeLists.txt | 26 +++++++++---------- .../cpm/cpm_find-patch-command/override.json | 2 +- .../cpm_generate_pins-nested/b/CMakeLists.txt | 6 ++--- 4 files changed, 20 insertions(+), 22 deletions(-) diff --git a/testing/cpm/CMakeLists.txt b/testing/cpm/CMakeLists.txt index 70379c08..d4345124 100644 --- a/testing/cpm/CMakeLists.txt +++ b/testing/cpm/CMakeLists.txt @@ -28,13 +28,13 @@ add_cmake_config_test( cpm_find-restore-cpm-vars ) add_cmake_config_test( cpm_find-version-explicit-install.cmake ) add_cmake_build_test( cpm_generate_pins-format-patches NO_CPM_CACHE) -add_cmake_build_test( cpm_generate_pins-nested NO_CPM_CACHE) +add_cmake_build_test( cpm_generate_pins-nested ) add_cmake_build_test( cpm_generate_pins-no-src-dir ) add_cmake_build_test( cpm_generate_pins-override NO_CPM_CACHE) add_cmake_build_test( cpm_generate_pins-pure-cpm ) -add_cmake_build_test( cpm_generate_pins-simple NO_CPM_CACHE) -add_cmake_build_test( cpm_generate_pins-simple-via-variable NO_CPM_CACHE) -add_cmake_build_test( cpm_generate_pins-var-and-arg NO_CPM_CACHE) +add_cmake_build_test( cpm_generate_pins-simple ) +add_cmake_build_test( cpm_generate_pins-simple-via-variable ) +add_cmake_build_test( cpm_generate_pins-var-and-arg ) add_cmake_config_test( cpm_init-bad-default-path.cmake SHOULD_FAIL "rapids_cpm_init can't load") add_cmake_config_test( cpm_init-bad-default-cmake-var.cmake SHOULD_FAIL "rapids_cpm_init can't load") diff --git a/testing/cpm/cpm_find-patch-command/CMakeLists.txt b/testing/cpm/cpm_find-patch-command/CMakeLists.txt index 041641a4..da809d29 100644 --- a/testing/cpm/cpm_find-patch-command/CMakeLists.txt +++ b/testing/cpm/cpm_find-patch-command/CMakeLists.txt @@ -17,9 +17,9 @@ cmake_minimum_required(VERSION 3.26.4) project(rapids-cpm_find-patch-command-project LANGUAGES CXX) include("${rapids-cmake-dir}/cpm/detail/package_details.cmake") -rapids_cpm_package_details(CCCL version repository tag shallow exclude) +rapids_cpm_package_details(fmt version repository tag shallow exclude) -set(deps_dir "${CMAKE_CURRENT_BINARY_DIR}/_cccl_dep") +set(deps_dir "${CMAKE_CURRENT_BINARY_DIR}/_fmt_dep") if(NOT EXISTS "${deps_dir}") file(MAKE_DIRECTORY "${deps_dir}") find_package(Git) @@ -28,8 +28,8 @@ if(NOT EXISTS "${deps_dir}") WORKING_DIRECTORY "${deps_dir}") endif() -set(cccl_dir "${deps_dir}/cccl") -list(APPEND CMAKE_PREFIX_PATH "${cccl_dir}") +set(fmt_dir "${deps_dir}/fmt") +list(APPEND CMAKE_PREFIX_PATH "${fmt_dir}") include(${rapids-cmake-dir}/cpm/init.cmake) rapids_cpm_init() @@ -37,28 +37,28 @@ rapids_cpm_init() include(${rapids-cmake-dir}/cpm/package_override.cmake) rapids_cpm_package_override(${CMAKE_CURRENT_SOURCE_DIR}/override.json) -include(${rapids-cmake-dir}/cpm/cccl.cmake) -rapids_cpm_cccl() +include(${rapids-cmake-dir}/cpm/fmt.cmake) +rapids_cpm_fmt() -if(NOT "${CCCL_ADDED}") +if(NOT "${fmt_ADDED}") message(FATAL_ERROR "The found repo was used rather than downloading and patching a new version") endif() # Verify that the two files that we inserted into the CCCL source tree exist # Which proves the patches in the override are properly applied -if(NOT EXISTS "${CCCL_SOURCE_DIR}/git_file_1.txt") - message(FATAL_ERROR "failed to apply CCCL first patch") +if(NOT EXISTS "${fmt_SOURCE_DIR}/git_file_1.txt") + message(FATAL_ERROR "failed to apply fmt first patch") endif() -if(NOT EXISTS "${CCCL_SOURCE_DIR}/git_file_2.txt") - message(FATAL_ERROR "failed to apply CCCL second patch") +if(NOT EXISTS "${fmt_SOURCE_DIR}/git_file_2.txt") + message(FATAL_ERROR "failed to apply fmt second patch") endif() execute_process( COMMAND ${GIT_EXECUTABLE} diff --quiet ${tag} RESULT_VARIABLE REPO_IS_PATCHED - WORKING_DIRECTORY "${CCCL_SOURCE_DIR}") + WORKING_DIRECTORY "${fmt_SOURCE_DIR}") if(NOT ${REPO_IS_PATCHED}) - message(FATAL_ERROR "The repo was downloaded to ${CCCL_SOURCE_DIR} but not patched.") + message(FATAL_ERROR "The repo was downloaded to ${fmt_SOURCE_DIR} but not patched.") endif() diff --git a/testing/cpm/cpm_find-patch-command/override.json b/testing/cpm/cpm_find-patch-command/override.json index fa73f144..8fc259d8 100644 --- a/testing/cpm/cpm_find-patch-command/override.json +++ b/testing/cpm/cpm_find-patch-command/override.json @@ -1,6 +1,6 @@ { "packages": { - "CCCL": { + "fmt": { "patches": [ { "file": "${current_json_dir}/patches/0001-move-git-sha1.patch", diff --git a/testing/cpm/cpm_generate_pins-nested/b/CMakeLists.txt b/testing/cpm/cpm_generate_pins-nested/b/CMakeLists.txt index 55a7c798..e63f4630 100644 --- a/testing/cpm/cpm_generate_pins-nested/b/CMakeLists.txt +++ b/testing/cpm/cpm_generate_pins-nested/b/CMakeLists.txt @@ -19,10 +19,8 @@ project(rapids-test-b LANGUAGES CXX) include(${rapids-cmake-dir}/cpm/init.cmake) rapids_cpm_init() -include(${rapids-cmake-dir}/cpm/cccl.cmake) include(${rapids-cmake-dir}/cpm/cuco.cmake) include(${rapids-cmake-dir}/cpm/nvcomp.cmake) -rapids_cpm_cccl() -rapids_cpm_cuco() -rapids_cpm_nvcomp() +rapids_cpm_cuco(DOWNLOAD_ONLY ON) +rapids_cpm_nvcomp(DOWNLOAD_ONLY ON)