-
Notifications
You must be signed in to change notification settings - Fork 283
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
WIP: Implementation of cmake policy error for python #3055
Conversation
This implementation is in progress |
@MartinsNadia Do let us know if you need any help with this (preferable via Slack)! |
Implementation of CMake policy for python
# Use CMP0094 policy for python resolution. This is only available for CMake versions newer than 3.15 included | ||
cmake_version = get_software_version('CMake') | ||
if LooseVersion(cmake_version) >= LooseVersion('3.15'): | ||
add_cmake_opts['MAKE_POLICY_DEFAULT_CMP0094'] = 'NEW' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add_cmake_opts['MAKE_POLICY_DEFAULT_CMP0094'] = 'NEW' | |
add_cmake_opts['CMAKE_POLICY_DEFAULT_CMP0094'] = 'NEW' |
https://cmake.org/cmake/help/latest/variable/CMAKE_POLICY_DEFAULT_CMPNNNN.html
@@ -99,6 +100,10 @@ def configure_step(self): | |||
add_cmake_opts = {} | |||
if self.cfg['use_openssl']: | |||
add_cmake_opts['CMAKE_USE_OPENSSL'] = 'ON' | |||
# Use CMP0094 policy for python resolution. This is only available for CMake versions newer than 3.15 included | |||
cmake_version = get_software_version('CMake') | |||
if LooseVersion(cmake_version) >= LooseVersion('3.15'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find this more readable:
if LooseVersion(cmake_version) >= LooseVersion('3.15'): | |
if LooseVersion(cmake_version) >= '3.15': |
But just a suggestion
I was trying to test if this resolved the issue we originally saw in EESSI/software-layer#370 (comment) . For that particular build, it was solved by by specifying the Python executable explicitly through the configopts (see https://github.com/easybuilders/easybuild-easyconfigs/pull/19119/files#diff-dab20f8b8f1b541c80b11cd4ba163c8d9d8300c50c8d74e6ddd8b2d2eac1f098 ). I commented this line to undo that fix and was indeed able to reproduce the original. Then, I tried to use this easyblock: I downloaded it, made the typo-change suggested by @Flamefire and tested. Unfortunately, it still failed. After digging in further, I saw the configure line was NOT setting the policy, and I suddenly realized why: the wrong EasyBlock is being changed here. This EasyBlock is for building In that EasyBlock, I added:
to the
i.e. it is picking up the correct Python version. Of course, we should make that policy setting conditional on the cmake version used; we can use the In summary, I think we should close this PR and reimplement this fix in |
Well, since I already had a working |
Thank you @casparvl !!! |
No worries, it took me a while to realize what was going on, it's an easy mistake to make and easy difference to overlook :) Hope I didn't steal your mojo by creating the other PR - After trying to figure out why yours wasn't working, I already had a working EasyBlock for |
Implementation of cmake policy error for python: https://gitlab.com/eessi/support/-/issues/17