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

Conditionally modify envvar vs. global CMAKE_PREFIX_PATH in rapids_cmake_support_conda_env #439

Conversation

trxcllnt
Copy link
Contributor

Description

This PR updates the logic when rapids_cmake_support_conda_env() is called with MODIFY_PREFIX_PATH.

The current logic prepends the $PREFIX/$BUILD_PREFIX/$CONDA_PREFIX paths to the global CMAKE_PREFIX_PATH variable.

This PR proposes the following changes:

  1. Append instead of prepend the $PREFIX/$BUILD_PREFIX/$CONDA_PREFIX paths
  2. Prefer modifying the CMAKE_PREFIX_PATH environment variable instead of the global CMAKE_PREFIX_PATH variable
  3. Only modify the global CMAKE_PREFIX_PATH variable if it's already populated (preserving paths in ENV{CMAKE_PREFIX_PATH})

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.
  • The cmake-format.json is up to date with these changes.
  • I have added new files under rapids-cmake/
    • I have added include guards (include_guard(GLOBAL))
    • I have added the associated docs/ rst file and update the api.rst

@trxcllnt trxcllnt requested a review from a team as a code owner July 20, 2023 02:37
@trxcllnt trxcllnt added improvement Improves an existing functionality non-breaking Introduces a non-breaking change 3 - Ready for Review Ready for review by team labels Jul 20, 2023
rapids-cmake/cmake/support_conda_env.cmake Outdated Show resolved Hide resolved
rapids-cmake/cmake/support_conda_env.cmake Outdated Show resolved Hide resolved
@robertmaynard robertmaynard self-requested a review July 20, 2023 18:43
Copy link
Contributor

@robertmaynard robertmaynard left a comment

Choose a reason for hiding this comment

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

We should prefer usingDEFINED since it makes it clearer.

If some user some how defines CMAKE_PREFIX_PATH to a empty string, they win an award :)

rapids-cmake/cmake/support_conda_env.cmake Outdated Show resolved Hide resolved
rapids-cmake/cmake/support_conda_env.cmake Outdated Show resolved Hide resolved
@trxcllnt
Copy link
Contributor Author

/merge

@rapids-bot rapids-bot bot merged commit 51161da into rapidsai:branch-23.08 Jul 20, 2023
@trxcllnt trxcllnt deleted the fix/support_conda_env-modify-cmake_prefix_path-envvar branch July 21, 2023 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review Ready for review by team improvement Improves an existing functionality non-breaking Introduces a non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants