Skip to content

Commit

Permalink
Merge branch 'main' into testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert McLay committed Jul 21, 2024
2 parents bdcccd7 + 8443a6e commit 6549f0b
Show file tree
Hide file tree
Showing 17 changed files with 198 additions and 74 deletions.
2 changes: 1 addition & 1 deletion .versionDate
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-07-11 16:39 -06:00
2024-07-18 15:04 -05:00
3 changes: 3 additions & 0 deletions README.new
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,6 @@ Lmod 8.7+
(8.7.42) * Fix setting of $FPATH when running bash or ksh shell and executing zsh -l.
(8.7.43) * Support for ksh flag not needed anymore
(8.7.44) * Issue #710: path2pathA() keep double delims, Reduce triple delims to double
(8.7.45) * Issue #713: Changing MName.src: l_find_highest_by_key() to loop over all fileA entries.
Now stoping at first one found rather than just looking at fileA[1].
* Issue #714: Adding "=encoding UTF-8" to pod generation
4 changes: 3 additions & 1 deletion docs/source/170_hooks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ used in the Lmod program.


**load** (...):
This function is called after a modulefile is loaded in "load" mode.
This function is called after a modulefile is loaded in "load"
mode. Use **load_spider()** hook instead when desiring a hook during
spider evaluation.

**unload** (...):
This function is called after a modulefile is unloaded in "unload" mode.
Expand Down
3 changes: 2 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
# The short X.Y version.
version = '8.7'
# The full version, including alpha/beta/rc tags.
release = '8.7.44'
release = '8.7.45'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -398,5 +398,6 @@






