Support tarball-mode packages in patch application#1011
Merged
rapids-bot[bot] merged 3 commits intorapidsai:mainfrom May 5, 2026
Merged
Support tarball-mode packages in patch application#1011rapids-bot[bot] merged 3 commits intorapidsai:mainfrom
rapids-bot[bot] merged 3 commits intorapidsai:mainfrom
Conversation
4 tasks
Contributor
Author
|
Testing jointly with #1005 downstream in cuDF: rapidsai/cudf#22313 |
robertmaynard
requested changes
Apr 28, 2026
Add a new patch application path that uses 'patch -p1' to work on tarball-extracted directories, which have no .git repository and so cannot use 'git apply' or 'git am'. The existing git-mode path is retained unchanged for packages fetched as git clones. The fetch mode is detected from versions.json (git_url/git_tag vs url/url_hash) and the patch script dispatches accordingly. Fix pinning_write_file.cmake to respect mode switching when an override provides git fields for a package whose default is URL-mode. Previously, the fallback to default JSON could incorrectly detect URL-mode even when the override explicitly switched to git-mode. Update verify_generated_pins to handle URL-mode packages in pin verification, checking url/url_hash fields instead of git_tag/git_shallow. Update cpm_package_override-multiple tests to provide git_url alongside git_tag in overrides, so that partial git overrides remain valid regardless of whether the default entry is git- or url-mode. Split the existing patch-command tests into explicit -git and -tarball variants for each scenario (regular, embedded, required, required-fails) and add -diff-git/-diff-tarball pairs so both .patch and .diff files are exercised in both modes. Each test specifies its fetch mode explicitly in override.json (git_url/git_tag for -git tests, url/url_hash for -tarball tests) rather than relying on the default, so the tests remain correct regardless of how versions.json evolves. The override is applied before rapids_cpm_package_details_internal so the explicitly declared mode is used for the test's pre-populate step.
efaec10 to
ee9ec5e
Compare
robertmaynard
approved these changes
May 5, 2026
Contributor
Author
|
/merge |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add a new patch application path that uses
patch -p1, so CPM packages fetched as tarballs can have patches applied to them. Tarball-extracted directories have no.gitrepository and so cannot usegit applyorgit am. The existing git-mode path is retained unchanged for packages fetched as git clones. The fetch mode is detected fromversions.json(git_url/git_tagvsurl/url_hash) and the patch script dispatches accordingly.Also includes a few adjacent fixes uncovered while adding the above:
pinning_write_file.cmaketo respect mode switching when an override provides git fields for a package whose default is URL-mode. Previously the fallback to default JSON could incorrectly detect URL-mode even when the override explicitly switched to git-mode.verify_generated_pinsto handle URL-mode packages in pin verification, checkingurl/url_hashfields instead ofgit_tag/git_shallow.cpm_package_override-multipletests to providegit_urlalongsidegit_tagin overrides so that partial git overrides remain valid regardless of whether the default entry is git- or url-mode.Test coverage
Splits the existing patch-command tests into explicit
-gitand-tarballvariants for each scenario (regular, embedded, required, required-fails) and adds-diff-git/-diff-tarballpairs so both.patchand.difffiles are exercised in both modes. Each test specifies its fetch mode explicitly inoverride.json(git_url/git_tagfor-gittests,url/url_hashfor-tarballtests) rather than relying on the default, so the tests remain correct regardless of howversions.jsonevolves. The override is applied beforerapids_cpm_package_details_internalso the explicitly declared mode is used for the test's pre-populate step.Coverage matrix:
This PR is a prerequisite for #1005 (converting
versions.jsonentries to tarballs), since several of the packages being converted have patches applied via overrides in downstream RAPIDS projects.Checklist
cmake-format.jsonis up to date with these changes.