Skip to content

change buildenv easyblock: use python3 as default path to Python executable in RPATH wrapper scripts#3910

Merged
boegel merged 3 commits intoeasybuilders:developfrom
smoors:20250829164044_new_pr_buildenv
Sep 23, 2025
Merged

change buildenv easyblock: use python3 as default path to Python executable in RPATH wrapper scripts#3910
boegel merged 3 commits intoeasybuilders:developfrom
smoors:20250829164044_new_pr_buildenv

Conversation

@smoors
Copy link
Copy Markdown
Contributor

@smoors smoors commented Aug 29, 2025

Comment thread easybuild/easyblocks/generic/buildenv.py Outdated
@boegel
Copy link
Copy Markdown
Member

boegel commented Sep 3, 2025

@ocaisa Looks OK to me, but I would like to hear some thoughts on this from you...

@boegel boegel added this to the next release (5.1.2) milestone Sep 3, 2025
wrapper_files = list(filter(os.path.isfile, glob.glob(os.path.join(rpath_wrappers_path, '*', '*'))))
# replace path to Python executable with python3 in the wrappers,
# as this is the executable that runs EasyBuild and may be unavailable when using the buildenv wrappers.
apply_regex_substitutions(wrapper_files, [(r'^PYTHON_EXE=.*$', 'PYTHON_EXE=python3')], backup=False)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorry to be a pain here, but python3 is also not guaranteed to exist. Can we add an easyblock extra_options to decide when to do this? A None value would mean don't do it, a True value would mean use the default python3, a string value would mean use a specific value (which may for example include a full path). This would give people the power (via hooks) to decide what is best for them.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

sure, i can add that. what cases do you have in mind where python3 does not exist?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done in c59ba15
(it doesn't support True as an option as i think it's unnecessary and confusing)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

sure, i can add that. what cases do you have in mind where python3 does not exist?

I have to exercise my imagination to think of one...but if you build in a container and have a totally minimal runtime OS it would be possible, a fix in that scenario would just be to point it to one of the Python in the EasyBuild stack.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

(it doesn't support True as an option as i think it's unnecessary and confusing)

Have to agree with you there, say hello to the behaviour of runtest (but of course only when using the CMakeMake easyblock)

@smoors
Copy link
Copy Markdown
Contributor Author

smoors commented Sep 8, 2025

Test report by @smoors

Overview of tested easyconfigs (in order)

  • SUCCESS buildenv-default-foss-2024a.eb

Build succeeded for 1 out of 1 (1 easyconfigs in total)
node701.hydra.os - Linux Rocky Linux 9.5, x86_64, AMD EPYC 9535 64-Core Processor (zen5), Python 3.9.21
See https://gist.github.com/smoors/196938219c45c10a6621540b35e472d7 for a full test report.

@boegel boegel changed the title replace path to python executable with python3 in RPATH wrappers for buildenv easyblock change buildenv easyblock: use python3 as default path to Python executable in RPATH wrapper scripts Sep 16, 2025
Copy link
Copy Markdown
Member

@boegel boegel left a comment

Choose a reason for hiding this comment

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

lgtm

@boegel boegel merged commit 1d3f837 into easybuilders:develop Sep 23, 2025
17 checks passed
@boegel boegel added change and removed bug fix labels Sep 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants