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

Adapt module show command run to cope with non-zero exit code for non-existing module (required for Environment Modules v5.5+ and Lmod 8.7.56+) #4739

Merged
merged 2 commits into from
Feb 9, 2025

Conversation

xdelaruelle
Copy link
Contributor

The module show command is used by ModulesTool exist method to test the existence of a modulefile. Running module show against a non-existing modulefile will make modulecmd.tcl script to produce a non-zero exit code starting Modules v5.5.

With this change, the exit code check when running module show is disabled. It should not harm the module existence check as it relies on the analysis of the obtained stderr output.

Note that Lmod (as of version 8.7.55) does not set a non-zero exit code when running module show against a non-existing modulefile when LMOD_QUIET environment variable is set. If this behavior is changed in the future, this change will also benefit to Lmod.

The "module show" command is used by ModulesTool "exist" method to test
the existence of a modulefile. Running "module show" against a
non-existing modulefile will make modulecmd.tcl script to produce a
non-zero exit code starting Modules v5.5.

With this change, the exit code check when running "module show" is
disabled. It should not harm the module existence check as it relies
on the analysis of the obtained stderr output.

Note that Lmod (as of version 8.7.55) does not set a non-zero exit code
when running "module show" against a non-existing modulefile when
LMOD_QUIET environment variable is set. If this behavior is changed in
the future, this commit will also benefit to Lmod.
Starting Environment Modules v5.5, a non-zero exit code is set by
modulecmd.tcl when trying to load a non-existing module.
@boegel boegel added bug fix EasyBuild-5.0 EasyBuild 5.0 labels Feb 5, 2025
@boegel boegel added this to the 5.0 milestone Feb 5, 2025
@boegel
Copy link
Member

boegel commented Feb 5, 2025

Looks OK, but I want to verify a bit better than we're not relying on the exit code in other places, where the show function is being relied on...

@boegel boegel changed the title Adapt module show command run to cope with Environment Modules v5.5+ Adapt module show command run to cope with non-zero exit code for non-existing module (required for Environment Modules v5.5+ and Lmod 8.7.56+) Feb 9, 2025
Copy link
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 cde21cb into easybuilders:5.0.x Feb 9, 2025
39 checks passed
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.

2 participants