Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nanoarrow uses package override for proper pinned versions generation #15515

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 6 additions & 30 deletions cpp/cmake/thirdparty/get_nanoarrow.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,44 +14,20 @@

# This function finds nanoarrow and sets any additional necessary environment variables.
function(find_and_configure_nanoarrow)
set(oneValueArgs VERSION FORK PINNED_TAG)
cmake_parse_arguments(PKG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
include(${rapids-cmake-dir}/cpm/package_override.cmake)

# Only run if PKG_VERSION is < 0.5.0
if(PKG_VERSION VERSION_LESS 0.5.0)
set(patch_files_to_run "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/patches/nanoarrow_cmake.diff")
set(patch_issues_to_ref
"Fix issues with nanoarrow CMake [https://github.com/apache/arrow-nanoarrow/pull/406]"
)
set(patch_script "${CMAKE_BINARY_DIR}/rapids-cmake/patches/nanoarrow/patch.cmake")
set(log_file "${CMAKE_BINARY_DIR}/rapids-cmake/patches/nanoarrow/log")
string(TIMESTAMP current_year "%Y" UTC)
configure_file(
${rapids-cmake-dir}/cpm/patches/command_template.cmake.in "${patch_script}" @ONLY
)
else()
message(
FATAL_ERROR
"Nanoarrow version ${PKG_VERSION} already contains the necessary patch. Please remove this patch from cudf."
)
endif()
set(cudf_patch_dir "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/patches")
rapids_cpm_package_override("${cudf_patch_dir}/nanoarrow_override.json")

# The git_repo and git_tag are provided by the nanoarrow_override file
rapids_cpm_find(
nanoarrow ${PKG_VERSION}
nanoarrow 0.4.0
GLOBAL_TARGETS nanoarrow
CPM_ARGS
GIT_REPOSITORY https://github.com/${PKG_FORK}/arrow-nanoarrow.git
GIT_TAG ${PKG_PINNED_TAG}
# TODO: Commit hashes are not supported with shallow clones. Can switch this if and when we pin
# to an actual tag.
GIT_SHALLOW FALSE
PATCH_COMMAND ${CMAKE_COMMAND} -P ${patch_script}
OPTIONS "BUILD_SHARED_LIBS OFF" "NANOARROW_NAMESPACE cudf"
)
set_target_properties(nanoarrow PROPERTIES POSITION_INDEPENDENT_CODE ON)
rapids_export_find_package_root(BUILD nanoarrow "${nanoarrow_BINARY_DIR}" EXPORT_SET cudf-exports)
endfunction()

find_and_configure_nanoarrow(
VERSION 0.4.0 FORK apache PINNED_TAG c97720003ff863b81805bcdb9f7c91306ab6b6a8
)
find_and_configure_nanoarrow()
18 changes: 18 additions & 0 deletions cpp/cmake/thirdparty/patches/nanoarrow_override.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

{
"packages" : {
"nanoarrow" : {
"version" : "0.4.0",
"git_url" : "https://github.com/apache/arrow-nanoarrow.git",
"git_tag" : "c97720003ff863b81805bcdb9f7c91306ab6b6a8",
"git_shallow" : false,
"patches" : [
{
"file" : "${current_json_dir}/nanoarrow_cmake.diff",
"issue" : "Fix add support for global setup to initialize RMM in nvbench [https://github.com/NVIDIA/nvbench/pull/123]",
"fixed_in" : "0.5.0"
}
]
}
}
}
Loading