11 changes: 6 additions & 5 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 shell --regression_testing --version
===========================
Modules based on Lua: Version 8.7.40 2024-06-11 15:18 -06:00
Modules based on Lua: Version 8.7.44 2024-07-11 16:39 -06:00
by Robert McLay [email protected]
===========================
step 2
Expand Down Expand Up @@ -109,7 +109,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 https://lmod.readthedocs.io/en/latest/075_bug_reporting.html
Modules based on Lua: Version 8.7.40 2024-06-11 15:18 -06:00
Modules based on Lua: Version 8.7.44 2024-07-11 16:39 -06:00
by Robert McLay [email protected]
===========================
step 3
Expand Down Expand Up @@ -216,7 +216,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 https://lmod.readthedocs.io/en/latest/075_bug_reporting.html
Modules based on Lua: Version 8.7.40 2024-06-11 15:18 -06:00
Modules based on Lua: Version 8.7.44 2024-07-11 16:39 -06:00
by Robert McLay [email protected]
===========================
step 4
Expand All @@ -236,7 +236,7 @@ Version 9
step 5
lua ProjectDIR/src/lmod.in.lua shell --regression_testing --config
===========================
Modules based on Lua: Version 8.7.40 2024-06-11 15:18 -06:00
Modules based on Lua: Version 8.7.44 2024-07-11 16:39 -06:00
by Robert McLay [email protected]
Description Value
Allow root to use Lmod (LMOD_ALLOW_ROOT_USE) yes
Expand Down Expand Up @@ -417,7 +417,7 @@ propT = {
step 6
lua ProjectDIR/src/lmod.in.lua shell --regression_testing --miniConfig
===========================
Modules based on Lua: Version 8.7.40 2024-06-11 15:18 -06:00
Modules based on Lua: Version 8.7.44 2024-07-11 16:39 -06:00
by Robert McLay [email protected]
LMOD_PACKAGE_PATH D nil <empty>
LMOD_SYSTEM_DEFAULT_MODULES D __unknown__ <empty>
Expand All @@ -426,6 +426,7 @@ LMOD_USING_FAST_TCL_INTERP Other yes no
step 7
lua ProjectDIR/src/lmod.in.lua shell --regression_testing --pod
===========================
=encoding UTF-8
module
=head1 SYNOPSIS
module [options] sub-command [args ...]
Expand Down
40 changes: 39 additions & 1 deletion rt/hidden/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 shell --regression_testing --version
===========================
Modules based on Lua: Version 8.6.9 2022-02-02 11:25 -04:00
Modules based on Lua: Version 8.7.44 2024-07-11 16:39 -06:00
by Robert McLay [email protected]
===========================
step 2
Expand Down Expand Up @@ -31,3 +31,41 @@ Currently Loaded Modules:
Where:
H: Hidden Module
S: Module is Sticky, requires --force to unload or purge
===========================
step 5
lua ProjectDIR/src/lmod.in.lua shell --regression_testing purge
===========================
The following modules were not unloaded:
(Use "module --force purge" to unload all):
1) .system
===========================
step 6
lua ProjectDIR/src/lmod.in.lua shell --regression_testing --show_hidden av
===========================
ProjectDIR/rt/hidden/mf2/top
A/1.0 B/.9.8.7 (H)
ProjectDIR/rt/hidden/mf2/bottom
A/2.0 B/9.8.7
Where:
H: Hidden Module
Module defaults are chosen based on Find First Rules due to Name/Version/Version modules found in the module tree.
See https://lmod.readthedocs.io/en/latest/060_locating.html for details.
If the avail list is too long consider trying:
"module --default avail" or "ml -d av" to just list the default modules.
"module overview" or "ml ov" to display the number of modules for each name.
Use "module spider" to find all possible modules and extensions.
Use "module keyword key1 key2 ..." to search for all possible modules matching any of the "keys".
===========================
step 7
lua ProjectDIR/src/lmod.in.lua shell --regression_testing load B
===========================
===========================
step 8
lua ProjectDIR/src/lmod.in.lua shell --regression_testing load A
===========================
===========================
step 9
lua ProjectDIR/src/lmod.in.lua shell --regression_testing list
===========================
Currently Loaded Modules:
1) B/9.8.7 2) A/1.0
9 changes: 9 additions & 0 deletions rt/hidden/hidden.tdesc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ testdescript = {
runLmod load .system # 3
runLmod list # 4
runLmod purge # 5
unsetMT
export MODULEPATH=$(testDir)/mf2/top:$(testDir)/mf2/bottom
export LMOD_TMOD_FIND_FIRST=1
runLmod --show_hidden av # 6
runLmod load B # 7
runLmod load A # 8
runLmod list # 9
HOME=$ORIG_HOME
cat _stdout.[0-9][0-9][0-9] > _stdout.orig
joinBase64Results -bash _stdout.orig _stdout.new
Expand Down
1 change: 1 addition & 0 deletions rt/hidden/mf2/bottom/A/2.0.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
setenv(myModuleName(),myModuleVersion())
1 change: 1 addition & 0 deletions rt/hidden/mf2/bottom/B/9.8.7.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
setenv(myModuleName(),myModuleVersion())
1 change: 1 addition & 0 deletions rt/hidden/mf2/top/A/1.0.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
setenv(myModuleName(),myModuleVersion())
1 change: 1 addition & 0 deletions rt/hidden/mf2/top/B/.9.8.7.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
setenv(myModuleName(),myModuleVersion())
56 changes: 56 additions & 0 deletions rt/hidden/out.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,59 @@ MODULEPATH=ProjectDIR/rt/hidden/mf;
export MODULEPATH;
_ModuleTable_='_ModuleTable_={MTversion=3,depthT={},family={},mT={[".system"]={fn="ProjectDIR/rt/hidden/mf/.system.lua",fullName=".system",loadOrder=1,propT={lmod={sticky=1,},},stackDepth=0,status="active",userName=".system",wV="M.*zfinal",},},mpathA={"ProjectDIR/rt/hidden/mf",},systemBaseMPATH="ProjectDIR/rt/hidden/mf",}';
export _ModuleTable_;
===========================
step 5
lua ProjectDIR/src/lmod.in.lua shell --regression_testing purge
===========================
MODULEPATH=ProjectDIR/rt/hidden/mf;
export MODULEPATH;
_ModuleTable_='_ModuleTable_={MTversion=3,depthT={},family={},mT={[".system"]={fn="ProjectDIR/rt/hidden/mf/.system.lua",fullName=".system",loadOrder=1,propT={lmod={sticky=1,},},stackDepth=0,status="active",userName=".system",wV="M.*zfinal",},},mpathA={"ProjectDIR/rt/hidden/mf",},systemBaseMPATH="ProjectDIR/rt/hidden/mf",}';
export _ModuleTable_;
===========================
step 6
lua ProjectDIR/src/lmod.in.lua shell --regression_testing --show_hidden av
===========================
unset LOADEDMODULES;
__LMOD_REF_COUNT_MODULEPATH=ProjectDIR/rt/hidden/mf2/top:1\;ProjectDIR/rt/hidden/mf2/bottom:1;
export __LMOD_REF_COUNT_MODULEPATH;
MODULEPATH=ProjectDIR/rt/hidden/mf2/top:ProjectDIR/rt/hidden/mf2/bottom;
export MODULEPATH;
unset _LMFILES_;
_ModuleTable_='_ModuleTable_={MTversion=3,depthT={},family={},mT={},mpathA={"ProjectDIR/rt/hidden/mf2/top","ProjectDIR/rt/hidden/mf2/bottom",},systemBaseMPATH="ProjectDIR/rt/hidden/mf2/top:ProjectDIR/rt/hidden/mf2/bottom",}';
export _ModuleTable_;
===========================
step 7
lua ProjectDIR/src/lmod.in.lua shell --regression_testing load B
===========================
B=9.8.7;
export B;
LOADEDMODULES=B/9.8.7;
export LOADEDMODULES;
MODULEPATH=ProjectDIR/rt/hidden/mf2/top:ProjectDIR/rt/hidden/mf2/bottom;
export MODULEPATH;
_LMFILES_=ProjectDIR/rt/hidden/mf2/bottom/B/9.8.7.lua;
export _LMFILES_;
_ModuleTable_='_ModuleTable_={MTversion=3,depthT={},family={},mT={B={fn="ProjectDIR/rt/hidden/mf2/bottom/B/9.8.7.lua",fullName="B/9.8.7",loadOrder=1,propT={},stackDepth=0,status="active",userName="B",wV="000000009.000000008.000000007.*zfinal",},},mpathA={"ProjectDIR/rt/hidden/mf2/top","ProjectDIR/rt/hidden/mf2/bottom",},systemBaseMPATH="ProjectDIR/rt/hidden/mf2/top:ProjectDIR/rt/hidden/mf2/bottom",}';
export _ModuleTable_;
===========================
step 8
lua ProjectDIR/src/lmod.in.lua shell --regression_testing load A
===========================
A=1.0;
export A;
LOADEDMODULES=B/9.8.7:A/1.0;
export LOADEDMODULES;
MODULEPATH=ProjectDIR/rt/hidden/mf2/top:ProjectDIR/rt/hidden/mf2/bottom;
export MODULEPATH;
_LMFILES_=ProjectDIR/rt/hidden/mf2/bottom/B/9.8.7.lua:ProjectDIR/rt/hidden/mf2/top/A/1.0.lua;
export _LMFILES_;
_ModuleTable_='_ModuleTable_={MTversion=3,depthT={},family={},mT={A={fn="ProjectDIR/rt/hidden/mf2/top/A/1.0.lua",fullName="A/1.0",loadOrder=2,propT={},stackDepth=0,status="active",userName="A",wV="000000001.*zfinal",},B={fn="ProjectDIR/rt/hidden/mf2/bottom/B/9.8.7.lua",fullName="B/9.8.7",loadOrder=1,propT={},stackDepth=0,status="active",userName="B",wV="000000009.000000008.000000007.*zfinal",},},mpathA={"ProjectDIR/rt/hidden/mf2/top","ProjectDIR/rt/hidden/mf2/bottom",},systemBaseMPATH="ProjectDIR/rt/hidden/mf2/top:ProjectDIR/rt/hidden/mf2/bottom",}';
export _ModuleTable_;
===========================
step 9
lua ProjectDIR/src/lmod.in.lua shell --regression_testing list
===========================
MODULEPATH=ProjectDIR/rt/hidden/mf2/top:ProjectDIR/rt/hidden/mf2/bottom;
export MODULEPATH;
_ModuleTable_='_ModuleTable_={MTversion=3,depthT={},family={},mT={A={fn="ProjectDIR/rt/hidden/mf2/top/A/1.0.lua",fullName="A/1.0",loadOrder=2,propT={},stackDepth=0,status="active",userName="A",wV="000000001.*zfinal",},B={fn="ProjectDIR/rt/hidden/mf2/bottom/B/9.8.7.lua",fullName="B/9.8.7",loadOrder=1,propT={},stackDepth=0,status="active",userName="B",wV="000000009.000000008.000000007.*zfinal",},},mpathA={"ProjectDIR/rt/hidden/mf2/top","ProjectDIR/rt/hidden/mf2/bottom",},systemBaseMPATH="ProjectDIR/rt/hidden/mf2/top:ProjectDIR/rt/hidden/mf2/bottom",}';
export _ModuleTable_;
6 changes: 3 additions & 3 deletions settarg/Version.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ function M.branchStr()
end
return s == "" and s or "[branch: "..s.."]"
end
function M.tag() return "8.7.44" end
function M.tag() return "8.7.45" end
function M.git()
local s = "8.7.44"
local s = "8.7.45"
if (s == "@" .. "git@") then s = "" end
if (s == M.tag() ) then s = "" end
return s == "" and s or "("..s..")"
end
function M.date() return "2024-07-11 16:39 -06:00" end
function M.date() return "2024-07-18 15:04 -05:00" end
function M.name()
local a = {}
a[#a+1] = M.tag()
Expand Down
54 changes: 30 additions & 24 deletions src/MName.lua
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ function M.find_exact_match(self, fileA)
end
end

---dbg.print{"found: ",found,", fn: ",fn,", version: ", version,"\n"}
--dbg.print{"found: ",found,", fn: ",fn,", version: ", version,"\n"}
--dbg.fini("MName:find_exact_match")
return found, fn, version, wV
end
Expand Down Expand Up @@ -491,37 +491,43 @@ end


local function l_find_highest_by_key(self, key, fileA)
--dbg.start{"MName:find_by_key(key:\"",key,"\",fileA)"}
--dbg.start{"MName: l_find_highest_by_key(key:\"",key,"\",fileA)"}
local mrc = MRC:singleton()
local a = fileA[1] or {}
local weight = " " -- this is less than the lower possible weight.
local idx = nil
local fn = false
local found = false
local version = false
local pV = false
local wV = false
fileA = fileA or {}
local blockA

for j = 1,#a do
local entry = a[j]
local v = entry[key]
if (mrc:isVisible{fullName=entry.fullName,sn=entry.sn,fn=entry.fn} or isMarked(v)) then
if (v > weight) then
idx = j
weight = v
pV = entry.pV
wV = entry.wV
for j = 1,#fileA do
blockA = fileA[j]

for i = 1,#blockA do
local entry = blockA[i]
local v = entry[key]
if (mrc:isVisible{fullName=entry.fullName,sn=entry.sn,fn=entry.fn} or isMarked(v)) then
if (v > weight) then
idx = i
weight = v
pV = entry.pV
wV = entry.wV
end
end
end
if (idx) then break end
end
if (idx) then
fn = a[idx].fn
version = a[idx].version or false
fn = blockA[idx].fn
version = blockA[idx].version or false
found = true
self.__range = { pV, pV }
end
--dbg.print{"found: ",found,", fn: ",fn,", version: ", version,", wV: ",wV,"\n"}
--dbg.fini("MName:find_by_key")
--dbg.fini("MName: l_find_highest_by_key")
return found, fn, version, wV
end

Expand Down Expand Up @@ -589,12 +595,12 @@ function M.find_inherit_match(self,fileA)
end

local function l_rangeCk(self, version, result_if_found, result_if_not_found)
dbg.start{"l_rangeCk(self, version: ",version,", result_if_found: ",result_if_found,", result_if_not_found: ",result_if_not_found,")"}
--dbg.start{"l_rangeCk(self, version: ",version,", result_if_found: ",result_if_found,", result_if_not_found: ",result_if_not_found,")"}
local have_range = false
local result = result_if_not_found
if (not self.__have_range) then
dbg.print{"no range\n"}
dbg.fini("l_rangeCk")
--dbg.print{"no range\n"}
--dbg.fini("l_rangeCk")
return have_range, result
end

Expand All @@ -604,17 +610,17 @@ local function l_rangeCk(self, version, result_if_found, result_if_not_found)
local lowerFn = self.__range_fnA[1]
local upperFn = self.__range_fnA[2]
local pV = parseVersion(version)
dbg.print{"lowerBound: ",lowerBound,"\n"}
dbg.print{"upperBound: ",upperBound,"\n"}
dbg.print{"pV: ",pV,"\n"}
dbg.print{"lowerFn: ",lowerFn.name,", lowerFn.func(lowerBound, pV): ",lowerFn.func(lowerBound, pV),"\n"}
dbg.print{"upperFn: ",upperFn.name,", upperFn.func(pV, upperBound): ",upperFn.func(pV, upperBound),"\n"}
--dbg.print{"lowerBound: ",lowerBound,"\n"}
--dbg.print{"upperBound: ",upperBound,"\n"}
--dbg.print{"pV: ",pV,"\n"}
--dbg.print{"lowerFn: ",lowerFn.name,", lowerFn.func(lowerBound, pV): ",lowerFn.func(lowerBound, pV),"\n"}
--dbg.print{"upperFn: ",upperFn.name,", upperFn.func(pV, upperBound): ",upperFn.func(pV, upperBound),"\n"}

if (lowerFn.func(lowerBound, pV) and upperFn.func(pV, upperBound)) then
result = result_if_found
end

dbg.fini("l_rangeCk")
--dbg.fini("l_rangeCk")
return have_range, result
end

Expand Down
Loading

0 comments on commit 6549f0b

Please sign in to comment.