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

rapids_cpm_package_override: Always load overrides #778

Open
wants to merge 5 commits into
base: branch-25.04
Choose a base branch
from

Conversation

robertmaynard
Copy link
Contributor

Description

rapids-cmake will now always load override entries from disk and populate the internal json state. In the case of CPM_<pkg>_SOURCE this information will still be ignored. This gives advanced users a consistent behavior when calling rapids_cpm_package_details

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@robertmaynard robertmaynard added feature request New feature or request non-breaking Introduces a non-breaking change labels Feb 13, 2025
@robertmaynard robertmaynard requested a review from a team as a code owner February 13, 2025 15:40
@robertmaynard
Copy link
Contributor Author

@Jacobfaib

Copy link
Contributor

@vyasr vyasr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK I think this makes sense. At first I was concerned that the override would bypass the env var but if we're only doing this for accessing the package metadata then I think it makes sense.

if(DEFINED CPM_${package_name}_SOURCE)
set_property(GLOBAL PROPERTY rapids_cpm_${normalized_pkg_name}_override_ignored "ON")
continue()
else()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nit: no need for else() due to continue()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want the rapids_cpm_${normalized_pkg_name}_override_ignored to exist after any parsing has occured.
This gives us a ternary to determine that parsing has occured plus the outcome.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No I mean that

if(cond)
  continue()
else()
  foo()
endif()

is identical to

if(cond)
  continue()
endif()
foo()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request non-breaking Introduces a non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants