-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
version.json patch command supports required field (#700)
When a patch fails, rapids-cmake will log the failure under $CMAKE_BUILD_DIR/rapids-cmake/<the-dep>/log and continue. Now with this change rapids-cmake will collect all patches with the `required` field set to `true` that fail and throw an error. Fixes [#699](#699) Authors: - Robert Maynard (https://github.com/robertmaynard) Approvers: - Vyas Ramasubramani (https://github.com/vyasr) URL: #700
- Loading branch information
1 parent
fe3362f
commit 27b7b66
Showing
13 changed files
with
514 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
testing/cpm/cpm_find-patch-command-required-fails/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#============================================================================= | ||
# Copyright (c) 2024, NVIDIA CORPORATION. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
#============================================================================= | ||
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(fmt version repository tag shallow exclude) | ||
|
||
set(deps_dir "${CMAKE_CURRENT_BINARY_DIR}/_fmt_dep") | ||
if(NOT EXISTS "${deps_dir}") | ||
file(MAKE_DIRECTORY "${deps_dir}") | ||
find_package(Git) | ||
execute_process( | ||
COMMAND ${GIT_EXECUTABLE} clone --depth 1 --branch "${tag}" "${repository}" | ||
WORKING_DIRECTORY "${deps_dir}") | ||
endif() | ||
|
||
set(fmt_dir "${deps_dir}/fmt") | ||
list(APPEND CMAKE_PREFIX_PATH "${fmt_dir}") | ||
|
||
include(${rapids-cmake-dir}/cpm/init.cmake) | ||
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/fmt.cmake) | ||
rapids_cpm_fmt() | ||
|
||
if(NOT "${fmt_ADDED}") | ||
message(FATAL_ERROR "The found repo was used rather than downloading and patching a new version") | ||
endif() |
20 changes: 20 additions & 0 deletions
20
testing/cpm/cpm_find-patch-command-required-fails/override.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"packages": { | ||
"fmt": { | ||
"patches": [ | ||
{ | ||
"file": "${current_json_dir}/patches/0001-move-git-sha1.patch", | ||
"issue": "Move git sha1", | ||
"fixed_in": "", | ||
"required": false | ||
}, | ||
{ | ||
"file": "${current_json_dir}/patches/0002-bad-git-change.patch", | ||
"issue": "Fail to apply git patch", | ||
"fixed_in": "", | ||
"required": true | ||
} | ||
] | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
testing/cpm/cpm_find-patch-command-required-fails/patches/0001-move-git-sha1.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
From deacd3fafd7fcfee954ae3044ae3ab60d36a9f3a Mon Sep 17 00:00:00 2001 | ||
From: Robert Maynard <[email protected]> | ||
Date: Wed, 31 Jan 2024 15:00:47 -0500 | ||
Subject: [PATCH 1/2] Move GIT SHA1 | ||
|
||
--- | ||
git_file_1.txt | 1 + | ||
1 file changed, 1 insertion(+) | ||
create mode 100644 git_file_1.txt | ||
|
||
diff --git a/git_file_1.txt b/git_file_1.txt | ||
new file mode 100644 | ||
index 00000000..b242c360 | ||
--- /dev/null | ||
+++ b/git_file_1.txt | ||
@@ -0,0 +1 @@ | ||
+added file | ||
-- | ||
2.43.0 |
Oops, something went wrong.