rapids_cpm_generate_pinned_versions
Added in version v24.04.00.
Generate a json file with all dependencies with pinned version values
rapids_cpm_generate_pinned_versions( OUTPUT <json_verions_output_path> )
Generates a json file with all CPM dependencies with pinned version values. This allows for subsequent reproducible builds using the exact same state.
The rapids-cmake default versions.json uses branch names or git tag names
for dependencies. This is done so that projects can ‘live at head’ of dependencies.
By using rapids_cpm_package_override()
a project can specify a custom
versions.json that specifies exact git SHA’s so that projects have reproducible builds.
rapids_cpm_generate_pinned_versions()
can be used to transform a set of
rapids-cmake dependencies from branch names to pinned values. This can be used in subsequent
builds, e.g:
Have CI run with versions.json which tracks dependency by branch name
Store the generated pinned versions.json from the CI builds
If build is good, create the release branch and commit the generated pinned versions.json to have reproducible builds for that release
OUTPUT
Specify a file path where the pinned versions information will be written. Can be called multiple
times and each unique path will be written to.
The generated json file will have the following entries for each package:
{
"version": "<CPM_PACKAGE_<package_name>_VERSION>",
"git_url": "<deduced>",
"git_tag": "<deduced>",
"git_shallow": false,
"always_download": true
}
If the original package (or override) also had any patches, or proprietary_binary fields those will be propagated to the generated entry.
Note
The git SHA1 computed for each package is found by finding the most recent commit that can be cloned from the url.
This means that for proper reproducible builds, all patches must be encapsulated in the input json files or as CPM PATCH_COMMAND.