You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To be more in line with Lmod, I have made modulecmd.tcl command return a non-zero exit code when a module evaluation fails. This is a regular behavior for any kind of command when something goes wrong, like for instance in our field when trying to evaluate a module that does not exist.
I am working to adapt EasyBuild to make it fit this behavior change in Environment Modules v5.5 (easybuilders/easybuild-framework#4739) and I found something that may be of interest for you.
Describe the issue
EasyBuild is internally running the show sub-command to determine if a module exist or not.
When trying to load a non-existent module, the lmod script sets a non-zero exit code.
But when running the show sub-command, the lmod script sets a zero exit code whether the module exist or not.
To Reproduce
$ $LMOD_CMD bash --versionModules based on Lua: Version 8.7.55 (8.7.55-5-g1f416cc2a) 2025-01-08 07:32 +01:00 by Robert McLay [email protected]
$ $LMOD_CMD bash load unknown_moduleLmod has detected the following error: The following module(s) are unknown: "unknown_module"Please check the spelling or version number. Also try "module spider ..."It is also possible your cache file is out-of-date; it may help to try: $ module --ignore_cache load "unknown_module"Also make sure that all modulefiles written in TCL start with the string #%Modulefalse
$ echo$?1
$ $LMOD_CMD bash show unknown_moduleLmod Warning: Failed to find the following module(s): "unknown_module" in your MODULEPATHTry: $ module spider unknown_moduleto see if the module(s) are available across all compilers and MPI implementations.MODULEPATH=/usr/share/Modules/modulefiles:/etc/modulefiles:/usr/share/modulefiles;export MODULEPATH;_ModuleTable001_=X01vZHVsZVRhYmxlXyA9IHsKTVR2ZXJzaW9uID0gMywKY19yZWJ1aWxkVGltZSA9IDcyMDAuMCwKY19zaG9ydFRpbWUgPSAwLjA2NjI1MTAzOTUwNTAwNSwKZGVwdGhUID0ge30sCmZhbWlseSA9IHt9LAptVCA9IHt9LAptcGF0aEEgPSB7CiIvdXNyL3NoYXJlL01vZHVsZXMvbW9kdWxlZmlsZXMiLCAiL2V0Yy9tb2R1bGVmaWxlcyIsICIvdXNyL3NoYXJlL21vZHVsZWZpbGVzIiwKfSwKc3lzdGVtQmFzZU1QQVRIID0gIi91c3Ivc2hhcmUvTW9kdWxlcy9tb2R1bGVmaWxlczovZXRjL21vZHVsZWZpbGVzOi91c3Ivc2hhcmUvbW9kdWxlZmlsZXMiLAp9Cg==;export _ModuleTable001_;_ModuleTable_Sz_=1;export _ModuleTable_Sz_;
$ echo$?0
Expected behavior
As show sub-command makes a module evaluation like load sub-command, it may be interesting to produce an error (and make lmod script sets a non-zero exit code) when trying to evaluate a non-exiting module.
Desktop (please complete the following information):
OS: Linux
Linux distribution: Fedora 40
Lmod Version: 8.7.55
The text was updated successfully, but these errors were encountered:
Thanks very much for reporting this issue. I have uploaded branch IS743-show to github that fixes this for me. This change comes down to changing the warning to an error when show cannot find a module.
@xdelaruelle : Please test out this branch if you get the change and report back @boegel Could you also test this change with easybuild
Many thanks Robert. I have test the new branch and it gives me the expected result with the show sub-command.
I have also run the modules and modulestool sections of the easybuild-framework testsuite against this new Lmod version. With regular easybuild-framework code from 5.0.x branch, tests test_exist and test_modpath_extensions_for fail. But with patch proposed on easybuilders/easybuild-framework#4739, all tests pass.
Input from @boegel is important to determine if this change does not break all existing installation of EasyBuild using Lmod if people decide to update Lmod to the latest version.
Hello Lmod Team,
To be more in line with Lmod, I have made
modulecmd.tcl
command return a non-zero exit code when a module evaluation fails. This is a regular behavior for any kind of command when something goes wrong, like for instance in our field when trying to evaluate a module that does not exist.I am working to adapt EasyBuild to make it fit this behavior change in Environment Modules v5.5 (easybuilders/easybuild-framework#4739) and I found something that may be of interest for you.
Describe the issue
EasyBuild is internally running the
show
sub-command to determine if a module exist or not.When trying to load a non-existent module, the
lmod
script sets a non-zero exit code.But when running the
show
sub-command, thelmod
script sets a zero exit code whether the module exist or not.To Reproduce
Expected behavior
As
show
sub-command makes a module evaluation likeload
sub-command, it may be interesting to produce an error (and makelmod
script sets a non-zero exit code) when trying to evaluate a non-exiting module.Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: