Skip to content

Commit

Permalink
Issue TACC#548: Check dependency with both sn and fullName
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert McLay committed Dec 10, 2021
1 parent 8c94ca3 commit 8a3e96f
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 6 deletions.
7 changes: 7 additions & 0 deletions rt/depends_on/depends_on.tdesc
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ testdescript = {
runLmod load SomeSoftware OtherSoftware #34
runLmod list #35
runLmod purge #36
unsetMT
export MODULEPATH=$(testDir)/mf/Core3
unset LMOD_PIN_VERSIONS
runLmod load A #37
runLmod list #38
HOME=$ORIG_HOME
cat _stdout.[0-9][0-9][0-9] > _stdout.orig
Expand Down
17 changes: 16 additions & 1 deletion rt/depends_on/err.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
step 1
lua ProjectDIR/src/lmod.in.lua bash --regression_testing --version
===========================
Modules based on Lua: Version 8.5.21 2021-10-22 09:54 -05:00
Modules based on Lua: Version 8.6 2021-12-06 17:19 -06:00
by Robert McLay [email protected]
===========================
step 2
Expand Down Expand Up @@ -181,3 +181,18 @@ lua ProjectDIR/src/lmod.in.lua bash --regression_testing list
===========================
Currently Loaded Modules:
1) SomeSoftware/1.2 2) Dependency/5.6 3) OtherSoftware/3.4
===========================
step 36
lua ProjectDIR/src/lmod.in.lua bash --regression_testing purge
===========================
Processing Dependency/5.6
===========================
step 37
lua ProjectDIR/src/lmod.in.lua bash --regression_testing load A
===========================
===========================
step 38
lua ProjectDIR/src/lmod.in.lua bash --regression_testing list
===========================
Currently Loaded Modules:
1) B/2.0 2) A/1.0
1 change: 1 addition & 0 deletions rt/depends_on/mf/Core3/A/1.0.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
depends_on("B/2.0")
1 change: 1 addition & 0 deletions rt/depends_on/mf/Core3/B/2.0.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
depends_on("A/1.0")
38 changes: 38 additions & 0 deletions rt/depends_on/out.txt
Original file line number Diff line number Diff line change
Expand Up @@ -427,3 +427,41 @@ MODULEPATH=ProjectDIR/rt/depends_on/mf/Core2;
export MODULEPATH;
_ModuleTable_='_ModuleTable_={MTversion=3,depthT={},family={},mT={Dependency={fn="ProjectDIR/rt/depends_on/mf/Core2/Dependency/5.6.lua",fullName="Dependency/5.6",loadOrder=2,propT={},ref_count=1,stackDepth=1,status="active",userName="Dependency/5.6",wV="000000005.000000006.*zfinal",},OtherSoftware={fn="ProjectDIR/rt/depends_on/mf/Core2/OtherSoftware/3.4.lua",fullName="OtherSoftware/3.4",loadOrder=3,propT={},stackDepth=0,status="active",userName="OtherSoftware",wV="000000003.000000004.*zfinal",},SomeSoftware={fn="ProjectDIR/rt/depends_on/mf/Core2/SomeSoftware/1.2.lua",fullName="SomeSoftware/1.2",loadOrder=1,propT={},stackDepth=0,status="active",userName="SomeSoftware",wV="000000001.000000002.*zfinal",},},mpathA={"ProjectDIR/rt/depends_on/mf/Core2",},systemBaseMPATH="ProjectDIR/rt/depends_on/mf/Core2",}';
export _ModuleTable_;
===========================
step 36
lua ProjectDIR/src/lmod.in.lua bash --regression_testing purge
===========================
unset __LMOD_REF_COUNT_LOADEDMODULES;
unset LOADEDMODULES;
MODULEPATH=ProjectDIR/rt/depends_on/mf/Core2;
export MODULEPATH;
unset __LMOD_REF_COUNT__LMFILES_;
unset _LMFILES_;
_ModuleTable_='_ModuleTable_={MTversion=3,depthT={},family={},mT={},mpathA={"ProjectDIR/rt/depends_on/mf/Core2",},systemBaseMPATH="ProjectDIR/rt/depends_on/mf/Core2",}';
export _ModuleTable_;
===========================
step 37
lua ProjectDIR/src/lmod.in.lua bash --regression_testing load A
===========================
__LMOD_REF_COUNT_LOADEDMODULES=B/2.0:1\;A/1.0:1;
export __LMOD_REF_COUNT_LOADEDMODULES;
LOADEDMODULES=B/2.0:A/1.0;
export LOADEDMODULES;
__LMOD_REF_COUNT_MODULEPATH=ProjectDIR/rt/depends_on/mf/Core3:1;
export __LMOD_REF_COUNT_MODULEPATH;
MODULEPATH=ProjectDIR/rt/depends_on/mf/Core3;
export MODULEPATH;
__LMOD_REF_COUNT__LMFILES_=ProjectDIR/rt/depends_on/mf/Core3/B/2.0.lua:1\;ProjectDIR/rt/depends_on/mf/Core3/A/1.0.lua:1;
export __LMOD_REF_COUNT__LMFILES_;
_LMFILES_=ProjectDIR/rt/depends_on/mf/Core3/B/2.0.lua:ProjectDIR/rt/depends_on/mf/Core3/A/1.0.lua;
export _LMFILES_;
_ModuleTable_='_ModuleTable_={MTversion=3,depthT={},family={},mT={A={fn="ProjectDIR/rt/depends_on/mf/Core3/A/1.0.lua",fullName="A/1.0",loadOrder=2,propT={},stackDepth=0,status="active",userName="A",wV="000000001.*zfinal",},B={fn="ProjectDIR/rt/depends_on/mf/Core3/B/2.0.lua",fullName="B/2.0",loadOrder=1,propT={},ref_count=1,stackDepth=1,status="active",userName="B/2.0",wV="000000002.*zfinal",},},mpathA={"ProjectDIR/rt/depends_on/mf/Core3",},systemBaseMPATH="ProjectDIR/rt/depends_on/mf/Core3",}';
export _ModuleTable_;
===========================
step 38
lua ProjectDIR/src/lmod.in.lua bash --regression_testing list
===========================
MODULEPATH=ProjectDIR/rt/depends_on/mf/Core3;
export MODULEPATH;
_ModuleTable_='_ModuleTable_={MTversion=3,depthT={},family={},mT={A={fn="ProjectDIR/rt/depends_on/mf/Core3/A/1.0.lua",fullName="A/1.0",loadOrder=2,propT={},stackDepth=0,status="active",userName="A",wV="000000001.*zfinal",},B={fn="ProjectDIR/rt/depends_on/mf/Core3/B/2.0.lua",fullName="B/2.0",loadOrder=1,propT={},ref_count=1,stackDepth=1,status="active",userName="B/2.0",wV="000000002.*zfinal",},},mpathA={"ProjectDIR/rt/depends_on/mf/Core3",},systemBaseMPATH="ProjectDIR/rt/depends_on/mf/Core3",}';
export _ModuleTable_;
10 changes: 6 additions & 4 deletions rt/help/err.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
step 1
lua ProjectDIR/src/lmod.in.lua bash --regression_testing --version
===========================
Modules based on Lua: Version 8.5.24 2021-11-10 09:41 -06:00
Modules based on Lua: Version 8.6 2021-12-06 17:19 -06:00
by Robert McLay [email protected]
===========================
step 2
Expand Down Expand Up @@ -103,7 +103,7 @@ Lmod Web Sites
SourceForge: https://lmod.sf.net
TACC Homepage: https://www.tacc.utexas.edu/research-development/tacc-projects/lmod
To report a bug please read http://lmod.readthedocs.io/en/latest/075_bug_reporting.html
Modules based on Lua: Version 8.5.24 2021-11-10 09:41 -06:00
Modules based on Lua: Version 8.6 2021-12-06 17:19 -06:00
by Robert McLay [email protected]
===========================
step 3
Expand Down Expand Up @@ -204,7 +204,7 @@ Lmod Web Sites
SourceForge: https://lmod.sf.net
TACC Homepage: https://www.tacc.utexas.edu/research-development/tacc-projects/lmod
To report a bug please read http://lmod.readthedocs.io/en/latest/075_bug_reporting.html
Modules based on Lua: Version 8.5.24 2021-11-10 09:41 -06:00
Modules based on Lua: Version 8.6 2021-12-06 17:19 -06:00
by Robert McLay [email protected]
===========================
step 4
Expand All @@ -224,12 +224,13 @@ Version 9
step 5
lua ProjectDIR/src/lmod.in.lua bash --regression_testing --config
===========================
Modules based on Lua: Version 8.5.24 2021-11-10 09:41 -06:00
Modules based on Lua: Version 8.6 2021-12-06 17:19 -06:00
by Robert McLay [email protected]
Description Value
Allow root to use Lmod yes
Allow TCL modulefiles yes
Auto swapping yes
Avail Style <system>
Case Independent Sorting no
Colorize Lmod yes
Configuration dir /etc/lmod
Expand Down Expand Up @@ -262,6 +263,7 @@ Pkg Class name Pkg
Lmod prefix @PREFIX@
Site controlled prefix no
Prepend order normal
LMOD_RC <empty>
Redirect to stdout no
Supporting Full Settarg Use no
User shell bash
Expand Down
6 changes: 6 additions & 0 deletions src/Configuration.lua
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@ local function l_new(self)
local tracing = cosmic:value("LMOD_TRACING")
local fast_tcl_interp = cosmic:value("LMOD_FAST_TCL_INTERP")
local allow_root_use = cosmic:value("LMOD_ALLOW_ROOT_USE")
local lmodrc = cosmic:value("LMOD_RC")

