TACC / Lmod

Lmod: An Environment Module System based on Lua, Reads TCL Modules, Supports a Software Hierarchy
http://lmod.readthedocs.org
Other
499 stars 128 forks source link

LmodBreak works for dir; errors for module #698

Closed guusbertens closed 8 months ago

guusbertens commented 8 months ago

Describe the bug

LmodBreak errors when loading an explicit module. When loading a directory, i.e. module load dir, it behaves as expected, but when loading a module from that directory, i.e. module load dir/module, Lmod errors out and no other modules get loaded.

To Reproduce

mkdir -p $HOME/modulefiles/break
echo "LmodBreak('break')" > $HOME/modulefiles/break/break.lua
echo > $HOME/modulefiles/other.lua
module use $HOME/modulefiles
module load break other   #  <-- only loads "other", as expected
module unload other
module load break/break other   # <-- Lmod errors; "other" is not loaded

Lmod output for the last command:

[src]$ module load break/break other
break
Lmod has detected the following error:  These module(s) or extension(s) exist but cannot
be loaded as requested: "break/break"
   Try: "module spider break/break" to see how to load the module(s).

Expected behavior

Based on the documentation ("However, all other modulefiles are evaluated."), I expect Lmod to continue loading other in either case.

Desktop (please complete the following information):

miniConfig for Lmod 8.7.36:

Modules based on Lua: Version 8.7.36   2024-03-15 13:45 +01:00
    by Robert McLay mclay@tacc.utexas.edu

Changes from Default Configuration
----------------------------------

Name                         Where Set  Default                                                                      Value
----                         ---------  -------                                                                      -----
LFS_VERSION                  D          1.6.3                                                                        1.8.0
LMOD_LD_LIBRARY_PATH         E          false                                                                        /sw/rl8/zen/app/Tcl/8.6.13-GCCcore-12.3.0/lib:/sw/rl8/zen/app/zlib/1.2.13-GCCcore-12.3.0/lib:/sw/rl8/zen/app/Lua/5.4.6-GCCcore-12.3.0/lib:/sw/rl8/zen/app/libreadline/8.2-GCCcore-12.3.0/lib:/sw/rl8/zen/app/ncurses/6.4-GCCcore-12.3.0/lib:/sw/rl8/zen/app/GCCcore/12.3.0/lib64
LMOD_PACKAGE_PATH            D          nil                                                                          <empty>
LMOD_PAGER                   C          less                                                                         /usr/bin/less
LMOD_SITEPACKAGE_LOCATION    Other      /home/tue/20232655/software/Lmod-8.7.36/lmod/8.7.36/libexec/SitePackage.lua  <srctree>
LMOD_SYSTEM_DEFAULT_MODULES  D          __unknown__                                                                  <empty>
LMOD_TCLSH                   C          tclsh                                                                        /sw/rl8/zen/app/Tcl/8.6.13-GCCcore-12.3.0/bin/tclsh
MODULEPATH_ROOT              C                                                                                       /home/tue/20232655/software/Lmod-8.7.36/modulefiles
PATH_TO_LUA                  C          lua                                                                          /sw/rl8/zen/app/Lua/5.4.6-GCCcore-12.3.0/bin/lua

Where Set -> D: default, E: environment, C: configuration
             lmod_cfg: lmod_config.lua SitePkg: SitePackage StdPkg: StandardPackage
             Other: Set somewhere outside of normal locations
rtmclay commented 8 months ago

Thanks very much for the bug report! As you noticed this bug occurred when command line name was "break/break" and not "break". Lmod keeps track of the requested modules to be loaded. Lmod missed the case where where the userName ("break/break") and the shortName, (sn: "break") were different. This is now fixed for me with Lmod 8.7.37.

Please test the latest version of Lmod to see if it works for you. If it does then feel free to close this issue.

guusbertens commented 8 months ago

Robert, thanks, this indeed fixes the issue!