if (lmodrc == "") then
lmodrc = "<empty>"
end

if (not rc:find(":") and not isFile(rc)) then
rc = rc .. " -> <empty>"
Expand Down Expand Up @@ -237,6 +242,7 @@ local function l_new(self)
tbl.prefix = { k = "Lmod prefix" , v = "@PREFIX@", }
tbl.prefix_site = { k = "Site controlled prefix" , v = site_prefix, }
tbl.prpnd_blk = { k = "Prepend order" , v = prepend_block, }
tbl.rc = { k = "LMOD_RC" , v = lmodrc, }
tbl.settarg = { k = "Supporting Full Settarg Use" , v = settarg_support, }
tbl.shell = { k = "User shell" , v = myShellName(), }
tbl.sitePkg = { k = "Site Pkg location" , v = locSitePkg, }
Expand Down
3 changes: 2 additions & 1 deletion src/MT.lua
Original file line number Diff line number Diff line change
Expand Up @@ -654,8 +654,9 @@ function M.haveUserName(self, mname, status)
if (not result) then
return false
end
local userName = mname:userName()

return self:userName(sn) == mname:userName()
return self:userName(sn) == userName or self:fullName(sn) == userName
end

function M.lookup_w_userName(self,userName)
Expand Down

0 comments on commit 8a3e96f

Please sign in to comment.